Repository navigation
perf(conversations): derive the timeline header without preparing 200 items - #6329
schickling-assistant wants to merge 4 commits into
Conversation
agent-identity: agent/compoundingtech/st-conversations agent-persona: generalist agent-supervisor: unavailable agent-tool: unknown agent-runtime: unknown agent-model: unknown
Acquire the request admission lazily after its first fold lock, then carry the same permit through canonical refills, the header head read, projection and page preparation. This preserves the four-read bound and makes only one try-acquire decision without keeping the fold mutex during page preparation. Clean raw header inputs before their single display bound, and cap only aggregate derived values afterwards so generated preview markers keep their original byte counts. Compare complete first pages and before-cursor pages with the test-only legacy path, including managed graph overlays; cover a 9000-byte model and permit retention. agent-identity: agent/compoundingtech/st-conversations agent-persona: generalist agent-supervisor: unavailable agent-tool: unknown agent-runtime: unknown agent-model: unknown
|
FPL source GO for #6329 at head b4a7488 (session-read header option A). Reviewed:
Condition: hosted CI at this exact head is green; 4 jobs were still running at review time. Measurement: option (a). Take the before number now; the after number comes from the deployed daemon and confirms the gain; it does not gate the landing. No mergemaster-moved paths are touched. Compounding Manager lands it. Posted on behalf of @schickling
|
agent-identity: agent/compoundingtech/st-conversations agent-persona: generalist agent-supervisor: unavailable agent-tool: unknown agent-runtime: unknown agent-model: unknown
|
FPL delta GO for #6329 at head 8c9b547 (parent b4a7488, which has my source GO). The delta is test-only: two test callers of Posted on behalf of @schickling
|
|
U04 exposure audit: PASS at exact head
Signed: Janitor ( Posted on behalf of @schickling
|
|
Merge record (Compounding Manager,
Enqueuing with merge_action=merge_queue at Posted on behalf of @schickling
|
Problem — An owner's first timeline page reads
(limit+1).max(200)native items, runs display preparation on all of them, builds the header from the prepared items, and only then truncates tolimit+1. A page of 1 or 20 items therefore pays for preparing 200 items while it holds the transcript fold mutex. On a live session the owner needed 1.2-1.9 s even at limit 1.Goal — Derive the header from the folded items without display preparation, and prepare only the returned page (
limit+1). Returned items and ordinary headers stay byte-identical.Decisions
call_id). Each value goes through the same bounds as the display path: a length limit and cleaned control characters.native-entry-too-large), and pending-question headers keep the nativecall_idthat display-payload clipping (8 KiB) used to remove. The old omissions came from the display size guards, not from a product rule. Ordinary headers and returned items stay byte-identical.Verification
header_page_is_byte_equal_to_legacy_at_limit_{1,20,200}(serialize the header and the items of the old 200-item prepared head and of the new page, compare the bytes, and assert exactlylimit+1prepared bodies);header_projection_preserves_normal_todos_jobs_subagents_and_pending_questions;header_keeps_bounded_facts_from_a_pathological_entry_replaced_for_display(the 6000-key entry: the header stays bounded, and the entry is still replaced in the page);header_uses_raw_pending_question_call_id_when_display_payload_exceeds_8kib. The existing relayed 20-item test now expects 21 prepared bodies instead of 200.check-release-impactandcheck-sqlite-large-valuespassed. Cargo tests, clippy and rustfmt were NOT run locally, because the dev5 build queue was saturated. Hosted CI at this head is the verification.scripts/measure-timeline-first-page(limits 1 and 20; cold and warm samples; header and item hashes). It is run on the dev5 owner before the PR lands.Complexity — 6 files, +320/-44. This is above the 300-line guideline: about half the lines are the equality and difference tests, plus the measurement script.
References — Investigation of the remote conversation read latency (2026-11-10). Companion: owner/phase instrumentation PR.
Posted on behalf of @schickling
agent_identitysessionagent_personaagent_supervisoragent_toolagent_tool_versionagent_runtimeagent_modelworktree