Repository navigation
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed July 19, 2026, 6:34 PM ET / 22:34 UTC. Summary PR surface: Source +245, Tests +251, Docs 0, Config +4, Generated +1, Other +299. Total +800 across 19 files. Reproducibility: not applicable. as a bug reproduction: this PR proposes a performance optimization. The supplied benchmark describes a credible scenario, but it is not tied to the current head and therefore is not current-head proof. Review metrics: 1 noteworthy metric.
Stored data model Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Proof guidance:
Risk before merge
Maintainer options:
Next step before merge
Maintainer decision needed
Security Review findings
Review detailsBest possible solution: Have a transcript/Plugin SDK owner decide whether the three indexed facts are a supported generic plugin contract; if approved, retain the narrow typed API and add redacted final-head Codex and Copilot benchmark or runtime output, otherwise keep the optimization behind an owner-specific internal boundary. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction: this PR proposes a performance optimization. The supplied benchmark describes a credible scenario, but it is not tied to the current head and therefore is not current-head proof. Is this the best way to solve the issue? No, not yet: the indexed lookup approach is plausible, but publishing mirror-specific persistence facts through the Plugin SDK requires explicit ownership approval before it is the best maintainable solution. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 5fcf7e75de3b. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +245, Tests +251, Docs 0, Config +4, Generated +1, Other +299. Total +800 across 19 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (14 earlier review cycles; latest 8 shown)
|
e84b451 to
b628667
Compare
7a9e6db to
e8ed583
Compare
b628667 to
cf8eeb1
Compare
e8ed583 to
8a89dd3
Compare
cf8eeb1 to
7ff4bab
Compare
8a89dd3 to
218ddc6
Compare
218ddc6 to
dc23285
Compare
cb90b46 to
69e4633
Compare
7d6ee84 to
fde727b
Compare
8812718 to
b104cdf
Compare
2e6d7f0 to
c4262aa
Compare
…wdbot-d02.1.9.1.41-bd3.1)
c4262aa to
b372740
Compare
|
Closing because current main has diverged substantially from this implementation and the branch is no longer the right integration shape. The Codex full-transcript mirror scan remains a possible optimization target, but the Copilot dual-write path changed by this PR was removed in #114403. If we revisit the optimization, it should be a fresh, narrow Codex-only change against current main, with realistic transcript-size and writer-lock benchmarks and without committing prematurely to the old indexed-lock Plugin SDK surface. |
#110374 is merged; this draft is rebased directly on
mainand contains only the indexed mirror follow-up.AI-assisted: implemented with Codex. I reviewed the implementation, ran the repository autoreview workflow to a clean result, and verified the exact production owners against current
main.What Problem This Solves
Codex and Copilot transcript mirrors decode every event in a session while holding the session writer lock just to recover idempotency facts, persisted user rows, and Codex message sequencing. A small mirror batch therefore allocates and parses in proportion to the full transcript, including on 100,000-message sessions.
Why This Change Was Made
The transcript identity indexes now on
mainalready own the required facts. This child adds a separatewithSessionTranscriptIndexedWriteLockSDK function whose context extends the unchangedwithSessionTranscriptWriteLockcontext with only three typed reads: supplied-key existence, supplied-key user messages, and the exact indexed message-event count. Codex and Copilot prepare candidate keys before acquiring the lock and query only those facts. No schema, HTTP/SSE, active-memory, cache, raw SQL surface, or generic query abstraction is added.User Impact
Large Codex and Copilot sessions can mirror a small batch without decoding the complete transcript under the writer lock. Dedupe identity, gateway user correlation, hooks, sequence assignment, append/update publication, and replacement behavior remain unchanged.
Changes Walkthrough
src/config/sessions/session-accessor.types.tssrc/config/sessions/session-accessor.sqlite-transcript-store.tssrc/config/sessions/session-accessor.sqlite-transcript-write.tssrc/plugin-sdk/session-transcript-runtime.tsextensions/codex/src/app-server/transcript-mirror.tsextensions/copilot/src/dual-write-transcripts.tssrc/plugin-sdk/session-transcript-runtime.test.tssrc/state/sqlite-query-plan.test.tsextensions/codex/src/app-server/transcript-mirror.test.tsextensions/copilot/src/dual-write-transcripts.test.tsscripts/bench-transcript-mirrors.tsdocs/plugins/sdk-runtime.mdEvidence
Apples-to-apples benchmark
Both revisions ran in clean detached worktrees on the same Blacksmith Testbox lease
tbx_01kxstq13f2qjb6gbktd89njcc(Linux 6.6.141 x64, Node v24.18.0). The identical candidate benchmark file invoked the realcodexTranscriptMirrorRuntime.mirroranddualWriteCopilotTranscriptBestEffortowners. The harness rejects a supplied source SHA unless it equals the checkout's actualHEAD.origin/mainat923d92bdd0e3ddb978ab566efe29a737dc204edf7a9e6db40674118c235c5baf6fb6aa8aceb8abaatype=messageevents, 64-byte content, one indexed idempotency key per eventresourceUsage().maxRSSgrowth after fixture seedingCandidate reduction: Codex median 94.11% (16.97x), p95 94.13% (17.04x), RSS proxy 99.81%; Copilot median 94.37% (17.75x), p95 94.70% (18.88x), RSS proxy 99.85%.
Raw latency samples (milliseconds)
Current main decodes 100,000 transcript payloads per operation to build mirror state. Candidate Copilot decodes zero existing transcript payloads for supplied-key existence. Candidate Codex decodes only the one matching persisted user payload in this fixture; its exact message count reads the covering
(session_id, event_type, seq DESC)identity index without decoding event JSON. Supplied-key queries are batched at 900 keys and seek throughidx_agent_transcript_message_idempotency; joined user rows use the transcript-event primary key.Correctness and contracts
idx_agent_transcript_message_idempotency,idx_agent_transcript_event_sequence, and the transcript-event primary key.Validation commands:
check:changedpassed formatting, schema/API baselines, SDK surface/boundaries, and all core/extension/script typechecks. Its conservative parent-inclusive core lint fan-out found one unnecessary numeric conversion in this child; that was removed, and the affected lint target plus focused SDK/Codex tests then passed.Upstream Codex protocol check
Personally inspected official Codex at
2895d82b5e449407712439ba4f89954f3fa0c7e3:codex-rs/app-server-protocol/src/protocol/v2/thread.rs:1353-1365—thread/readparameters and responsecodex-rs/app-server-protocol/src/protocol/v2/thread_data.rs:170-267— thread turns/items/status contractcodex-rs/app-server-protocol/src/protocol/v2/item.rs:227-250,797-826— stable user/agent message ids and projectioncodex-rs/app-server/src/request_processors/thread_processor.rs:2255-2379— persisted/live thread read andincludeTurnshistory loadcodex-rs/app-server-protocol/src/protocol/v2/turn.rs:407-410— completed turn payloadThese contracts confirm the mirror must preserve stable user/assistant item identity and ordered turn item projection; this child changes only OpenClaw persistence lookup work.