Repository navigation
Move Browser lifecycle and on/off ownership out of core - #4320
Merged
Merged
Conversation
…e browser, viewers, cleanup and search) Not done: discovery.ts, heldAgentLife(), agentTmp out of the core, typecheck, specs, e2e, docs. The plan and what is left are in the package notes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ent-tmp out, sources typecheck Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…owed agents Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…owed agents Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ages' answers; docs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # cli/src/lib/controlResume.golden.spec.ts # cli/src/lib/ptyHostBackend.restart.spec.ts # docs/design/2026-11-15-core-plan.md
…es its follow Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…the Agent Browser's lifecycle and on/off leave the core Package 2 step 1 of docs/design/2026-11-15-core-plan.md. core/agentLife.ts tells the services that follow agents each look at a live agent, its end, a stop, a purge and a pane's new agent (CoreApi.agents.follow; follow_agents from a service's process, services/followLink.ts), holding what one in its own process must not miss for the kinds its process hears (SERVICE_HOSTS hears). The viewers' attach and detach, the agent cleanup's stops, search's purges and the agent browser are on it, and their port members are gone. Whose Browser is on is the browser's own (agent-browser.json on), the row's flag taken in once and dated 2026-12-18. lib/agentTmp.ts leaves the core. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ate file once Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
deehw
marked this pull request as ready for review
November 15, 2026 04:02
# Conflicts: # cli/src/core/main.ts # cli/src/harnessd/services.spec.ts # cli/src/harnessd/services.ts
# Conflicts: # docs/design/2026-11-15-core-plan.md
# Conflicts: # cli/src/core/agents/lifecycle.ts # cli/src/core/main.ts # cli/src/services/AGENTS.md
…ntinue # Conflicts: # cli/src/core/agents/discovery.spec.ts # cli/src/core/agents/discovery.ts # cli/src/lib/resumeAgentService.ts
deehw
marked this pull request as draft
November 15, 2026 11:29
…ntinue # Conflicts: # cli/src/harnessd/services.spec.ts # docs/design/2026-11-12-core-audit.md # docs/design/2026-11-15-core-plan.md
…re-secret-custody
…re-browser-continue
…re-browser-continue
…re-browser-continue
…re-browser-continue
deehw
marked this pull request as ready for review
November 16, 2026 15:40
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.
Browser lifecycle and on/off state now belong to the Browser service. One bounded agent-lifecycle subscription serves Browser, viewers, search and cleanup and replaces their feature-specific lifecycle ports. Stop/purge revoke pending Browser creation, migration and pane adoption; metadata snapshots omit saved launch credentials while the authoritative Resume record retains them.
This is lifecycle extraction only. Frame parts, Browser stream relay and wake extraction remain separate work; no Browser UI or feature expansion is included.
Design
Reviewed Design.
agent-browser.jsonand is removed on purge. Existing per-agent queues and generation fences govern writes; generic held delivery is capped at 1,000 events per service and follower bookkeeping tracks live agents and prunes stale entries above 4,096 (this is not a hard live-agent admission cap). No new credential storage or process login.UNKNOWN_QUERYpermits the old-core fallback. Missing or unavailable evidence preserves the stored profile. No backend rollout or history migration.gridLaunch; late, stale or disconnected replies cannot publish authority. Service failures are visible and leave core and unrelated agents running.Validation
Final clean head
8e601617b16f0bc64c38408968e12284535c098aintegrates main41b4c12de69b6a6ac918882c047c52c998118c14. The previous head's automatic CI passed (run 43898898273); the merge helper refused safely when main moved. The two incoming changes are independently accepted Herdr/device integration and Desktop log redaction. The merge is clean, with no change to reviewed core, library, engine, harnessd or Browser implementation, dependency locks or validation/build scripts.Prior native bundle SHA-256:
c5a3986e6b4d3c086ba24eb96a633c9325d701219ce210f499eeb6ed69ea9946; original runtime/source proof55865ad4fc732c69e540a35cad2bf7fe2c2d7b1991c7da125e639635f2fb4acc. Final integration acceptance/provenance SHA-256:cde0951b1f17733f0ef2c51adb06da37fdb37ac5c895a957a955d994f25cabaa.Runtime cost
One quiet ABBA completed exactly once: baseline
1c3a0ed654bc1f0a4054c07c499e09c569a64953, candidateab5e73f126fba4ac055eec8f0d4be869e0963ab8; current-main input and credential-safe metadata on both sides. All four children and the orchestrator exited 0, every output stream reached EOF, all 12 phases passed and private fixture teardown passed. No retry, forced GC, dropped sample or parameter change.Workload: 16 fake agents, two active, two windows/four terminal streams, 30-second empty/idle/active phases, 10-second warm-up. Medians of two fresh processes per side follow; both paired directions and every raw sample are retained.
Active completion p95 is 6898.8 → 6917.9 ms (+19.1 ms, +0.28%); every process completed eight turns. This includes the deliberately ~5-second fake-engine delay and is not terminal-echo/input-dispatch latency.
The populated-idle median is slightly above the 1% target on both sources (1.0210% before, 1.0286% after); this comparison does not clear that whole-core target or establish 10x headroom. The absolute difference is +0.0076 percentage points. Core active CPU and populated memory fall; empty memory rises by 2.97 MiB. The final design review accepts this lifecycle increment with these mixed costs explicitly retained; whole-core idle acceptance remains open.
Browser is off: this measures core overhead, not rendering or real Podman. CPU is the core process; master observations have coarse
psresolution and are separate. Services, engines and tmux are outside the CPU total, and agent-creation setup is outside the measured 90 seconds. Two processes per side do not establish statistical significance.The private fixture removes its unused pre-measurement process-environment diagnostic on both sides; measured workload and cadence are unchanged. Earlier slower synthetic-scan/Node26 results stay historical and are not reclassified as passes.
Fixed plan SHA-256:
f92e92d0e35972d988afa50b85fc19547f58fd08f476d9ea725c6b1630e9115e; complete summary SHA-256:8ac33e9ff99436750a4c25b6c85a26a33785e0150b5bab5feeef6b3074abc38a. Final source-equivalence receipt SHA-256:9f97a5fee07d89b2e083499cb85f7ee788f267cee7513a934419877daad01228. The existing functional and cost evidence is reused only for unchanged inputs; final PR CI remains required.