Repository navigation
fix(operations): resume transcript windows with the token's selection - #5811
Merged
Merged
Conversation
A continuation carries the window it was minted for, but four sites read the resumed request's defaults instead: - frame_request narrowed a window by returning the new request, whose default offset and filters replaced the token's (the sibling of the session_reads fix in #5778); its dialect check also reported a result identity mismatch as "dialect mismatch". - message_transcript_window filtered by the caller's request, so a token-only sessions.read resume of a message_role window served unfiltered rows at the filtered offset. - the generic session.read route dropped an explicit limit beside a continuation, so the CLI's narrowed resume (#5785) read the token's full page, and the messages kind checked filters on its own payload instead of the framed token. - SessionReadRequest declared limit=200, and the operation transport forwards every field, so honouring a stated limit would read that default as widening a token-only resume. An omitted limit is now None. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
The action-ref assertion added in #5722 contradicts ObjectRef.parse, which reads an action's trailing block index as a qualifier (#4329). #5722 also made the budget a hard cap, so an 80-token budget now omits every row; the recap test uses a budget where recapping, not omission, fits the page. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
Sinity
enabled auto-merge (squash)
September 29, 2026 08:47
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
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.
Summary
Resumed transcript windows now read the selection and page size the continuation was minted for, on both the typed session-owner route and the generic
session.readoperation. Two staleprose_with_refscompiler tests are realigned with the contracts that changed under them. Tracking: beads polylogue-zeolc and polylogue-6bhuy (the compiler and transcript-window items).Problem
At origin/master 1beb2e5 (agentctl job 2441), four tests failed:
test_session_owner_operations.py::test_search_read_timeline_and_mcp_use_owner: MCPquery(projection="sessions")sent the default page size with a continuation, and the owner refused that as widening the window. fix: close worker-13 MCP, surface and excision review findings #5779 has since landed the same fix on master. This PR adds narrowing and widening assertions for that route.test_transcript_window_route.py::test_continuation_can_narrow_final_window_without_losing_snapshot_binding("dialect mismatch"): the test hand-built a token whose result identity did not match its request, andframe_requestreported that as a dialect mismatch. Reading the code turned up a real bug underneath. On narrowing,frame_requestreturned the new request, whose default offset and filters replaced the token's. fix: close Codex review findings from the #5722 landing #5778 fixed the same bug insession_reads._transactionbut not here.test_compiler.py, bothprose_with_refstests: fix: Codex P2 review debt: polylogue/cli part 1 (25 findings) #5722 changed the contracts these tests assert (details under Solution).Checking the other surfaces that resume a continuation found three more places where the resumed request's defaults win over the token:
message_transcript_windowfiltered with the caller's request. A token-onlysessions.readresume of amessage_role=("user",)window served unfiltered rows at the filtered offset.session.read(transcript and messages kinds) dropped an explicitlimitbeside a continuation. The CLI's narrowed resume from fix(cli-api): report tier skew, bound review counts and continuations #5785 (remaining bound,result_too_largehalving) therefore read the token's full page in production. fix(cli-api): report tier skew, bound review counts and continuations #5785's tests mock the dispatch, so they could not catch this.Solution
frame_request: separate the dialect check from the result-identity check. On narrowing, keep the token's request and change onlylimit.message_transcript_window: frame the request once to get the effective selection, then pass the submitted request to the bound route so epoch validation is unchanged.daemon_reads._session_window_request: one builder for both kinds. With a continuation, a statedlimitnarrows the page (frame_requestrefuses a larger one) and a stated nonzerooffsetis conflict-checked. The messages kind checks filters on the framed selection.SessionReadRequest.limitis nowint | None = None. The operation transport forwards every declared field, so the oldlimit=200default would have read as a request to widen every token-only resume. That was the cause of the four failures in the first focused run (job 2563). Handlers still use the declared 200-row window for a fresh read.ObjectRefassertion that contradictsObjectRef.parse, which has read an action's trailing block index as a qualifier since feat(context,insights): reboot handoff refs and delegation work evidence #4329. The test is fixed; production is right. fix: Codex P2 review debt: polylogue/cli part 1 (25 findings) #5722 also made the budget a hard cap, somax_tokens=80now omits every row. The recap test now uses a budget where recapping, not omission, makes the page fit, and asserts the estimate stays within the prose budget.docs/session-operations.mdstates the resume page-size and filter rules.None of the changed production files is in the derived-identity closure (
devtools schema closure: allout).Verification
agentctl job start polylogue pytest_focused --workspace … -- tests/unit/mcp/test_session_owner_operations.py tests/unit/operations/test_transcript_window_route.py tests/unit/context/test_compiler.py tests/unit/archive/query/test_continuation_surface_parity.py tests/unit/cli/test_session_window_continuation_bounds.py tests/integration/test_transcript_window_differential.py tests/unit/operations/test_transcript_window_resume_selection.py tests/unit/operations/test_daemon_reads.py tests/unit/operations/test_session_read_parity.py tests/unit/operations/test_session_owner_route_equivalence.py tests/unit/operations/test_http_session_reads.py tests/unit/cli/test_read_view_execution_routes.py tests/unit/operations/test_daemon_protocol.py, job 2608:passed 143, failed 0(2 flaky on first attempt, below).agentctl job start polylogue verify_quick, job 2609: succeeded.New regression tests in
tests/unit/operations/test_transcript_window_resume_selection.py:Self-review
QueryContinuation.decodeandframe_requestcaller was checked. The evidence windows (frame_evidence_window) ignorelimiton a continuation, and their only CLI caller sends none, so no wrong rows are served (residual below).window_request, used by the API, MCPreadand HTTP messages routes, dropslimitbeside a continuation. The window is then fully decided by the token. No wrong rows, but an explicit narrowing is ignored there (residual).SessionReadRequest.limitis read only through_non_negative_int(..., default=_SESSION_READ_WINDOW), which mapsNoneto the 200-row default. No checked-in schema snapshot names it.frame_requestis pure; calling it twice cannot diverge, and the bound route still validates the epoch.SessionReadRequestvalidation exactly as the transport does, which is what exposed the default-limit problem.Residuals
window_requestroutes silently ignore an explicitlimitbeside a continuation. They serve correct rows, but do not narrow.TimeoutError,DaemonWriterOwnerLoopStopped) under host load. They are unrelated to window framing, and both passed on rerun.🤖 Generated with Claude Code
https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg