Skip to content

refactor(control): split plan-todo seeding and module detection out of controller.go - #7787

Merged
esengine merged 2 commits into
main-v2from
refactor/control-file-splits
Aug 7, 2026
Merged

refactor(control): split plan-todo seeding and module detection out of controller.go#7787
esengine merged 2 commits into
main-v2from
refactor/control-file-splits

Conversation

@esengine

@esengine esengine commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Part of the controller god-object cleanup (controller.go doubled to 6.8k lines / Controller to 82 fields since the June decomposition pass).

What

Pure code motion, no signature or behavior changes:

  • plan_todos.go — the plan-todo seeding cluster: seedPlanTodos, completePlanTodos, PlanTodosJSON, parsePlanTodos, listItem, hasTodoUpdateSince and helpers (~250 lines). Mostly pure markdown-to-todo parsing; the only Controller state touched is sink/executor fan-out.
  • project_modules.go — the /plan-exec workspace module scan: detectProjectModules, hasFile, listSourceDirs, walkDir, hasSourceFiles (~70 lines). Pure filesystem scanning.

controller.go: 6818 → 6498 lines. sessionMessageCount stays in controller.go (generic session accessor used by the turn orchestrator).

Verification

  • gofmt clean, go vet ./internal/control/... clean
  • go test -race ./internal/control/ green
  • Full go test ./... green (English locale)

Cache-impact: none - pure file split inside internal/control; no provider request or cache logic involved.
Cache-guard: existing coverage - go test -race ./internal/control/ passes unchanged.
Documentation-impact: none - verbatim code motion within the control package; behavior and public API unchanged.

…f controller.go

Pure code motion: the plan-todo seeding cluster (seedPlanTodos,
PlanTodosJSON, parsePlanTodos, listItem and friends) moves to
plan_todos.go and the /plan-exec workspace module scan
(detectProjectModules and helpers) moves to project_modules.go.
controller.go 6818 -> 6498 lines, no signature or behavior changes.
@esengine
esengine requested a review from SivanCola as a code owner August 6, 2026 15:36
@github-actions github-actions Bot added v2 Go rewrite (1.x) — main-v2 branch, active development agent Core agent loop (internal/agent, internal/control) labels Aug 6, 2026
@esengine
esengine merged commit d64aea6 into main-v2 Aug 7, 2026
22 checks passed
@esengine
esengine deleted the refactor/control-file-splits branch August 7, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent Core agent loop (internal/agent, internal/control) v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant