Skip to content

feat(control): extend external operator lifecycle, batches and feature controls - #812

Merged
Juliusolsson05 merged 10 commits into
mainfrom
feat/external-operator-toolkit
Sep 5, 2026
Merged

feat(control): extend external operator lifecycle, batches and feature controls#812
Juliusolsson05 merged 10 commits into
mainfrom
feat/external-operator-toolkit

Conversation

@Juliusolsson05

@Juliusolsson05 Juliusolsson05 commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Merged as dd6a8f9cd021ee4804859e692134140955429b4a after both independent orchestration reviews, correction verification and passing final-revision CI. Running app was not restarted.

Agent Code’s external operator could discover and prompt agents, but lifecycle changes, lane placement and broader controls still required fragile UI sequences. This feature completes the agreed #795 extension with typed, exact-target operations while retaining computer use for visual and uncommon workflows. The original plan-first feature history is preserved; this is an implementation PR.

Delivered behavior

  • Exact-agent reload, resume, duplicate, provider switch, interrupt, rewind/undo, detach/bury and Reader/Spotlight navigation. Long operations record final replacement/native IDs through the durable journal. Replacement preserves the latest human draft and supported attachments (bug(sessions): preserve current drafts across agent replacement #807).
  • Creation, resume and duplicate can preserve tabs and every Dispatch lane with selectCreated:false; default creation selects the captured focused lane without closing its previous agent. Visible labels/titles, effective focus, index lane help and actual app PID/executable identity address operator feedback.
  • Cross-window batch reads/prompts with independent results/cursors and durable child intention keys. Partial/reordered/restarted retries cannot silently resend unknown children.
  • Historical user-prompt search through the existing Claude/Codex index, plus exact native rewind addresses and full-text filtering within a known transcript.
  • Bounded cancellable status waits for agents/operations, including stalled-read deadlines and caller/target/backend-bound cursors. Timeout, cancellation, unavailable and expired-cursor outcomes are explicit. Observed idle is not task-success proof.
  • Exact-agent display override and feed auto-follow preferences, window Tail All, templates, supported registry settings, named UI surfaces, usage and worktree reads. External workflow runs retain source approval and connection attribution; workers never gain this toolkit.
  • Claude image-path prompt delivery, structured provider refusal evidence through SDK/history/batches, and provider-known occupied native input without inventing full draft text.
  • Updated crash course, full feature/command/keybinding documentation and Agent Code-managed external operator skill. Neutral SDK, feature-owned adapters and MCP isolation remain enforced.

Plan: docs/decomposition/external-operator-toolkit.md.

Verification and review

Final correction revision: 2b0058d7. Full typecheck and test contract passed. Renderer after review corrections: 121 files / 514 tests. Targeted unit checks passed for real recorded native transcript search/addresses, durable batch restart/error evidence, wait deadlines/cancellation/cursor identity and import isolation. Actual isolated Electron + HTTP MCP trial passed with two windows, right-only Tail All, settings/stale-revision checks, bounded wait, identity and renderer reload. Real workflow-worker and HTTP codec checks passed. No user workspace or live provider was mutated by these trials.

Two independent Agent Code orchestration reviewers reviewed the complete feature at 961d542e: 8f6e2b0a-a700-44c6-804f-e76f4d13c038 and 96b42118-6a39-4e98-8faf-1b4501bcde0f. Reviewer 2 found no actionable defects. Reviewer 1 reproduced two P2 races: replacement after source close (#815), and wrong-focus workspace acknowledgment. Both are fixed in 2b0058d7; three regression cases fail on the prior revision and pass corrected. Both reviewers completed final re-review at 2b0058d759a5cb447861d5f0f6d68db7066ed32f with no actionable findings (36 and 18 focused renderer tests passed independently); both clear the feature to merge subject to required CI. Final-revision CI passed: minimum-node-fixture-gate (50s) and quality-gate (6m53s), including core/system/renderer tests, coverage and distributable verification. Run 33990704501. The user explicitly authorized merge only after completed implementation, both reviews, valid-finding resolution and passing final-revision checks. Earlier no-merge instructions are superseded by that explicit authorization; no plan-only merge is permitted.

Honest limits and dependencies

Fixes #795, fixes #796, fixes #798, fixes #799, fixes #801, fixes #807, fixes #815.
Refs #793, #797, #800, #96, #739, #773, #802, #803, #804, #805, #806.

Reuse provider replacement, native transcript and placement owners with explicit targets and observable results. Incorporate the external trial’s visible identity, effective focus, attachment and draft-knowledge findings. OS activation and native draft end-to-end confirmation remain external evidence.

Refs #795
Refs #796
Refs #797
Refs #798
Refs #799
Refs #800
Refs #801
Transfer the latest unsent text and destination-supported attachments atomically when retiring the predecessor. Provider switching must not restore an earlier image snapshot; rewind undo records the draft actually carried through replacement.

Refs #807, #795
Keep ordinary UI selection as the default while allowing external creation to preserve every lane and the active tab. Explain the row-specific index destination, and retain truthful uncertainty when native duplication succeeds before a placement guard fails.

Refs #795, #799
Reuse feature-owned settings, templates, surfaces and read services. Isolate external workflow ownership behind one adapter and admit main-host tasks before source approval, without inventing an internal agent or granting its workers the operator toolkit.

Update the live crash course, operator skill and staged coverage with concrete trial feedback and remaining provider and OS evidence gaps.

Refs #795, #793, #796, #797, #798, #799, #800, #801, #807
Link the complete continuation PR and independent worktree/subagent increments so follow-up operators can verify current ownership without duplicating them.

Refs #795, #812
Preserve the implemented feature history and record the missing direct-control contracts, dependency boundaries and newly authorized two-reviewer merge workflow.

Refs #795, #812
Reuse native history, provider delivery and display owners; retain explicit outcome evidence through MCP envelopes and durable batches. Bounded waits preserve caller and backend identity without inferring task completion from transport acceptance.

Refs #795, #800
Independent orchestration review reproduced a closed source leaving an orphan successor and a frame-boundary focus change being acknowledged as successful navigation. Check the live ownership commit, retire uncommittable successors, and acknowledge canonical focus. Regressions fail on the reviewed revision and pass here.

Refs #795, #798, #815
@Juliusolsson05

Copy link
Copy Markdown
Owner Author

Two independent Agent Code orchestration reviews completed for the full feature at 961d542eee331f773d2b8b58878a9ef16eb08930, base 5d641845:

  • Reviewer 96b42118-6a39-4e98-8faf-1b4501bcde0f: no actionable findings; 6 unit files/14 tests and 9 renderer files/23 tests passed. Noted an extra EOF blank line, now removed.
  • Reviewer 8f6e2b0a-a700-44c6-804f-e76f4d13c038: two P2 findings, both reproduced with production-handler probes: (1) source closes during spawn and replacement reports completed with no placement; (2) workspace navigation reports requested target even if focus moves during frame acknowledgment.

Both findings are resolved in 2b0058d7. #815 tracks the pre-existing ownership race. The fix checks the synchronous live store before retirement and at remap commit, cleans an uncommittable successor through the owned-backend boundary, and transfers the draft only after placement succeeds. Navigation now checks canonical effective focus. Three deterministic regressions fail against the reviewed revision and pass corrected; existing draft continuity remains green. Full types, test contract and renderer121files514tests pass.

Both original reviewers are rechecking this final revision. CI must pass on it before the user-authorized merge; no merge has occurred.

@Juliusolsson05

Copy link
Copy Markdown
Owner Author

Both independent Agent Code orchestration reviewers completed the final re-review at 2b0058d759a5cb447861d5f0f6d68db7066ed32f and reported no actionable findings, clear to merge subject to required CI:

  • 8f6e2b0a-a700-44c6-804f-e76f4d13c038: both original P2 findings resolved; reviewed all corrections and affected lifecycle/draft/provider-switch/navigation paths; 10 focused renderer files / 36 tests passed.
  • 96b42118-6a39-4e98-8faf-1b4501bcde0f: independently found both races addressed without an identified regression; 5 focused renderer files / 18 tests passed.

Full-PR whitespace check and worktree cleanliness confirmed. Full local typecheck, test contract and 121 renderer files / 514 tests passed. Required CI for this exact SHA is still running: https://github.com/Juliusolsson05/agent-code/actions/runs/33990704501 . No merge yet. Physical multi-monitor and occupied/busy native-provider trials remain the explicitly documented limits; these reviews do not claim them verified.

@Juliusolsson05
Juliusolsson05 merged commit dd6a8f9 into main Sep 5, 2026
2 checks passed
@Juliusolsson05
Juliusolsson05 deleted the feat/external-operator-toolkit branch September 5, 2026 20:45
@Juliusolsson05

Copy link
Copy Markdown
Owner Author

Merged #812 as dd6a8f9cd021ee4804859e692134140955429b4a, preserving the feature’s plan-first commit history. Final reviewed head: 2b0058d759a5cb447861d5f0f6d68db7066ed32f.

Both independent Agent Code orchestration reviewers cleared the final revision after the two valid P2 findings were resolved. Both CI gates passed on that exact head: https://github.com/Juliusolsson05/agent-code/actions/runs/33990704501 . The feature worktree remains clean and retained; the original worktree’s unrelated changes remain intact. No app restart or pane-layout changes were performed.

The agreed extension is delivered. Remaining external evidence/limits remain explicit: #797 actual two-monitor activation and #800 occupied/busy native committed-text trials; no complete native composer text or universal provider queue API; bounded best-effort Claude/Codex user-prompt search rather than exhaustive archive/assistant/OpenCode search (#96/#739/#773); bounded status waits rather than durable subscriptions; documented UI routes for dangerous/uncommon operations. A5/A6 and Remote fixes remain independently owned PRs. Merging does not update the currently running app; it needs a rebuild/restart to load the new tools/skill.

Juliusolsson05 added a commit that referenced this pull request Sep 6, 2026
…signatures

origin/main advanced past the review base (external operator toolkit #812,
MCP tool policy #818) while pane-runtime-isolation was in review, and those
PRs added control tests that call the pre-isolation hook signatures. The
merged-tree quality-gate caught two TS errors that the stale worktree base
could not surface:

- control.renderer.test.tsx passed a Dispatch<SetStateAction<number>> as the
  draft-version signal, which now types as a plain () => void bump; the test
  reads drafts imperatively via inspectAgentDraft, so a stable no-op bump is
  behaviorally faithful.
- preferences.renderer.test.tsx passed the render-time runtimes snapshot that
  useWorkspaceHelpers no longer takes; the helper reads runtimes through refs
  and toggles via the setRuntimes updater, so only (setRuntimes, refs) remain.

No production code changed. Merged-tree verification: forced typecheck clean,
full renderer suite 123 files / 523 tests green on Node 24 with two workers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment