Repository navigation
pane ownership: carry a restart's set into the replacement pane (orca #44, stage 3 piece a) - #68
Merged
nachumi-a2zoperations merged 4 commits intoNov 16, 2026
Conversation
…44, stage 3 piece a) Observe only: no signal path (the stage-2 folder scan covers the new module). A restart (account move, pane restart, resume) used to log the old pane's set and drop it. Main stops the old PTY BEFORE it spawns the replacement, so the daemon now HOLDS the still-present entries for CARRY_HOLD_MS (60 s); the replacement's spawn names the old PTY and the new pane adopts them, marked carried {from, generation}, so its later close shows what the old agent left behind. The link is ONE optional protocol field: carriesFrom (= main's own replacesPtyId) on PtySpawnOptions -> the daemon adapter's createOrAttach payload (non-attach creates only) -> admission -> TerminalHost, which reports it to the observer's optional noteCarry when a session is really created (never an attach). An older daemon ignores the field (the held set expires as before); an older app never sends it. Both spawn routes map it via carryOverFor. Bounds: first claim wins (a second is logged); a claim naming a CLOSE carries nothing; unclaimed after 60 s -> one carry-unclaimed line and dropped; at most 256 entries per carry; an entry carried 8 times is dropped and counted; mode off drops what is held; memory only. Refs #44 Signed-off-by: Nachumi Eliyahu <[email protected]>
…gate) Refs #44 Signed-off-by: Nachumi Eliyahu <[email protected]>
Refs #44. Conflicts were the two new OwnedEntry fields side by side (carried, marker), the entry line and one import: both kept. With both pieces the observer is 311 lines (limit 300), so the sampler's failure counting moves into pane-ownership-health.ts (SamplerHealth), unchanged behaviour; SAMPLER_FAILURES_BEFORE_LOG is re-exported from the observer. Signed-off-by: Nachumi Eliyahu <[email protected]>
…eads, typed) Refs #44 Signed-off-by: Nachumi Eliyahu <[email protected]>
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.
Refs #44: stage 3 piece (a), restart carry-over, observe only. The design note was approved by the lane lead (
~/nacho-run/orca-44-observe-ab.md, md5 a6013a07); piece (b) is PR 66 (merged).What it does
reason=restartand then drop it. The processes the old agent left running (the Orchestration: rejected heartbeats from a stale terminal handle keep being delivered to the run (released dispatch) #5 shape) vanished from the log.beginRuntimePaneReplacement).CARRY_HOLD_MS(60 s).carriesFrom).carried: { from, generation }.pane-ownership-carryline is logged. The entries then appear, labelled, in the new pane's close lines.Protocol change (named plainly)
carriesFrom?: string, on the daemon'screateOrAttachrequest payload (daemon-rpc-contract.ts). Its value is main's ownreplacesPtyId.PtySpawnOptions.carriesFrom→ the daemon adapter's payload (non-attach creates only) →daemon-terminal-admission→TerminalHost(CreateOrAttachOptions.carriesFrom). The host calls the observer's optionalnoteCarry(sessionId, fromSessionId)hook when a session is really created, never on an attach.spawn-options.ts, windowipc/spawn-options.ts) mapreplacesPtyIdthrough one helper,carryOverFor.carry-unclaimedline, which is today's drop, now visible;noteCarryis fine (the hook is optional, and its call is guarded).Observe only (S1)
pane-ownership-carry.tsonly moves entries between sets and logs.offdrops everything held.Bounds (the "leaked set across a restart" question)
pane-ownership-carry-already-claimedand gets nothing.pane-ownership-carry-unclaimed, dropped.pane-ownership-carry-unadopted.CARRY_MAX_ENTRIES(256) per carry, the rest counted (droppedOverCap).CARRY_MAX_GENERATIONS(8) times is dropped and counted (droppedGenerations), so a pane that rotates all day cannot grow.Tests (red first)
pane-ownership-carry.test.ts, 9 rows:carried;terminal-host-pane-ownership.test.ts, 3 new):carriesFromreports once;onCreatedcall removed, 1 failed.daemon-pty-adapter-carries-from.test.ts): through the real adapter, wire and admission, the field reachesTerminalHost.createOrAttach, and is absent when not given. Red check: with the payload line removed, 1 failed.spawn-carry-over.test.ts):carryOverFor, and a pin that both routes and the assembly use it. The route pin was red before the routes used it.Gates (MacBook, Node 24.22.1 first on PATH for the run, no override)
pnpm check:changed --base=origin/blowzer/fork-only: 24/24 at ea21ca1, including typecheck (node, web, cli), oxlint, the changed-code quality gate and the unit step.Reflect.getreads of private fields, replaced by aTerminalHost.prototypespy.git merge-treewith fork-only 1a01c00 (PRs 64, 65, 66 merged): clean.Notes
OwnedEntryfields side by side; both were kept.pane-ownership-health.ts(SamplerHealth), with the same behaviour.terminal-host.tswas at 299 of its 300 code lines; the hook costs one line there, anonCreateddependency of the session create.docs/decisions/issue-44-pane-process-ownership.md§4, "As built" for (a).