Repository navigation
bridge: recover failure smoothness, nul, idle update and v1→v2 fixes - #156
Merged
Merged
Conversation
codex unloads an idle thread about a minute after its last turn. a follow-up that lands during that unload got "thread is closing; retry thread/resume", which inline posted as a failure. - open retries only that exact refusal for the same thread, with 100 ms to 1 s backoff inside 10 s. start, fork, model errors and transport failures are not retried, and no input is sent until a resume succeeds. - each attempt gets a fresh early listener. the resume response's wire sequence tells an old thread/closed from a close of the reopened session. - a turn completion newer than the resume snapshot is not undone by it, and a snapshot with no active turn clears stale working state. - agent bridge: passive batches replace a streamed message in place instead of keeping its first revision, the visible-text sanitizer is public for doc ranges, and the store can expire unfinished v1 session pickers when the bridge moves to v2. from #156.
…e updates - streamed edits of another agent's progress count as one message for loop caps. an edit of an agent message this agent already acted on only refreshes passive context and never reruns commands, mentions or loop accounting. - a slash command needs a leading position, optionally after structured mentions and their separators. commands inside code or pre spans and pasted transcripts stay literal. - a refused or gone progress message frees its slot and later activity posts a new message on the edit cadence; render keeps splitting finished rows until the rest fits, and a refused final edit posts a fresh completion summary. - all dynamic doc text, including styled prose, goes through the visible-text sanitizer before its utf-16 ranges are measured, so nul and terminal escapes no longer shift block or entity ranges. - a staged update applies at the next idle moment instead of waiting for a two-minute quiet period; automatic activations stay six hours apart. a stop or restart during probation keeps the candidate retryable. status and doctor show runtime and supervisor versions and any pending update or rollback. - unfinished v1 session pickers expire on the move to v2 and say the bridge was updated. from #156.
apple clients decode text through c strings, so a nul cut older bridge progress short and broke its block ranges. replace nul with u+fffd, also one utf-16 unit, only where text leaves the server: encodeMessage, encodeFullMessage and the legacy message encoder. stored text stays exact, so the block-content mirror check still matches and fetched messages keep their blocks. from #156.
automatic bridge activations stay six hours apart; inline update by hand adopts the staged runtime at the next idle moment. from #156.
morajabi
force-pushed
the
claude/inspiring-neumann-15227d
branch
from
November 22, 2026 16:52
b1fa44d to
2dbc74e
Compare
morajabi
added a commit
that referenced
this pull request
Nov 22, 2026
codex unloads an idle thread about a minute after its last turn. a follow-up that lands during that unload got "thread is closing; retry thread/resume", which inline posted as a failure. - open retries only that exact refusal for the same thread, with 100 ms to 1 s backoff inside 10 s. start, fork, model errors and transport failures are not retried, and no input is sent until a resume succeeds. - each attempt gets a fresh early listener. the resume response's wire sequence tells an old thread/closed from a close of the reopened session. - a turn completion newer than the resume snapshot is not undone by it, and a snapshot with no active turn clears stale working state. - agent bridge: passive batches replace a streamed message in place instead of keeping its first revision, the visible-text sanitizer is public for doc ranges, and the store can expire unfinished v1 session pickers when the bridge moves to v2. from #156.
morajabi
added a commit
that referenced
this pull request
Nov 22, 2026
…e updates - streamed edits of another agent's progress count as one message for loop caps. an edit of an agent message this agent already acted on only refreshes passive context and never reruns commands, mentions or loop accounting. - a slash command needs a leading position, optionally after structured mentions and their separators. commands inside code or pre spans and pasted transcripts stay literal. - a refused or gone progress message frees its slot and later activity posts a new message on the edit cadence; render keeps splitting finished rows until the rest fits, and a refused final edit posts a fresh completion summary. - all dynamic doc text, including styled prose, goes through the visible-text sanitizer before its utf-16 ranges are measured, so nul and terminal escapes no longer shift block or entity ranges. - a staged update applies at the next idle moment instead of waiting for a two-minute quiet period; automatic activations stay six hours apart. a stop or restart during probation keeps the candidate retryable. status and doctor show runtime and supervisor versions and any pending update or rollback. - unfinished v1 session pickers expire on the move to v2 and say the bridge was updated. from #156.
morajabi
added a commit
that referenced
this pull request
Nov 22, 2026
apple clients decode text through c strings, so a nul cut older bridge progress short and broke its block ranges. replace nul with u+fffd, also one utf-16 unit, only where text leaves the server: encodeMessage, encodeFullMessage and the legacy message encoder. stored text stays exact, so the block-content mirror check still matches and fetched messages keep their blocks. from #156.
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.
Recovers bridge reliability work that was finished and reviewed on Oct 30–31 but never committed before the old MacBook died. It was ported from the backup onto current main and re-checked against main's newer bridge work (native OpenCode v2 driver, ranked slash commands, quiet markers). Several of these fixes match reports in Niño's feedback thread: progress stuck on "Working", silent failures, the bridge swapping runtimes mid-session.
No protocol, wire-format or database schema change.
Bridge (cli + crates)
thread/closedcan't close the reopened session, and a turn that completes during the resume isn't reset to running.fd4d80da9keeps them, and an explicitinline updatestill switches at the next idle moment. A deliberate stop or restart during a candidate's probation keeps the candidate retryable. Status shows the runtime version, the supervisor version and any pending update or rollback.Server
encodeMessage,encodeFullMessage, legacy encoder). Stored text stays exact, so the stored block-content copy still matches and fetched messages keep their blocks. This replaces the earlier decrypt-time approach, which dropped blocks on fetch.Docs
inline update.Not included
crates/agent-driver-codex/src/harness/connection.rsopen_onceand needs to re-add those lines there.Testing
cargo test -j 2 -p inline-cli --bin inline bridge::: 560 passed, 9 ignoredcargo test -j 2 -p inline-agent-driver-codex --lib harness::: 26 passedcargo test -j 2 -p inline-agent-bridge --lib: 374 passedcargo clippy -p inline-cli -p inline-agent-driver-codex -p inline-agent-bridge --all-targets -- -D warnings: clean; every commit builds on its ownencodeMessage.test.ts22 passed (the new NUL test fails without the encoder change);tsc --buildpasses apart from the existing missingpackages/mcp/distimports; oxlint clean🤖 Generated with Claude Code