Repository navigation
fix: node continuation signatures diverge from transcripts - #164287
Conversation
Reuse the transcript signature owner before fresh worker terminal messages enter live history. Preserve encrypted bytes, tool arguments, and approved history. Formatting verified on the isolated AWS lease with pnpm exec oxfmt --check for all four changed files. The sparse local checkout has no node_modules, so the commit uses --no-verify after that remote formatting proof.
|
🦞👀 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. Reviewed October 3, 2026, 8:18 AM ET / 12:18 UTC (Revision 2). ClawSweeper reviewWhat this changesThe PR makes fresh node assistant reasoning signatures use the existing transcript canonicalization before continuation, with regression coverage and documentation. Merge readiness✅ Ready for maintainer review The PR remains useful: current main still permits signature-byte divergence. No actionable correctness or security findings remain, and the supplied real-provider evidence supports the repair. Priority: P2 Review scores
Verification
How this fits togetherThe Gateway runs provider inference for remote workers and returns completed assistant messages. Workers reuse those messages for subsequent inference and commit them to transcript storage, so both paths need consistent reasoning signatures. flowchart TD
A[Provider assistant output] --> B[Gateway terminal projection]
B --> C[Transcript signature sanitizer]
C --> D[Completed worker message]
D --> E[Live continuation]
D --> F[Transcript persistence]
F --> C
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +8, Tests +68, Docs +4. Total +80 across 4 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep one transcript-owned canonicalization rule for fresh worker output while preserving ciphertext, executable arguments, and approved history. Do we have a high-confidence way to reproduce the issue? Yes, source establishes the byte-divergence path: main returns raw reasoning signatures while persistence canonicalizes them. The supplied baseline regression and live-provider comparison corroborate it; this review did not execute a reproduction. Is this the best way to solve the issue? Yes, reusing the existing transcript sanitizer at the fresh terminal producer is a narrow repair that avoids rewriting history or duplicating policy. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a38eefeebae5. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
* origin/main: fix(test): restore fixture state and await async completion (#164222) refactor(sessions): stage and settle pending inputs in workers (#164284) fix: speech-only replies fail when models include reasoning (#164285) fix(nextcloud-talk): avoid webhook migration for unconfigured channels fix: guide background skill reviews through Workshop proposals (#164292) test(build): reject AI dependencies in retained config repairs refactor(channels): require canonical private-network settings (#163535) fix(memory): migrate embedding cache in bounded batches and record oversized rows (#164303) feat(state): incognito actor memory and Codex history routing (P5c, inactive) (#164224) refactor(synology-chat): remove unused route account ID (#164280) test(ui): await web push preference publications (#164295) perf(scripts): avoid compiler projects for runtime import parsing (#164243) fix(worktrees): create workspaces from nested Windows repositories (#164249) test(agents,channels,cli): remove low-value tests (batch d173) (#164302) perf(workboard): serve cards per board revision and push changes instead of polling (#164301) refactor(sqlite): deslop sqlite stores (#164271) chore(ui): refresh control ui locales (#164299) refactor(events): deslop listener and disposal plumbing (#164221) fix: canonicalize fresh worker reasoning signatures (#164287)
Reuse the transcript signature owner before fresh worker terminal messages enter live history. Preserve encrypted bytes, tool arguments, and approved history. Formatting verified on the isolated AWS lease with pnpm exec oxfmt --check for all four changed files. The sparse local checkout has no node_modules, so the commit uses --no-verify after that remote formatting proof.
What Problem This Solves
Fresh node assistant messages retained the provider's raw OpenAI reasoning signature while transcript persistence canonicalized the same signature. A subsequent worker inference could therefore replay different signature bytes from those stored for that assistant turn.
User Impact
Fresh worker terminal messages now use the transcript owner's signature canonicalization before the worker uses them for live continuation and persistence. Encrypted reasoning bytes and executable tool arguments remain intact, and previously approved history is not rewritten.
Ordinary live continuation already succeeded on the baseline; this repair establishes byte consistency and does not claim a reproduced provider rejection or introduce strict input binding.
Why This Change Was Made
The Gateway terminal producer owns newly completed provider messages and already has the authoritative model identity. It now calls the existing narrow signature sanitizer. The sanitizer owns route eligibility for both callers, so persistence and live terminal output cannot develop separate canonicalization rules.
Production changes are +12/-4, net +8 lines. This small bug-fix allowance is needed for the fresh-message integration and shared route guard; there is no new canonicalizer, config plumbing, protocol, schema, migration, or historical rewrite.
Evidence
Compatibility: signatures remain strings containing the same existing reasoning-item JSON shape. This moves the existing write-time canonicalization earlier for fresh output; old readers already consume that persisted form. Stored rows, schema/version, ciphertext, and historical messages are unchanged. The continuation regression includes a preexisting noncanonical signature and proves that it remains untouched.
Core and all 27 core-test type graphs, formatting, typed lint, dead-export checks, docs baseline, schema/storage guards, and runtime import-cycle checks passed on the lease. The main rebase did not change the affected inference/redaction owners or dependency pins.
Six local and six node pong turns on the same isolated AWS lease, base
c81d86e82f60versus candidatefb316762581f; medians exclude turn 0. Measurements use uninstrumented builds. All values are milliseconds.Median tails differ by +4 ms locally and +3 ms on the node. This small sample does not establish a speed improvement. All twelve turns succeeded per revision; the kit's final missing-instrumentation grep returns exit 1 after these successful uninstrumented measurements.
Live real-provider tool continuation on the lease: baseline terminal/replay digests differed from the successful transcript commit; candidate terminal, committed, and replay digests agreed across nine observed reasoning records, with all canonicalization/encrypted-preservation checks true. Both turns executed
execand returnedSIGNATURE_CONTINUATION_OK. Temporary probes printed only booleans and digests and were removed from source afterward. The candidate fixture initially reused a session label and was refused before inference; the corrected fresh-session probe passed.After the main rebase, the uninstrumented source passed all 152 tests across four whole files, including the reasoning-signature sibling suite. The changed runtime file passed 42 tests in 45.49 s wall (
node scripts/run-vitest.mjs src/gateway/worker-environments/inference-runtime.test.ts --maxWorkers=1), including cold compiled-worker preparation; the new case itself uses the existing runtime fixture and adds no process boots or real timers. The remaining three files passed 110 tests in 17.42 s wall. Core types passed again. The first two-graph type invocation used noncanonical graph names and was refused before checking; the correctedcore-test-gateway-otherandcore-test-agents-rootchecks passed in 13.0 s and 12.7 s. Final formatting passed, probes were absent, and the two changed production source hashes matched the reviewed checkout.A patch-identical publication rebase onto
063685e96d00leaves the affected owners and dependency pins unchanged; the paired measurements above retain their exact tested revisions. Exact-head CI run 37121646338 completed successfully, includingopenclaw/ci-gate. The changed runtime suite passed all 42 cases in 33.58 s on hosted shardagentic-gateway-core-1-hosted-3; its containing job completed in 94 s, including setup and other shard work. No CI reruns were needed.