refactor(director): make workflow coordination host-owned, drop inert classifier - #1040
Merged
TheGreatAxios merged 4 commits intoSep 15, 2026
Conversation
… from ChatDirectorOptions Decision: - workflow coordination is host-owned. WorkflowHost owns the runtime lifecycle (start/resume/reset/persist), which is load-bearing, so the WorkflowCoordinator instance stays host-owned and reaches the director only through the narrow setWorkflowCoordinator live-object seam (the only path production ever used; the constructor option had zero suppliers). All director consult sites (directive, idle rails, gate, handleToolDone) unchanged. - task-boundary classification is neither a host closure nor native director behavior. The taskClassifier seam had zero production suppliers (assembleChatAgent funnel never passes it; TUI and exec omit it), so the decide()-time new-task path was inert in product and its removal keeps TUI behavior byte-identical. The pure classifier (classifyTaskBoundary Tier-1 heuristics + caller-supplied Tier-2) stays in session/compactor.ts as host-free library. Rejected: - tools the director calls (loop-internal automation must not mount model-visible surface), - BaseEnv handles (live non-serializable objects are not config; no new env keys), - moving decide()-time directive/idle/gate rails out of the director (they are the loop), - keeping the constructor option (dead duplicate of the setter blocking zero-closure), - native heuristics-only classification in the director (would newly arm new-task envelopes in the TUI), - native full-LLM-tier classification (decide() has no side-channel inference handle; adding one would be a new host closure). Zero-closure: both closures removed from ChatDirectorOptions. Remaining closures (onActivateTools, onTasksChange, requestContinuation, getProviderId, getLiveFleetCount) belong to sibling lanes CL-7916/7917/7918; this branch merges last (7916->7917->7918->7919). Tests: migrated tests/unit/workflows-director.test.ts (8 sites) from the constructor option to setWorkflowCoordinator; replaced the injected- classifier test with a no-checkpoint normal-infer pin; added setter attach/detach directive tests. bun run check green (7385 pass, 0 fail).
TheGreatAxios
force-pushed
the
cl-7919-chat-director-decide-the-shape-for-workflowcoordinator-and
branch
from
September 14, 2026 17:54
3fa6924 to
48b2d6f
Compare
…-decide-the-shape-for-workflowcoordinator-and
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Verification
bun run checkpasses (lint, typecheck, build, guarded suite: 7385 pass / 0 fail)Fixes CL-7919