Skip to content

fix: node continuation signatures diverge from transcripts - #164287

Merged
steipete merged 1 commit into
mainfrom
codex/node-parity-r3-signature
Oct 3, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/node-parity-r3-signature

Conversation

@steipete

@steipete steipete commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

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

  • Whole-file negative control: the new regression fails only on raw versus canonical signature bytes; all 41 existing cases pass (19.94 s wall). The affected original production owners are byte-identical on the inspected main baseline independently of the policy-gate repair.
  • Three owner/sibling files passed 150 tests on the isolated AWS lease: inference runtime, inference manager, and transcript redaction (43.36 s wall combined). The regression also verifies preserved ciphertext and tool arguments, untouched provider input, and unchanged approved history on a second inference request.
  • Indexed call-count/order fixtures were searched across the repository; this change alters no existing call sequence or count.
  • Independent Codex local and final branch autoreviews: no actionable P0–P2 findings.

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 c81d86e82f60 versus candidate fb316762581f; medians exclude turn 0. Measurements use uninstrumented builds. All values are milliseconds.

Revision Local first delta / final / tail Node first delta / final / tail
Baseline 1404 / 1556 / 173 1586 / 2046 / 560
Candidate 1567 / 1744 / 177 1417 / 1963 / 563

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 exec and returned SIGNATURE_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 corrected core-test-gateway-other and core-test-agents-root checks 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 063685e96d00 leaves the affected owners and dependency pins unchanged; the paired measurements above retain their exact tested revisions. Exact-head CI run 37121646338 completed successfully, including openclaw/ci-gate. The changed runtime suite passed all 42 cases in 33.58 s on hosted shard agentic-gateway-core-1-hosted-3; its containing job completed in 94 s, including setup and other shard work. No CI reruns were needed.

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.
@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation gateway Gateway runtime agents Agent runtime and tooling size: S labels Oct 3, 2026
@steipete
steipete marked this pull request as ready for review October 3, 2026 12:03
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: b7dc8ad3902019b89530383113edb86ec19c3281
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/transcript-redact.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.

Carefully review these changes before merging.

@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 3, 2026
@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed October 3, 2026, 8:18 AM ET / 12:18 UTC (Revision 2).

ClawSweeper review

What this changes

The 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
Reviewed head: b7dc8ad3902019b89530383113edb86ec19c3281

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, maintainable repair with relevant real-provider evidence, baseline regression coverage, and no actionable findings.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (live_output): The captured isolated AWS real-provider continuation exercised Gateway terminal output, transcript commit, and subsequent replay, reporting matching candidate digests across nine reasoning records and successful exec continuation. Regression and reader inspection support existing-state compatibility: the persisted envelope is unchanged and old history remains untouched.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (live_output): The captured isolated AWS real-provider continuation exercised Gateway terminal output, transcript commit, and subsequent replay, reporting matching candidate digests across nine reasoning records and successful exec continuation. Regression and reader inspection support existing-state compatibility: the persisted envelope is unchanged and old history remains untouched.
Evidence reviewed 7 items Pinned introduction: The introduced delta adds the existing sanitizer to terminal projection and moves route eligibility into that sanitizer; it introduces no alternative canonicalizer or historical rewrite.
Still necessary on main: Fetched main projects assistant content directly without signature canonicalization. Inspection of v2026.9.8 shows the same missing integration; neither inspected version supplies this repair.
Existing reader compatibility: Responses replay parses reasoning signatures as JSON and accepts reasoning items. The patch preserves the existing persisted envelope and ciphertext, changing when fresh output adopts that envelope rather than changing the stored-data contract.
Findings None None.
Security None None.

How this fits together

The 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
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +8, Tests +68, Docs +4. Total +80 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 2 12 4 +8
Tests 1 68 0 +68
Docs 1 4 0 +4
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 84 4 +80

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: This is a bounded worker/transcript consistency repair; baseline continuation succeeded and no urgent provider failure is established.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (live_output): The captured isolated AWS real-provider continuation exercised Gateway terminal output, transcript commit, and subsequent replay, reporting matching candidate digests across nine reasoning records and successful exec continuation. Regression and reader inspection support existing-state compatibility: the persisted envelope is unchanged and old history remains untouched.
  • proof: sufficient: Contributor real behavior proof is sufficient. The captured isolated AWS real-provider continuation exercised Gateway terminal output, transcript commit, and subsequent replay, reporting matching candidate digests across nine reasoning records and successful exec continuation. Regression and reader inspection support existing-state compatibility: the persisted envelope is unchanged and old history remains untouched.

Evidence

What I checked:

  • Pinned introduction: The introduced delta adds the existing sanitizer to terminal projection and moves route eligibility into that sanitizer; it introduces no alternative canonicalizer or historical rewrite. (src/gateway/worker-environments/inference-terminal-message.ts:56, b7dc8ad39020)
  • Still necessary on main: Fetched main projects assistant content directly without signature canonicalization. Inspection of v2026.9.8 shows the same missing integration; neither inspected version supplies this repair. (src/gateway/worker-environments/inference-terminal-message.ts:55, a38eefeebae5)
  • Existing reader compatibility: Responses replay parses reasoning signatures as JSON and accepts reasoning items. The patch preserves the existing persisted envelope and ciphertext, changing when fresh output adopts that envelope rather than changing the stored-data contract. (packages/ai/src/transports/openai-responses-replay-messages-internal.ts:447, b7dc8ad39020)
  • Regression boundary: The new executor regression independently specifies canonical signature bytes and checks ciphertext, tool arguments, provider-input immutability, and unchanged approved history during a second inference. The captured body reports its baseline failure and 152 passing owner/sibling tests after the repair; no tests were executed during this read-only review. (src/gateway/worker-environments/inference-runtime.test.ts:527, b7dc8ad39020)
  • Real-provider continuation evidence: The complete captured PR body reports an isolated AWS real-provider tool continuation: baseline terminal/replay digests differed from committed signatures, while candidate terminal, committed, and replay digests agreed across nine reasoning records with encrypted preservation checks true. Both turns executed exec and returned SIGNATURE_CONTINUATION_OK. Tested revisions were c81d86e and fb316762581f; the body records patch-identical rebases and unchanged affected owners through publication. Captured context sourceRevision: c3b4423d1e7a3d3df4744fc72f48779d3fcc2d25ff1b78feca43169cfa1a9d46. (b7dc8ad39020)
  • Merged area history: GitHub commit metadata identifies steipete for the prior terminal-projection refactor and yashas-13 for the merged reasoning-ciphertext preservation repair. These support routing without attributing this defect to either person. Local line-blame inspection could not complete because historical blobs were unavailable; no introduction claim relies on it. (src/agents/transcript-redact.ts:388, 92b27867ca08)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • yashas-13: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-03T12:09:10.893Z sha b7dc8ad :: needs maintainer review before merge. :: none

@steipete
steipete merged commit 56480f8 into main Oct 3, 2026
203 of 205 checks passed
@steipete
steipete deleted the codex/node-parity-r3-signature branch October 3, 2026 12:33
@steipete

steipete commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Oct 3, 2026
* 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)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 4, 2026
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security-sensitive-changed size: S status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant