Repository navigation
Conversation
nckrtl
force-pushed
the
fix/conn-server-audit-pass4-steer-watch
branch
from
November 23, 2026 18:43
8dd96cf to
174b123
Compare
nckrtl
force-pushed
the
fix/conn-server-audit-pass4-steer-watch
branch
from
November 23, 2026 19:21
174b123 to
7c4397b
Compare
nckrtl
force-pushed
the
fix/conn-server-audit-pass4-steer-watch
branch
from
November 23, 2026 20:10
7c4397b to
d136c47
Compare
nckrtl
force-pushed
the
fix/conn-server-audit-pass4-steer-watch
branch
from
November 24, 2026 00:34
d136c47 to
3b2b4ce
Compare
… Claude, as T3 SteerInput had no field for MCP app notes, so a note an app changed during a turn never reached the provider until the next turn. The engine now passes the thread's notes with each steer. Codex's turn/steer takes no additionalContext, so as T3's steerTurn the session sends each note the native thread has not been sent with its current text as quoted user input before the message, and records it only after the steer succeeds; a turn start records what its additionalContext sent. Claude steers compare with what the running turn offered, else with the history, as T3's steer path does. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…n agent's merge stays quiet, as T3 When someone else merged a watched pull request, the watch loop cleared the watch without a wake, so an agent waiting on the merge never heard of it. It ended every merge quietly because it could not tell the thread's own merge from another one. This ports T3's PullRequestWatchReactor merge path: - close_commands (conn-source-control): isChangeRequestCloseCommand, changeRequestsClosedBy and commandIndicatesFailure. tools/gen-upstream.mjs generates the host patterns and T3's own answers for sample commands and outputs, which the Rust tests compare with. - conn-engine: subscribe_command_events, every thread's committed command_execution items and run updates, paged from the store. - the watch loop: agentEnds. A merge or close command marks the thread's watches while it runs; when it ends, the thread's watches are read at once, quietly for what it closed. A failed command ends nothing. - finished: a merged or closed pull request wakes its thread with T3's text, naming base branch, merger and merge commit; the PR detail now carries mergeCommitSha and mergedBy. A merged snapshot gets one read and ends from the snapshot when the host cannot be read. Co-Authored-By: Claude Opus 5.5 <[email protected]>
commandIndicatesFailure reads the first 32,768 UTF-16 units of an output. The port cut at 32,768 UTF-8 bytes, so after 12,000 CJK characters it missed an `exit code: 1` that T3 sees, and took a failed merge command for the thread's own merge. It now cuts at UTF-16 units. gen-upstream.mjs records T3's own answers for long outputs, the CJK case among them, and a test compares with them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The feed's cursor moved only to the last matching row, so every commit made the next read scan again all rows that matched nothing since. The page query now captures the high water with its read and reports how far it covered: the high water for a short page, the last row for a full one. The feed moves its cursor there. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…he retry A steer recorded its notes as offered before the SDK took the message. A refusal, such as a full prompt queue, left them recorded, so the retry left the note out. The steer still records the offer as it goes out, so a turn that ends before the SDK answers counts it, and a refusal puts back what the turn had offered before. Co-Authored-By: Claude Opus 5.5 <[email protected]>
… as the thread's own Gate findings on the watch's merge path: - A slow host read held every agent event, so a sweep could wake on the thread's own merge before its command was seen, or end quietly after a merge command had failed. agent_ends.rs now holds T3's agentEnds apart from the loop: the command feed applies each change as it arrives, and only the read after a finished command waits in the loop, which then releases the command. - Commands past 64 per thread fold into one entry that keeps ownership until the thread's reads are done, instead of being dropped. - A merge through the MCP pull_request_merge tool marks the calling thread before the merge and reports its outcome after it, so its watch ends quietly. T3 wakes the thread there; an agent's own merge waking itself is noise, so this deliberately differs. An auto-merge is not marked: it lands later and wakes the thread. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…even after the turn completed Round-2 gate finding on #280: a steer the SDK refused after its turn had completed left its notes in the history, so the next turn omitted them. Each message that carries notes is now an offer with an id until the SDK answers. A refusal takes back that offer's notes, in the turn's offer and in a history the completed turn wrote them to, unless a newer offer replaced them. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…r block the feed, stack merges name their layers Round-2 gate findings on #280: - Ended merge commands no longer push reads into a bounded channel the feed waits on. AgentEnds keeps the pending reads, one per thread, and wakes the watch loop, so ownership updates never stop behind a slow read. - Each command is its own entry again, released on its own failure or completed read. Past 64 nothing folds; a thread keeps up to 1024 at once. - An MCP merge names its repository and the pull requests it merges: the target and, for a stack, the layers in expectedStackHeads. It no longer marks every pull request of the thread. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…24 commands, a steer replaces Claude's offered notes - AgentEnds and the command feed's finished set drop their 1,024 caps. Ownership now ends only on failure, at run end if unfinished, or after the covering read; the finished set lives as long as the feed (PullRequestWatchReactor's agentEnds and finished). - A Claude steer that carries notes replaces the turn's offered snapshot with the app's current notes, so a note the app removed is sent again when it returns (ClaudeAdapterV2 commitOffer). A refusal restores removed notes too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
nckrtl
force-pushed
the
fix/conn-server-audit-pass4-steer-watch
branch
from
November 24, 2026 00:40
3b2b4ce to
5a3895d
Compare
# Conflicts: # apps/conn-server/crates/conn-engine/src/streams.rs # apps/conn-server/crates/conn-provider-codex/src/session.rs
Owner
Author
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.
Fixes Pass 4 findings 4.6 and 4.3 of the Conn Server port audit. Stacked on #276: the base is
fix/conn-server-audit-pass4. One commit per finding. Each acceptance test was run failing without its fix and passing with it.4.6: a steer carries a changed MCP app note (
b25072b032)Crates: conn-provider, conn-engine, conn-provider-codex, conn-provider-claude.
Change:
SteerInputgetsapp_context, and the engine fills it.turn/steertakes noadditionalContext. As T3'ssteerTurndoes, the session sends each note the native thread has not been sent, as quoted user input (<external_KEY>text</external_KEY>) before the message. It records notes only after a steer succeeds; a turn start records what itsadditionalContextsent.Tests:
session::tests::a_steer_carries_a_changed_app_note_once(codex, fake app-server inputs): an unchanged note is not resent, a changed one goes once before the message, and a refused steer resends it on the retry. With the note-sending stubbed out, thechangedinput lacks the note.interrupt_tests::mcp_app_notes_reach_the_claude_prompt_until_a_turn_takes_them_ingains T3's steer steps: an unchanged note is skipped, a changed one goes once. Without the steer change it fails on PROJ-44.4.3: an external merge wakes the thread; the agent's own merge stays quiet (
8dd96cfb9d)A full port of T3's
PullRequestWatchReactormerge path, in rust-port order: T3's behaviour and tests first, then the smallest Rust design.isChangeRequestCloseCommand,changeRequestsClosedBy(sourceControlDefinitions.ts)conn_source_control::close_commands::{is_close_command, closed_by}.tools/gen-upstream.mjsgenerates the host patterns (JS\dand\wmade ASCII; lookaround refused)commandIndicatesFailure,toolOutputIndicatesFailure(toolOutput.ts)close_commands::{command_failed, output_indicates_failure}engine.streamDomainEvents(command items, run updates)Engine::subscribe_command_events: paged from the event log after each commit, behind a bounded channelagentEnds,finished,readThreadWatchesWatcher::{agent_event, ended_by_agent, read_thread_watches}plus theagent_eventsfeed task. Kept-item memory is capped (1024 finished ids, 64 open commands per thread)finished/pullRequestWatchEndMessageWatcher::finished,watch::end_message. Closed PRs now use T3's textendMergedSnapshots; merged snapshot no longer inendsWithoutReadread_groupmergeCommitSha,mergedByin the PR detaildetail.rs, only when the host gives themTests:
close_commands::tests::{closes_what_t3_finds, reads_failure_output_as_t3}compare with T3's own answers. The generator runs T3's functions on 30 commands (T3's test cases plus other hosts and negatives) and 26 outputs.the_command_feed_carries_command_items_and_run_updates(conn-engine).agent_merge_commands_reach_the_watch_loop: running, then completed, sent once; a failure reported as completed counts as failed; run end; other commands ignored.a_watched_pull_request_wakes_its_thread_when_its_checks_or_comments_change, extended:completed, summary#7: merged, stopped watching, watch cleared. The next sweep sends nothing.gh pr merge 7ends the watch with no wake.finishedquiet fails on the missing external wake; forcing it loud fails on the own-merge wake.Dependency:
conn-source-controlnow usesregex-automata(workspace dependency, already in the binary through conn-support and conn-files). The onlyCargo.lockchange is that edge.Gate round 1 findings (fixed)
7c4397bd18agent_merges_apply_during_a_held_host_read(both orders, held host response)8dd96cfb9downership changed only inWatcher::agent_event, which needs&mut Watcherand so cannot run while a pass holds it3c4eabf927mcp_app_notes_reach_the_claude_prompt_until_a_turn_takes_them_in(refusal, then retry)pull_request_mergewoke its own thread7c4397bd18agentMergesteps ofa_watched_pull_request_wakes_its_thread_when_its_checks_or_comments_change8dd96cfb9dthe merge tool reported nothing to the watch3a8c99ba0athe_command_feed_moves_past_rows_that_match_nothing990c29018areads_as_much_output_as_t3, with T3's answers, including 12,000 CJK characters thenexit code: 17c4397bd18agent_ends::tests::commands_past_the_limit_keep_ownershipDeliberate difference from T3 (finding 3). T3 wakes a thread when that thread's own agent merges its watched PR through the MCP
pull_request_mergetool. That wake is noise, so Conn Server ends the watch quietly instead. The tool marks the calling thread before an immediate merge and reports the outcome after. An auto-merge is not marked: it lands later, and a later merge still wakes the thread.Gate round 2 findings (fixed)
7c4397bd1821f7ea4ca1d136c47f7fended_merges_never_block_the_feedd136c47f7fagent_ends::tests::many_commands_keep_their_own_lifetimesd136c47f7fown_merge_tests::a_stack_merge_names_its_repository_and_layersany: truefor a stackGate round 3 findings (fixed in
5a3895dfca, rebased on #276f54a467b69)d136c47f7fAgentEndsand the feed'sfinishedlist dropped ownershipmany_commands_keep_their_own_lifetimes(now 1,025 commands);an_ended_merge_is_never_claimed_againBoth caps are gone. Ownership ends on failure, at run end if unfinished, or after the covering read;
finishedis a set that lives as long as the feed, as T3's reactor (PullRequestWatchReactor.ts). A steer that carries notes replaces the offered snapshot with the app's current notes (ClaudeAdapterV2commitOffer); a refusal restores removed notes too, unless a newer offer followed.Known follow-up (not fixed here): a refused steer's rollback can put a note into the previous turn's delivered history; if that turn is then interrupted and the app restores the note, the next turn skips it. The fix is to track which turn owns each snapshot.
Merge with #256: keep both the reconnect test and the app-note test in
crates/conn-provider-claude/src/interrupt_tests.rs.Checks
Run on macOS, sealed (
sealedCargoEnv), on this tree:cargo fmtcargo clippy --workspace --all-targets -D warnings: clean.node tools/gen-upstream.mjs --check: current.cargo test, all passed:Not run:
tools/check.sh. It builds the comparison binaries and decode fixture intoapps/conn-server/target, outside the agreed build folder, on a host short of disk. CI runs it on Linux.Coordination:
provider_text) next to the newapp_contextfield. Expect a textual conflict only.conn-provider-codex/src/launch.rs, which this PR does not touch.Model: Claude Opus 5.5, Claude Code.
🤖 Generated with Claude Code