Skip to content

fix: remove unused imports across 21 modules#563

Closed
Kailigithub wants to merge 1 commit into
lsdefine:mainfrom
Kailigithub:optimize/remove-unused-imports
Closed

fix: remove unused imports across 21 modules#563
Kailigithub wants to merge 1 commit into
lsdefine:mainfrom
Kailigithub:optimize/remove-unused-imports

Conversation

@Kailigithub
Copy link
Copy Markdown
Contributor

Summary

Removes 40 unused imports across 21 Python modules, reducing code clutter and improving static analysis accuracy.

Changes

Removed unused imports detected by ruff check --select F401. Side-effect imports (readline for REPL history, chatapp_common for monkey-patching) were preserved with # noqa: F401 annotations.

File Removed Imports
assets/agent_bbs.py JSONResponse
assets/code_run_header.py json, re, time
frontends/conductor.py json, typing.Any
frontends/dcapp.py build_done_text
frontends/qtapp.py Signal, QMetaObject, Q_ARG, QObject, clean_reply, build_done_text, os
frontends/tui_v3.py select, signal, lru_cache, Callable
frontends/tuiapp.py time
frontends/wechatapp.py math
frontends/wecomapp.py typing.Dict
llmcore.py base64
memory/L4_raw_sessions/compress_session.py json, ast
memory/autonomous_operation_sop/helper.py os
memory/ljqCtrl.py sys, random, math, ImageEnhance, ImageFilter, ImageDraw
memory/procmem_scanner.py sys, os
memory/ui_detect.py os
plugins/langfuse_tracing.py sys
reflect/agent_team_worker.py time
reflect/checklist_master.py time
simphtml.py os

Preserved with # noqa: F401:

  • agentmain.py: readline (side-effect: enables REPL history)
  • frontends/stapp.py: chatapp_common (side-effect: activates /continue command via monkey-patching)

Verification

  • ruff check --select F401 reports 0 remaining unused imports
  • All 21 modified files pass py_compile syntax check
  • Side-effect imports preserved and annotated

@lsdefine lsdefine closed this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants