Repository navigation
Protect pending turns from runtime eviction - #1196
SawyerHood merged 2 commits into
Conversation
|
🚨 SLOP COP 🚨 · I am SlopCop. I started the review. I will check security, code quality, performance, architecture, tests, and end-to-end scope. |
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
ELI5: The change keeps a new turn alive while its provider prepares the first event. A daemon reconnect can still tell the server that this turn does not exist.
I found one high-severity correctness issue. A same-instance daemon reconnect can interrupt the accepted turn before its first lifecycle event.
The inline comment gives the full failure path and a specific fix. Use one shared live-thread query for eviction and reconnect reports.
I found no new security issue. The possible long retention matches the existing behavior for a started active turn.
The architecture scan found no other duplicate implementation. The new separate boolean does expose split definitions of live work across eviction and reconnect code.
Validation passed:
git diff --check- 831 agent-runtime tests
- 493 host-daemon tests
- Turbo type checks for both packages
- All GitHub checks, including both package smoke checks
A browser test does not apply because this pull request has no UI path. Add a daemon and server reconnect integration test instead.
I posted a comment review only. I did not approve this pull request or request changes.
be8d41e to
ff8c3a5
Compare
|
Reconnect check after the rebase: I confirmed that
A different daemon instance cannot retain this in-memory turn state. The new report only changes the same-instance reconnect path that preserves the runtime. The branch now uses protocol version 85, after version 84 from PR #1197. |
## Reproduction A focused provider test accepts `turn/start` without emitting `turn/started`. An FNM-shaped `PATH` refresh then exercises idle-runtime eviction during that gap. ## Root cause The command retain ended after the provider accepted the queued prompt. The runtime had pending turn work, but neither the active-turn predicate nor the in-flight-command predicate reported it. ## Fix Expose pending turn-start work from the agent runtime and count it as active environment work. Regression tests cover the event gap and FNM-shaped shell environment changes. Fixes get-bb#1156
…gences - 87 protocol bumps (26->121), not 92; turn-settlement fixes are #1196/#1234/#1321/#1432 - #75 is a pre-GitHub ticket id; cite commit 1a5620b - ProviderAdapter has 18 members, not 16; corrected per-provider line counts - The outbound vocabulary is a shared 7-method core with real divergences (acp lacks fork; codex maps stop/discard/compact/skills to different methods and has 4 methods no bb bridge speaks) - phase 1 must pick canonical mappings; codex bridge is a mapping layer, not a passthrough - Canonical PendingInteractionPayload union lives in @bb/domain, not shared/pending-interaction-normalization.ts (codex-only helper) - classify split is claude-vs-rest; normalizeExecutionOptions is claude-only Co-Authored-By: Claude Fable 5 <[email protected]>
Reproduction
A focused provider test accepts
turn/startwithout emittingturn/started. An FNM-shapedPATHrefresh then exercises idle-runtime eviction during that gap.Root cause
The command retain ended after the provider accepted the queued prompt. The runtime had pending turn work, but neither the active-turn predicate nor the in-flight-command predicate reported it.
Fix
Expose pending turn-start work from the agent runtime and count it as active environment work. Regression tests cover the event gap and FNM-shaped shell environment changes.
Fixes #1156