Repository navigation
test(agentsapi): expect rescoped retries after steering to succeed - #168569
Conversation
#168394 stopped steering confirmation from rotating the transcript generation, so the foreground admission stays valid. Retries after accepted steering with a new run, a reset native binding, or a new context budget now reread the same admission-fenced prefix and finish ok instead of failing with "Current-turn transcript admission identity changed". Assert that contract: same-run retries reuse retained history, rescoped retries reread once without widening it, and cancelled or revoked retries keep their terminal outcomes.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesUpdates Agents API retry tests to expect successful retries after steering when the run, native binding, or context budget changes. Example: After accepting “Use the updated result.” as steering, retry with a 32,000-token context budget.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR repairs obsolete test expectations after the merged steering fix, preserves meaningful coverage, and introduces no actionable defect. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Agents API attempt owner prepares bounded transcript history for prompt hooks, runs the native session, and returns the terminal outcome and reply; these tests exercise retries through that owner with real transcript storage and mocked provider operations. flowchart LR
A[Retry fixture] --> B[Agents API attempt]
B --> C[Retained history]
B --> D[Admission fenced transcript read]
C --> E[Prompt hooks]
D --> E
E --> F[Native session fixture]
F --> G[Terminal and history assertions]
Technical reviewBest possible solution: Merge the focused expectation repair while retaining the existing retry-history and interruption coverage. Do we have a high-confidence way to reproduce the issue? Current source explains the obsolete failure expectations, and the PR reports a targeted production-revert comparison; no tests were run during this read-only review. Is this the best way to solve the issue? This is the appropriate repair because the successful retry behavior is intentional and already merged, while the updated assertions continue checking bounded history and interruption outcomes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 171df4e1c5a0. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests -7. Total -7 across 1 file. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 10, 2026, 2:14 PM ET / 18:14 UTC (Revision 2). |
|
Merged via squash.
|
…penclaw#168569) openclaw#168394 stopped steering confirmation from rotating the transcript generation, so the foreground admission stays valid. Retries after accepted steering with a new run, a reset native binding, or a new context budget now reread the same admission-fenced prefix and finish ok instead of failing with "Current-turn transcript admission identity changed". Assert that contract: same-run retries reuse retained history, rescoped retries reread once without widening it, and cancelled or revoked retries keep their terminal outcomes. Co-authored-by: Peter Steinberger <[email protected]>
…168569) #168394 stopped steering confirmation from rotating the transcript generation, so the foreground admission stays valid. Retries after accepted steering with a new run, a reset native binding, or a new context budget now reread the same admission-fenced prefix and finish ok instead of failing with "Current-turn transcript admission identity changed". Assert that contract: same-run retries reuse retained history, rescoped retries reread once without widening it, and cancelled or revoked retries keep their terminal outcomes. Co-authored-by: Peter Steinberger <[email protected]> (cherry picked from commit aec6e7a)
…168569) #168394 stopped steering confirmation from rotating the transcript generation, so the foreground admission stays valid. Retries after accepted steering with a new run, a reset native binding, or a new context budget now reread the same admission-fenced prefix and finish ok instead of failing with "Current-turn transcript admission identity changed". Assert that contract: same-run retries reuse retained history, rescoped retries reread once without widening it, and cancelled or revoked retries keep their terminal outcomes. Co-authored-by: Peter Steinberger <[email protected]> (cherry picked from commit aec6e7a)
Related: #168337 (inherited failure), #168394, #168014, #161444
What Problem This Solves
Fixes:
extensions/agentsapi/agentsapi-attempt.test.tsfails onmain(3 of 12) because three retry-after-steering cases still expect an admission failure that #168394 intentionally removed.User Impact
No user-visible change. Clears an inherited
mainfailure that PRs such as #168337 currently carry.Why This Change Was Made
#161444 made same-run Agents API retries survive accepted steering by keeping the prepared prompt history. At that time, confirming which run consumed a steering message rewrote that row and rotated the transcript generation. Retries that changed scope (new run ID, reset native binding, new context budget) therefore reread history and failed with
Current-turn transcript admission identity changed. Those three cases recorded that failure as the expected outcome.#168394 (fixes #168014) made steering confirmation keep the running turn's admission. The rescoped retries now reread the same admission-fenced prefix and succeed, which is the behavior #161444 was working toward. The test now asserts that contract:
ok, and still see only the prior history (not widened, no hook-mutation leakage);Production code is unchanged. The retained-history path still matters because every other in-place transcript rewrite still rotates the generation.
Evidence
main(9c37dbf3e90b): the original file fails 3 of 12 with the same signature recorded for fix(ui): retain test coverage when files use TSX #168337 (expectedfailed, receivedok).pnpm test extensions/agentsapi/agentsapi-attempt.test.ts --maxWorkers=1took 2 min 4 s wall on a loaded Mac (load ~30, mostly worker preparation); the six retry cases took 1.3–8.9 s each under that load.rewriteSqliteTranscriptEventRowsInTransactionmakes the original test pass 12 of 12 and makes this updated test fail exactly the three rescoped cases (expected { kind: 'failed', … } to deeply equal { kind: 'ok' }). The guard was restored afterward.checks-node-changed-extensions-config(job 114271287353): 12 of 12 passed; the six retry cases took 236–467 ms each.openclaw/ci-gateis green.pnpm test … --maxWorkers=1, 27 s with the CI runtime policy), memory backoff 6/6, and the models e2e 8/8 afterpnpm build qaRuntime.pnpm check:changedpassed every lane for this file (format, ratchets, plugin boundaries, extension-test typecheck). Its only red was the repo-wide dead-export scan, ontools/solid-lint/index.mjs(already fixed on main by 61621f7) and twosessions-channel-fixture.test-support.tsstubs from feat: choose when sessions can send and receive messages #162316. This PR touches neither.vi.spyOnonSessionManager.openModelContextAsync, whichagentsapi-attempt.tscalls in exactly one place.The other inherited failures from #168337's list are already fixed on
mainand need no PR (both pass in the Testbox run above):manager-search-reindex-backoff.test.tsby 0a687e8 (#168465; it seeds fresh content because unchanged chunks reuse embeddings) andcli-json-stdout.models.e2e.test.tsby d0e1bbc.