Skip to content

fix(conn-server): preview tunnel, peer tool names, thread chips, orphaned subagents, resumed Claude MCP - #256

Merged
nckrtl merged 13 commits into
mainfrom
fix/conn-server-tunnel-peers-chips
Nov 24, 2026
Merged

nckrtl merged 13 commits into
mainfrom
fix/conn-server-tunnel-peers-chips

Conversation

@nckrtl

@nckrtl nckrtl commented Nov 23, 2026 •

Copy link
Copy Markdown
Owner

Five gaps between the Rust Conn Server and the TypeScript server, which is the reference.

1. Preview tunnel route

Conn's browser reaches a remote environment's loopback ports over SOCKS through /api/preview/tunnel. Only the TS server had this route. Conn failed with ERR_SOCKS_CONNECTION_FAILED, and both live servers answered 404.

  • New crates/conn-server/src/routes/preview_tunnel.rs. It uses the same protocol and auth as PreviewTunnel.ts:
    • It needs a WebSocket upgrade and ?port=1..65535, or it answers 400.
    • A media ticket or bearer token with terminal:operate opens it.
    • It refuses this server's own ports with 403 and a dead port with 502. Both refusals carry x-t3-tunnel-port-refused: 1.
    • It dials 127.0.0.1 first, then ::1, with a 5 s timeout.
    • It carries raw bytes both ways with backpressure.
    • The tunnel closes when its session is revoked.
  • tools/gen-upstream.mjs now also lists the routes apps/server mounts with HttpRouter.add. Constants in paths are resolved, and a call it cannot read fails generation. http-routes.json gained 17 routes, including /api/preview/tunnel. tools/bump-report.mjs understands /* wildcards and * methods.

2. Thread messaging between server versions

A peer call that gets Tool 'conn_x' not found from an older peer retries once as t3_x (PeerLinks::call_once).

3. Thread chips give agents context

  • New crates/conn-engine/src/composer_context.rs and citations.rs, ported from projectComposerContextForProvider and expandAssistantCitationsForProvider. They cover all 11 record kinds, unknown and unavailable records, and envelope escaping.
  • The engine applies them at turn start and at steer, so Claude, Codex and ACP all get the expanded text.
  • conn_thread_read and conn_thread_send accept thread_<id>.
  • 26 cases, generated by T3's own functions (tools/gen-composer-context-cases.mjs, wired into check.sh), prove the output is byte-equal.

4. Orphaned native subagents end

families.rs::end_orphaned_native_subagents ends provider-native subagent rows, their nodes and turn items, and the child thread's runless root turns. It works like upstream endOrphanedNativeSubagent and endRunlessRootTurns.

  • At engine start it uses "cancelled", for each thread from threads_with_live_native_subagents().
  • On release it uses "interrupted", as upstream writeReleasedSubagentEvents does, and only when the provider's background tasks end with its process (Claude yes, Codex no). It runs from close_session when the close returns RuntimeStopped, or at pump end when the session ended on its own and is still the thread's current one. A RuntimeShared close or a replaced session never triggers it. It ends only subagents of the released session's provider threads that started before the release took effect. It does not run during shutdown.
  • A shared Codex close ends no subagent, and still reports its later end, as T3 keeps the child's turn context past a release (CodexAdapterV2.ts). On RuntimeShared, Mapper::on_close ends only root turns and keeps child turns. The app-server keeps the child threads' routes (remove_session(id, keep)). The session keeps its mapper and event sender until no child turn is open, or until the process exits (then the child ends interrupted). The engine pump reads on until the session drops its events. close_session detaches the active run before the close and ends it failed.
  • Run finalization takes its reason (RunEnd). Detached (the session was released or its events ended) leaves an open subagent item alone while its provider-native row still runs; the subagent's own end closes it. Settled (a confirmed Stop, a failure, a cancel) ends the run's open provider-native subagents with an interrupted, failed or cancelled run: record, node, item and the child's runless turns together, as T3's cascadeTerminalizeRunOwnedSubagents. App-owned subagents are not touched.
  • It emits subagent.updated, node.updated, turn-item.updated and provider-turn.updated. The web treats cancelled and interrupted as finished, so the agent moves to "Previous agents".

5. Resumed Claude sessions keep the conn MCP

Root cause: SqliteEngine::open started recovered runs before serve.rs had bound the listener and called mcp.set_listen_address. Each resumed session got a conn entry pointing at the fallback http://127.0.0.1/mcp (port 80), so setMcpServers failed (MCP servers unavailable: conn). Tokens were not the cause: every session gets a fresh token after a restart.
Fix:

  • The listener now binds before the engine opens, and /mcp gets its address.
  • New EngineConfig::hold_recovery: recovered runs wait for resume_recovered(), which serve.rs calls once /mcp is ready.
  • Safety net: when Claude still reports conn as failed, the session calls the SDK's reconnectMcpServer("conn") once per registration. The SDK host allows that method, and PROTOCOL.md lists it. This is a deliberate difference from T3, which only logs the failure.

Gate round 3 (7f3ae5b)

Each fix has a test that failed on bdb9908. The tests port the reviewer's probes and, where one exists, the T3 test named here.

Fix Crate Test (T3 source)
A shared close keeps the route of a child Codex announced before its first turn/started conn-provider-codex a_shared_close_keeps_a_child_announced_before_its_first_turn (probe)
A failed root with running descendants carries childTurnsContinue, and the engine ends the run Detached conn-provider-codex, conn-provider, conn-engine a_failed_root_with_a_running_child_says_the_child_continues (T3 "handles a late native child after the capacity retry failed"), a_failed_root_whose_children_continue_leaves_them_running
An interrupted root's terminal waits for its descendants (emitOrDeferRootTerminal, flushReadyRootTerminals) conn-provider-codex an_interrupted_root_ends_after_its_running_child (T3 "... capacity retry interrupted")
A confirmed Stop follows the run's child links when the record already settled; each open node and item settles once conn-engine (families::end_run_native_subagents) a_confirmed_stop_after_the_record_settled_ends_the_childs_open_work (T3 "ends a subagent that outlived its root…", stopped case)
A refused resume restores the previous route; closed sessions waiting on subagents are tracked by process generation and released at exit conn-provider-codex (AppServer) a_refused_resume_keeps_the_closed_sessions_route (probe)
A close stores terminals already received (bounded, 5 s) before it detaches the run conn-engine (close_session) a_close_keeps_a_stop_the_provider_already_confirmed (probe)
A silent child is reconciled with Codex: thread/read with turns (T3's own readThreadSnapshot request) every child_check_interval (60 s), at most 60 checks, then interrupted conn-provider-codex a_silent_child_is_reconciled_with_codex

All state is bounded: at most 16 deferred terminals, one detached entry per session, and 60 checks. Nothing new blocks the runtime thread. No generated contract changed: TurnTerminal.child_turns_continue maps the contract's existing childTurnsContinue.

Gate round 4 and audit 6.5 (8e103a9)

Each fix has a test that failed on 7f3ae5b (run there with only the new tests applied) and passes now.

Finding Crate Fix Test (T3 source)
1. Stop hangs when the root is confirmed but a child is silent conn-provider-codex At the deadline, a root Codex already ended settles the rest of the lineage (deferToActiveRoots) a_stop_settles_a_silent_child_once_the_root_ended, through interrupt_turn
2. Cascade misses nested and independently open work conn-engine (families.rs) Follow the run's owned threads recursively (nested native subagents with runId: null); settle each open record, node, item and provider turn on its own a_confirmed_stop_ends_a_nested_native_subagent_and_its_thread (ports T3 "ends a nested native subagent and its thread…"), a_confirmed_stop_ends_an_open_item_under_a_settled_child_turn
3. A refused resume swallows the child's completion conn-provider-codex (AppServer::claim_route) Another session's route stays until Codex accepts the resume a_refused_resume_leaves_the_childs_completion_with_its_owner; the stub completes the child before refusing, and the process stays up
4. Reconciliation drops a terminal it produced conn-provider-codex Check results go through the session inbox (SessionMsg::ChildRead); the driver applies and publishes them before it releases the sender a_checked_childs_end_survives_another_childs_live_completion (B's read held until its live completion is processed)
5. The watchdog marks a live child interrupted conn-provider-codex Missing thread vs retryable failure; at the bound, turn/interrupt, then read again before ending interrupted a_failed_child_read_is_retried_and_the_last_check_interrupts_the_turn
6. Exit misses a child announced before its first turn conn-provider-codex (Mapper::on_exit) Exit ends announced, unsettled children a_process_exit_ends_a_child_announced_before_its_first_turn
7. Close under load records failed for a confirmed Stop conn-engine (close_session, pump) The pump detaches the run only after storing the events received before the close (bounded ack, no timeout decides); a stopped session drains its queue; one lookup removes the session a_close_behind_a_slow_write_keeps_a_confirmed_stop (store held past the close's wait)
8. Deferred-root cap conn-provider-codex At most one deferred terminal per native root thread, published in order; the cap is gone a_thread_keeps_one_deferred_root_terminal_in_order
Audit 6.5. Search indexes the hidden citation anchor conn-engine (store.rs, reads.rs) Index, scan filter and snippet use the message as it reads (readableSearchText: citation text and comment, unescaped link labels) in message_keys.search_text; schema step 5 re-indexes existing messages search_reads_a_citation_as_its_text_and_comment (ports T3 "matches the readable text of quotes and their comments" and "finds accented, CJK, and apostrophe words of a quote through the index"; includes an older index refreshed on upgrade)

Ran locally on macOS:

  • cargo fmt --check.
  • cargo clippy -D warnings (all targets and features) on conn-engine, conn-provider-codex, conn-provider and conn-provider-claude.
  • cargo test --lib for conn-engine (228) and conn-provider-codex (88).

The full tools/check.sh did not run locally, because there was not enough disk for it; it runs on Linux in CI. Two store tests now expect schema version 5.

Gate round 5 (1fd66b7)

Each test below failed on 8e103a9 (run there with only the new tests applied) and passes now.

Finding Crate Fix Test
P1-1. The root confirms after the Stop deadline conn-provider-codex A timed-out Stop stays pending, and the root's later end settles its lineage (T3 forks this wait) a_late_root_end_settles_a_timed_out_stop
P1-2. A close can produce a confirmed Stop conn-engine (close_session, pump) The close marks the position of the events sent before it. A busy pump doesn't hold the receiver lock, so the close counts received + queued; an idle pump marks the position itself. The provider's own close-time interrupted falls after the mark a_close_does_not_count_its_own_interrupt_as_a_stop (slow write, active root, no provider Stop: failed); a_close_behind_a_slow_write_keeps_a_confirmed_stop still passes
P1-3. T3 imports bypass readable search conn-engine (t3_import.rs, store.rs) The import keeps its ordered bulk insert and stable ids, then runs the same paged readable pass as the upgrade, through the same writer as ordinary writes an_import_indexes_citations_as_they_read
P1-4. Stop leaves open child work conn-engine (families.rs) Every open node and item in an owned child thread whose runId is null or the root run settles; streaming clears on each settled item that has it a_confirmed_stop_ends_every_open_child_node_and_item_of_the_run
P1-5. The watchdog can end a live child conn-provider-codex Only -32600 with a thread not found: prefix ends a child. A child still inProgress after the last check keeps its route, and its own end settles it only_codexs_missing_thread_error_ends_a_silent_child, a_child_still_running_at_the_last_check_settles_with_its_own_end
P1-6. The upgrade loads the whole transcript conn-engine (store.rs) refresh_readable_search pages by message_keys.id, 500 at a time, and rewrites only rows whose readable text differs; the version advances after it finishes an_older_search_index_is_read_again_on_upgrade (from v4 and from v5 with the column really dropped, ending at v6). Correctness only: no memory test
P2-7. A second root releases the first terminal early conn-provider-codex Deferral is keyed by native root turn each_deferred_root_terminal_waits_for_its_own_descendants
P2-8. The cascade stops at 256 threads conn-engine No cap; a visited set stops cycles a_confirmed_stop_follows_a_long_chain_of_nested_subagents (300 levels)

Migration: readable search is schema step 6, and step 5 belongs to #260. Two parts wait for the rebases. The folding from #285 (fold(readable.unwrap_or(text)), in the v6 backfill and the import) goes in when #285 lands. The v5 test then reopens #260's real v5 schema instead of my stand-in.

Ran locally on macOS:

  • cargo fmt --check.
  • conn-engine tests: 233 passed.
  • conn-provider-codex tests: 91 passed.
  • Clippy found one new lint, large_enum_variant on the pump's internal Next enum. I silenced it with a reasoned #[expect] and did not rerun clippy, because disk fell below the build floor; CI runs clippy.
  • tools/check.sh did not run locally.

Gate round 6 (e7841db)

Each test below failed on 1fd66b7 (run there with only the new tests applied) and passes now, unless the table says otherwise.

Close ordering, by attribution at the source. The close mark, the received/taken counting for it, and the acknowledgement wait are gone.

  • TurnTerminal gains cause (provider by default, sessionClosed). T3's own reason is free text that becomes the Stop message, so it did not fit.
  • Codex and Claude mark their mapper as closing when close() starts. Every root terminal they build from then on carries cause: sessionClosed.
  • The engine records a sessionClosed terminal as failed ("The provider session ended during the turn.") with RunEnd::Detached, never as a Stop. A Stop counts only when the user's Stop request and the provider's own end both exist.
  • The pump owns its receiver again. After a close it stores what the session already sent, then detaches a run still open. It ends with a process that ended, and reads on for a shared Codex process.
Finding Crate Fix Test
P1 close after a read-ahead continuation counts the close's own end as a Stop conn-engine, conn-provider, conn-provider-codex, conn-provider-claude Close cause on the terminal a_close_after_a_read_ahead_continuation_detaches_the_run
P1 slow-write close same same a_close_does_not_count_its_own_interrupt_as_a_stop (now the fake's close names itself as the cause); a_stop_ended_only_by_the_close_is_not_a_confirmed_stop (new); a_close_behind_a_slow_write_keeps_a_confirmed_stop and a_close_keeps_a_stop_the_provider_already_confirmed still end interrupted; a_shared_close_leaves_a_running_subagent_open asserts the cause
3. P1 process ids reported after the Stop snapshot conn-provider-codex A turn that ends during a Stop keeps its process ids (bounded, 64 turns). settle_lineage terminates those not in the snapshot (terminateTrackedTerminals) a_stop_terminates_a_process_reported_after_its_snapshot
4. P2 transient error on the final watchdog read conn-provider-codex After the last check, a failed read is read again once per interval, without another interrupt, until Codex answers or the session lets go a_failed_last_read_is_read_again_without_another_interrupt
5. P2 release cleanup settles nested subagent nodes conn-engine (families.rs) Release and recovery use endRunlessRootTurns: runless root_turn nodes and their runless items and provider turns. The broad owned-thread traversal stays only for the run-end cascade a_restart_ends_only_the_runless_root_turns_of_a_subagent_thread
6. P2 cascade events lack the root run id conn-engine (families.rs) Envelope runId is the row's run or else the owning run; subagent rows use the owning run. Payload runId unchanged a_confirmed_stop_ends_a_nested_native_subagent_and_its_thread (extended)

Not fail-first: a_stop_ended_only_by_the_close_is_not_a_confirmed_stop and a_close_does_not_count_its_own_interrupt_as_a_stop also pass on 1fd66b7, because the close mark covered them. They guard the new design. On 1fd66b7, a_failed_last_read_is_read_again_without_another_interrupt hangs until its 60 s timeout. Its first run there passed once, most likely a stale binary in the shared target dir; it then failed in 4 of 4 runs.

Ran locally on macOS:

  • cargo fmt --check.
  • cargo clippy --all-targets -D warnings on conn-provider, conn-engine, conn-provider-codex and conn-provider-claude: clean.
  • Tests: conn-engine 236 passed, conn-provider-codex 93 passed (2 ignored), conn-provider-claude 83 passed (11 ignored), conn-provider 8 passed. The new close and Codex tests passed 3 of 3 repeat runs.
  • tools/check.sh did not run, because disk stayed under 60 GB. ACP builds terminals as JSON, so the new optional field needs no change there; it was not rebuilt.

Verified

  • cargo test --workspace: all pass. New tests:
    • Tunnel: bytes both ways; 400, 401, 403, own-port and 502 refusals; closes on revoke.
    • Peer: t3_* fallback.
    • Composer context: 26 T3 cases.
    • Subagents: restart cancels; a process exit and a stopped close interrupt only that session's subagents (another provider thread's and later-started ones stay open); a shared-runtime close leaves the row, node, item and child open; shutdown leaves them for the next start. The three release tests fail without the new guards.
    • Codex mapper: a shared close leaves a running child open and a stopping close ends it (fails without the fix).
    • Codex session, two sessions on one fake app-server: after the root completes and its session closes RuntimeShared, the child's turn/completed still yields its completed provider turn and subagent node, and the events then end; when the last session stops the process instead, the child ends interrupted. Fails on ba7f0e9.
    • Engine: after a shared-runtime close, a subagent's later end is still stored (fails when the pump stops at close). A confirmed Stop ends the run's native subagent record, node, item and child turn as interrupted (fails on ba7f0e9).
    • Claude: held recovery waits for resume; reconnect happens once.
  • cargo clippy --workspace --all-targets -D warnings and cargo fmt --check: clean.
  • tools/check.sh on bdb9908: 57 passed. client-check timed out only on build time in the shared target (it passes in 7 s run alone), and parity needed npm ci in helpers/sdk-host (then "no differences"). Earlier run: 61 passed, 0 failed. That includes parity, claude conformance, claude probe conformance, instances-flow and canary. cargo deny was skipped because it is not installed on this machine; CI runs it.
  • vp run check:changed: pass.
  • node tools/gen-upstream.mjs --check and gen-composer-context-cases.mjs --check: current.

Follow-ups

  • Not tested against the live servers or a real Conn client. Proof is unit and integration tests only.
  • No test covers the race in serve.rs itself. The engine's hold/resume gate and the reconnect are tested.
  • The scheduled-task timer still starts before /mcp exists. A task that fires in that short gap gets no conn tools.
  • /api/device-hub/* is built with format!, so bump-report lists it as not served even though it is served.
  • Subagents: a session whose pump ends on its own while the process may still run (a broken event stream on a shared runtime) is treated as ended only when the provider's background tasks end with the process; Codex never qualifies.
  • Subagents: no recursive end of nested native subagents (endNativeSubagentTrees), and no writeIfSubagentUnchanged conflict check. t3_import.rs still copies running rows; the next start cleans them up.
  • Composer context: some per-field length checks in record decoding are not ported. Unknown-kind payloads may differ in key order. The "expanded input too long" check and prompt commands do not use the expansion yet.
  • thread_ id acceptance is new behaviour; T3 does not normalize these ids.
  • Rebase after fix(conn-server): pass 9 search fixes: agent search by linked PR, accent-folded message search, as T3 #285: ordinary writes, the v6 backfill and imports must all fold the readable citation text, and a refold from raw Markdown must not overwrite it.

🤖 Generated with Claude Code

nckrtl and others added 2 commits November 23, 2026 10:45
…t3_* names

The preview tunnel carries a remote desktop's browser to loopback ports, as
apps/server does. gen-upstream now also lists HttpRouter.add routes.
Peer calls retry once under the t3_* name when an older peer does not know
the conn_* tool.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… Claude keeps conn MCP

- Expand composer context references (thread chips and the rest) before every
  provider turn, byte-equal to projectComposerContextForProvider; conn_thread_read
  and conn_thread_send accept thread_ ids.
- End provider-native subagents whose process is gone: cancelled at engine
  start, interrupted at pump end (not on shutdown).
- Bind the listener and give /mcp its address before recovered runs resume, and
  reconnect the conn MCP server once when Claude reports it unavailable.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added vouch:trusted Author is trusted by repo permissions or the VOUCHED list. size:XXL labels Nov 23, 2026
nckrtl and others added 3 commits November 23, 2026 12:08
… only when its process ended

Closing a session on a shared Codex app-server (RuntimeShared) still ended its
pump, and the pump-end cleanup then interrupted every open native subagent on
the thread, a replacement session's included. As upstream
writeReleasedSubagentEvents does, the cleanup now runs only for sessions whose
background tasks end with the process: from close_session on RuntimeStopped, or
at pump end when the session ended on its own and is still the thread's
current one. It ends only subagents of that session's provider threads that
started before the release.

conn_thread_read and conn_thread_send reuse the projection the thread_ id
resolver loaded.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The Codex session ended its child turns (subagent interrupted) before it
learned that the app-server outlives the close. It now calls remove_session
first, and on a shared close the mapper ends only root turns (Mapper::on_close).

Run finalization no longer fails an open subagent item whose provider-native
subagent is still running; that item ends with its subagent, from the provider
or from the orphan cleanup.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
… a Stop ends them

A session closed on Codex's shared app-server dropped its child turns and their
routes, and the engine's pump stopped reading. A child that completed later
reached no one. As T3 keeps the child's turn context past a release, the session
now keeps the child's route, mapper turn and event sender until the child
settles or the process exits. The engine pump reads on until the session drops
its events; the run is detached before the close and ends failed.

Run finalization skipped every open subagent item whose native row was active,
so a confirmed Stop left the run's own subagent running. finish_run_as now takes
the reason (RunEnd): a detached session keeps live native subagents, and a run
that ends interrupted, failed or cancelled ends its open native subagents with
it, record, node, item and child turn together (cascadeTerminalizeRunOwnedSubagents).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…Codex subagents

Round 3 of the #256 gate.

- A shared close keeps the route of a child Codex announced but has not started:
  open_child_threads counts unsettled subagents, not only running child turns.
- Root terminals follow emitOrDeferRootTerminal: a failed root with running
  descendants carries childTurnsContinue (the engine ends its run Detached), and an
  interrupted root's terminal waits until its descendants settle.
- A confirmed Stop follows the run's child links even when the subagent record has
  already settled. The record keeps its result, and each open node and item settles once.
- A refused thread/resume puts the previous route back. The app-server tracks closed
  sessions that wait on subagents by process generation, so the process exit always
  releases them.
- close_session stores the terminals already received, with a bound, before it detaches
  the run. A confirmed Stop keeps its status.
- A closed session's silent child is checked with Codex (thread/read with turns, as T3's
  readThreadSnapshot) every child_check_interval, at most 60 times. Then what is still
  open ends interrupted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…conciliation, readable search

Round 4 of the #256 gate, and audit entry 6.5.

- Stop: past the deadline, a root Codex already ended no longer waits for silent
  descendants; the rest of the lineage settles (T3 deferToActiveRoots).
- A confirmed Stop follows the run's owned threads recursively, nested native
  subagents with no run included, and settles each open record, node, item and
  provider turn on its own (T3 ownedThreadIds; ports its nested regression test).
- A resume of a thread another session owns takes nothing over until Codex accepts
  it, so a completion sent before a refusal reaches the owner.
- A closed session's child checks go through the session inbox, so the driver
  applies and publishes each result in order. A failed read other than a missing
  thread is retried. At the bound, each open child turn gets turn/interrupt and is
  read once more before anything ends interrupted.
- A process exit ends a child announced before its first turn.
- The pump detaches a closing session's run only after it stored the events
  received before the close. A stopped session drains what is queued; no timeout
  decides the run's status.
- At most one deferred root terminal per native root thread, published in order.
- Thread search indexes each message as it reads (T3 readableSearchText): a
  citation as its text and comment, not its hidden link. Schema step 5 re-indexes
  existing messages and keeps their stored text.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
nckrtl and others added 6 commits November 23, 2026 20:49
…ownership and readable search

- A Codex Stop that times out while its root still runs stays pending; the root's later
  end settles the rest of its lineage (T3 forks this wait).
- A close marks the position of the events sent before it, so an interrupted turn the
  provider's own close produces is not taken for a confirmed Stop. The pump reads its
  receiver under a lock it never holds across a store write; a busy pump is counted by
  the close, an idle pump marks the position itself.
- A Stop ends every open node and item in the run's subagent threads whose run is none
  or the root run, and clears `streaming` on each settled item (T3's ownership test).
  The traversal follows every owned thread, with no cap.
- The silent-child watchdog ends a child only on T3's missing thread (-32600,
  `thread not found:`). A child still running after the last check keeps its route.
- Deferred root terminals wait per native root turn, as T3's deferredRootTerminals.
- Readable search moves to schema step 6 (#260 keeps step 5). The upgrade and the T3
  import share one paged pass by message_keys.id, and every write goes through the same
  search-entry writer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rocesses, watchdog retry, release scope

A session close no longer counts events against a mark. Instead the adapter
marks a terminal its close produces (`TurnTerminal.cause: sessionClosed`).
The engine records that terminal as failed and detached, never as a Stop.
The pump owns its receiver again. After a close it stores what was already
sent, then detaches a run still open.

- Codex: a turn that ends during a Stop keeps its process ids, and the Stop
  terminates any not in its snapshot (`terminateTrackedTerminals`).
- Codex: after the last watchdog check, a failed read is retried once per
  interval, without another interrupt.
- Engine: release and recovery end only runless root turns and their attached
  work (`endRunlessRootTurns`). Cascade events carry the owning run id.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ts running

The 60th check of a closed session's subagent sent turn/interrupt even when
every thread/read said inProgress, so an hour-long healthy child was cut
off. The last check now interrupts only turns Codex did not last report
running; those stay read-only until Stop or their own end.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	apps/conn-server/crates/conn-engine/src/commands.rs
#	apps/conn-server/crates/conn-engine/src/engine.rs
#	apps/conn-server/crates/conn-engine/src/fake.rs
#	apps/conn-server/crates/conn-engine/src/lib.rs
#	apps/conn-server/crates/conn-engine/src/runner.rs
#	apps/conn-server/crates/conn-engine/src/store.rs
#	apps/conn-server/crates/conn-provider-claude/src/interrupt_tests.rs
#	apps/conn-server/crates/conn-provider-claude/src/mapper/mod.rs
#	apps/conn-server/crates/conn-provider-codex/src/client.rs
#	apps/conn-server/crates/conn-provider-codex/src/launch.rs
#	apps/conn-server/crates/conn-provider-codex/src/mapper.rs
#	apps/conn-server/crates/conn-provider-codex/src/replay_tests.rs
#	apps/conn-server/crates/conn-provider-codex/src/session.rs
#	apps/conn-server/crates/conn-provider/src/lib.rs
#	apps/conn-server/crates/conn-server/src/serve.rs
#	apps/conn-server/tools/check.sh
…tached sessions

- The receipt-owner step adds each column a store lacks, at any version up to 6, so a
  store the branch wrote at 6 before the merge gets them.
- A shared Codex close settles a run held between goal turns: its completed turn and
  terminal show, as the process-ending close does.
- A busy session a fresh run moved aside ends its native subagents when its stream ends
  on its own.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
# Conflicts:
#	apps/conn-server/crates/conn-engine/src/engine_tests.rs
#	apps/conn-server/crates/conn-engine/src/reads.rs
#	apps/conn-server/crates/conn-engine/src/store.rs
#	apps/conn-server/crates/conn-engine/src/t3_import.rs
@nckrtl
nckrtl merged commit a3f5ee6 into main Nov 24, 2026
47 checks passed
@nckrtl

nckrtl commented Nov 24, 2026

Copy link
Copy Markdown
Owner Author

Included in the merge train #327 (merged as ee7b1f9). Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL vouch:trusted Author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant