Skip to content

refactor: Round 12 — lazy imports, dead code cleanup#81

Open
t0ugh-sys wants to merge 2 commits into
mainfrom
refactor/round12-team-drain-peek
Open

refactor: Round 12 — lazy imports, dead code cleanup#81
t0ugh-sys wants to merge 2 commits into
mainfrom
refactor/round12-team-drain-peek

Conversation

@t0ugh-sys
Copy link
Copy Markdown
Owner

Changes

1. Lazy-load submodules in __init__.py (biggest win)

  • Converted 28 eager from . import X to lazy __getattr__ pattern
  • Submodules are now imported only on first access, significantly reducing import anvil startup time
  • TYPE_CHECKING block preserves IDE autocompletion
  • All 300 tests pass

2. Dead code removal

  • skills.py: Removed unused _skill_doc_path() and _legacy_skill_doc_path() wrappers (only the _for_root variants are actually called)
  • team_runtime.py: Removed unused plan_approval_response enum value from TeamMessageType
  • cli.py: Removed unused Dict import from typing

Cumulative stats (Rounds 2–12)

  • ~46 files modified across 10 PRs
  • ~350+ lines of dead/duplicate code removed
  • 10+ bugs fixed
  • ~50 modules with complete __all__
  • 300/300 tests passing throughout

t0ugh-sys added 2 commits June 1, 2026 22:27
Round 12 — extract _read_messages() helper from JsonlTeamInboxStore.

drain() and peek() had identical 10-line JSONL reading blocks.
Now both delegate to _read_messages(), cutting ~15 lines.

300/300 tests passing.
…s/team_runtime/cli

- __init__.py: convert 28 eager submodule imports to lazy __getattr__
  pattern, reducing import startup cost significantly
- skills.py: remove dead _skill_doc_path and _legacy_skill_doc_path wrappers
- team_runtime.py: remove unused plan_approval_response enum value
- cli.py: remove unused Dict import
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.

1 participant