Repository navigation
fix(daemon): honest page totals, missing-session 404, cross-page edges - #5827
Merged
Merged
Conversation
- One helper decides what an offset page proves about the match count; an empty page past the end no longer reports its offset as a total or lower bound (paste browser, facade and archive-reader attachment library). - The archive-reader messages projection returns None for an unknown session so /messages and /read?view=messages answer 404, and its authority envelope is timed after the window read. - A cancelled request handle that interrupts SQLite surfaces as DaemonOperationCancelled instead of a generic sqlite_error. - Topology pages keep every edge whose child is on the page, so an edge crossing a page boundary is served exactly once. - Route metadata-only reasons come only from declared notes, so the startup gate refuses an unclassified /api route. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Sinity
enabled auto-merge (squash)
September 29, 2026 13:06
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. |
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg
This was referenced Sep 29, 2026
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
Fixes six confirmed Codex P2 defects in daemon read routes: paginated totals, a missing session answered as HTTP 200, authority timing, cancelled SQLite reads, topology edges across pages, and a vacuous route-classification gate.
Problem
/api/paste-browserpublishedtotal_lower_bound = offset + len(rows)for an empty page past the end (offset 100 over three matches reported 100). The archive-reader attachment library reportedtotal = offset + len(entries)withtotal_is_exact = truefor that page. Three call sites each re-derived the rule.execute_http_session_messagescaughtKeyErrorand returned an error-outcome page, which/api/sessions/<id>/messagesand/read?view=messagessent with HTTP 200.elapsed_msexcluded the read._run_archive_bounded_querytranslated aninterruptedsqlite3.OperationalErroronly for a client disconnect or an expired deadline. A cancelledCancellationHandlereached the route assqlite_error(500), notDaemonOperationCancelled(408).bound_topology_envelopekept an edge only when both endpoints were on the page. For a chain read two nodes at a time, the edge from a page-two child to its page-one parent appeared on no page.RouteContract.metadata_only_reasonsynthesized a reason for any unbound route, so the startup gate that refuses unclassified/apiroutes could never fire.Solution
_page_total_fieldsindaemon/webui_data.pyis the one owner of what an offset page proves. A full page gives only a lower bound. A short page with rows gives an exact total. An empty page past offset 0 gives neither.build_library_payloadandbuild_paste_browser_payloadtakeoffsetandpage_truncatedand call it; all three routes use them.Nonefor an unresolvable reference. Both message routes answer 404not_found, the same way session detail does. The facade route also returnsNonewhen the session summary is absent.DaemonOperationCancelled.metadata_only_reasonreturns only declarednotes. The newis_metadata_onlyproperty drives the inventory, so the gate sees unbound routes that have no reason.No file is in the derived-identity closure:
devtools schema closurereportsoutfor all eight changed production files.Verification
agentctl job start --workspace <wt> polylogue pytest_focused -- tests/unit/daemon/test_bounded_read_payloads.py tests/unit/daemon/test_http_attachment_library.py tests/unit/daemon/test_http_bounded_mutations.py tests/unit/daemon/test_http_paste_browser.py tests/unit/daemon/test_route_contracts.py tests/unit/daemon/test_topology_endpoint.py tests/unit/daemon/test_topology_stack.py tests/unit/daemon/test_web_reader.py tests/unit/operations/test_http_session_reads.py tests/unit/surfaces/test_topology_route_parity.py tests/unit/operations/test_read_view_operations.py tests/unit/api/test_topology_api.py tests/unit/mcp/test_session_orchestration.py tests/visual/test_reader_paste_spans.py(job 3025):passed 377, failed 3.The three failures,
test_paste_browser_walk_reports_unknown_total_when_the_page_fills,test_archive_filter_kwargs_cover_every_storage_lowerable_spec_fieldandtest_lineage_and_topology_use_the_pinned_graph_engines, fail identically at origin/master 0914f89 (job 3060,--on-default-branch:4 failed, the fourth being an unrelated catalog test). They are inherited.After review, the result variable was renamed so it no longer shadows the
payloadargument (mypyno-redef), and the test rows were annotated. Thenagentctl job start --workspace <wt> polylogue verify_quick(job 3134) succeeded, andpytest_focused -- tests/unit/operations/test_http_session_reads.py tests/unit/daemon/test_http_attachment_library.py tests/unit/daemon/test_bounded_read_payloads.py(job 3149) succeeded.Self-review
Checklists read:
docs/review/codex-review-guide.md, the worker-contract generic list. Passes: 1 (clean)._handle_attachment_libraryarchive-reader branch,_do_paste_browserover a seeded archive, the/topologyhandler with a continuation, andvalidate_declared_route_reachability.git grep total_is_exact -- polylogueoutsidewebui_data.pyreturns 0 hits, so every page-total producer now uses the helper.git grep '"interrupted" in' -- polyloguefinds one handler that translates route interrupts. The topology derivation (storage/derived/topology/derivation.py) already pages edges by child. The same class of defect in message-page outcomes (outcome decided from the session total) is fixed in a separate CLI PR.build_library_payloadandbuild_paste_browser_payloadchanged signature; all three callers andtest_http_bounded_mutations.pyare updated.metadata_only_api_routeshas one consumer, the startup gate. No web UI source readstotal_lower_boundor the removed 200 error page.not_found, and a cancelled read is a 408operation_cancelled. No path falls back to a weaker answer.offset + len(rows)as the lower bound, the both-endpoints edge rule, the synthesized route reason, and authority serialized before the read.Findings
_page_total_fieldsomits the lower bound for an empty page past offset 0test_empty_page_past_the_end_claims_no_counttest_archive_reader_library_empty_page_past_the_end_claims_no_countNone;_handle_get_messagesanswers 404test_messages_route_answers_a_missing_session_as_not_found,test_session_messages_reports_a_missing_session_as_absenttest_session_messages_authority_elapsed_covers_the_window_readDaemonOperationCancelledtest_archive_bounded_query_translates_a_cancelled_handle_interrupttest_continuation_pages_concatenate_every_edge_oncenotes; gate inventory byis_metadata_onlytest_unclassified_api_route_fails_the_startup_route_gate🤖 Generated with Claude Code
https://claude.ai/code/session_015pdKaZWyGe6Ngvsz468dzg