Skip to content

fix(code-mode): keep truncation counts tied to original output - #132850

Merged
steipete merged 1 commit into
mainfrom
steipete/code-mode-output-provenance-b4970f
Aug 29, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/code-mode-output-provenance-b4970f

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Closes #132575 — Code Mode truncation lost original output provenance.

AI-assisted maintainer repair. Maintainers can push to this organization-owned branch.

What Problem This Solves

Fixes an issue where Code Mode runs emitting large output across exec/wait or headless bridge steps could receive a truncation of an earlier marker instead of their original output. The cell could complete successfully and respect its byte cap while returning the wrong prefix and omittedBytes. Final-value allocation had the same repeated-projection problem.

The same output ownership also lost already-accepted output on later host failures and allowed abort/restart diagnostics to exceed the shared output budget.

Why This Change Was Made

The existing JSON owner now retains bounded original normalized JSON and its original byte size, with one cumulative output state and delivery receipt across worker legs. Workers transfer bounded source rather than public markers; interactive and headless paths append each disjoint leg once and project only when returning results, removing the destructive re-bounding and delivered-array reset/slice paths.

This preserves the successful-partial-result behavior of the earlier bounded-output repair, authored and merged by @steipete on 2026-08-13, while fixing its repeated-projection structure. Stable-release reachability was not established; the reproduction and comparison are source-checkout evidence.

User Impact

Code Mode's own truncation reports an actual prefix of the original normalized JSON and a matching omitted-byte count across waits, final-value allocation, and headless execution. Accepted output survives later failures; terminal diagnostics share the existing byte budget. Ordinary output remains incremental, identical cumulative summaries are suppressed, and changed totals or final reservations can produce replacement summaries rather than new guest executions.

Successful partial results stay successful. Cancellation, approval/replay authority, conversion semantics, existing byte caps, and generic model-context guards are unchanged. No new configuration, schema, storage, dependency, or compatibility path. Retained source is bounded to one byte budget per output/value channel; this is not a whole-message, snapshot, or process-RSS bound.

Evidence

Real Gateway and Control UI

The normal New Session → Start flow created the session through the UI's actual sessions.create, then drove the compiled Gateway and real QuickJS worker. Actual provider-bound calls/results, exact arguments, one exec/one wait, Responses ID normalization, public chat.history, and chat.message.get were checked independently. The normal tool-details panel was opened and its parsed result compared too.

This uses deterministic AIMock, not an authenticated provider or an uncoached model. Node 26.8.1, QuickJS-WASI 3.5.0, AIMock 1.39.0, and Playwright 1.62.1. Each successful case has three target requests, one session-title request, and the observed number of embedding requests; final accounting happens after the Gateway, mock, and callbacks settle. No auth/SSRF bypass, generic-result-guard override, app-state injection, or operator service/state was used.

Observed case Original UTF-8 bytes Prefix bytes Reported omitted Original minus prefix Original prefix? Output + value
Original 1 KiB case, before 1,093 870 153 223 No; marker of marker 1,023 / 1,024
Same case, after 1,093 896 197 197 Yes 1,023 / 1,024
Additional default-dense case, after 72,053 65,408 6,645 6,645 Yes 65,536 / 65,536

All three measured cells completed with value: true. Provider, history, and full-message text matched byte for byte in each measured case. The default-dense case has no output-limit override: 9,000 lobster characters and 12,000 Euro symbols across a yield. Its full formatted result was 65,944 UTF-8 bytes / 28,372 UTF-16 units, fitting the unchanged general text guard. The original small program is unchanged from the issue.

Before:

Before: incorrect 153 omitted bytes versus 223 expected, and a marker-of-marker prefix

After:

After: original prefix and matching 197 omitted bytes, with one exec and one wait

Default byte budget, additional after-proof:

Default 64 KiB byte budget: 72053 original bytes, 65408 prefix bytes, and 6645 omitted bytes

Inspected before/after recordings

Before:

code-mode-output-before.mp4

After:

code-mode-output-after.mp4

The final seconds show intentional teardown of the isolated Gateway. Every original screenshot and recording was inspected; the MP4 conversions were also inspected. A viewport is not proof of every output byte—the provider/public-API comparisons and independent arithmetic supply that proof.

Regression and source binding

  • 1,009 tests across 37 files passed on Node 26.8.1: Code Mode families including hyphenated runtime/worker/headless tests, catalog lifetime, replay, swarms, Cron triggers, and Copilot bridges.
  • 171 focused tests across five files passed again after restoring the exact candidate source and archived runtime build.
  • The exact preserved original regression corpus was rerun against the ten pre-fix production owners on Node 26.8.1: 12 intended failures, 73 skipped. Failures covered original-prefix corruption, lost accepted output, and diagnostic budget overruns—not setup failures or timeouts.
  • Full changed gate, targeted lint, and type graphs passed on Node 26.7.0. Candidate and controlled-baseline normal builds passed on Node 26.8.1, with no ineffective-dynamic-import diagnostics. The older gate is not relabeled as a newer-runtime run.
  • Fresh post-proof Codex autoreview: no accepted/actionable P0 findings. This was a P0-only review; the reviewer did not execute the tests.

The live candidate was built from 6b27585471a7c0133fbdb7b43830f0366e0e417b plus the uncommitted repair. All 20 committed file contents were verified byte-identical to that frozen candidate in f273b0a5f67fe34448e87a8d257affad42f61a54; build metadata is not relabeled. The controlled baseline restored only the ten production owners, retaining candidate tests/docs. All 12,129 archived candidate distribution files were checked during restoration. All runs recorded source/dependency identity and cleaned their owned processes and temporary state.

Local validation commands

The repository entrypoints below ran through task-owned isolated HOME/state/config/temp wrappers, with an explicit Node pin, CI=1, one Vitest worker, and disabled Vitest filesystem/tsx caches. Checks used pnpm's existing copy import mode for disposable tooling. No repository dependency/configuration was changed for this.

Full selected family (Node 26.8.1, passed):

node scripts/run-vitest.mjs \
  src/agents/code-mode-deadline.test.ts \
  src/agents/code-mode-headless.cancellation.test.ts \
  src/agents/code-mode-headless.test.ts \
  src/agents/code-mode-headless.validation.test.ts \
  src/agents/code-mode-namespaces.test.ts \
  src/agents/code-mode-nodes.test.ts \
  src/agents/code-mode-runtime.test.ts \
  src/agents/code-mode-shell-source.test.ts \
  src/agents/code-mode-swarm.test.ts \
  src/agents/code-mode-worker-lifecycle.test.ts \
  src/agents/code-mode.agent-loop.test.ts \
  src/agents/code-mode.bridge.host-denial.test.ts \
  src/agents/code-mode.bridge.lifecycle.test.ts \
  src/agents/code-mode.bridge.test.ts \
  src/agents/code-mode.catalog-lifetime.test.ts \
  src/agents/code-mode.config.test.ts \
  src/agents/code-mode.guest-source.test.ts \
  src/agents/code-mode.guest.test.ts \
  src/agents/code-mode.limits.test.ts \
  src/agents/code-mode.mcp.test.ts \
  src/agents/code-mode.output.test.ts \
  src/agents/code-mode.preflight-repair.test.ts \
  src/agents/code-mode.rejections.test.ts \
  src/agents/code-mode.replay.test.ts \
  src/agents/code-mode.search.test.ts \
  src/agents/code-mode.skills.test.ts \
  src/agents/code-mode.test.ts \
  src/agents/code-mode.typescript.test.ts \
  src/agents/code-mode.wait.test.ts \
  src/agents/embedded-agent-runner/run/code-mode-outcome.test.ts \
  src/agents/embedded-agent-runner/run/code-mode-reconciliation.test.ts \
  src/agents/harness/tool-surface-bridge.test.ts \
  src/cron/trigger-script.test.ts \
  src/cron/trigger-script.preparation.test.ts \
  src/cron/service.trigger-eval.test.ts \
  extensions/copilot/src/catalog-lifetime.test.ts \
  extensions/copilot/src/tool-bridge.test.ts

Restored candidate sanity (Node 26.8.1, passed):

node scripts/run-vitest.mjs src/agents/code-mode.output.test.ts src/agents/code-mode.limits.test.ts src/agents/code-mode.rejections.test.ts src/agents/code-mode-runtime.test.ts src/agents/code-mode.test.ts

Preserved pre-fix corpus (Node 26.8.1, expected 12 failures):

node scripts/run-vitest.mjs src/agents/code-mode.limits.test.ts src/agents/code-mode-headless.test.ts -t 'bounds cumulative original|preserves accepted inline|shares the output budget|bounds original output'

Full changed gate (Node 26.7.0, passed):

node scripts/check-changed.mjs \
  --base \
  6b27585471a7c0133fbdb7b43830f0366e0e417b \
  -- \
  docs/tools/code-mode.md \
  src/agents/code-mode-bridge.ts \
  src/agents/code-mode-execution.ts \
  src/agents/code-mode-headless.test.ts \
  src/agents/code-mode-headless.ts \
  src/agents/code-mode-json.ts \
  src/agents/code-mode-runtime.test.ts \
  src/agents/code-mode-runtime.ts \
  src/agents/code-mode-state.ts \
  src/agents/code-mode-swarm.test.ts \
  src/agents/code-mode-worker-lifecycle.test.ts \
  src/agents/code-mode-worker-types.ts \
  src/agents/code-mode-worker.ts \
  src/agents/code-mode.limits.test.ts \
  src/agents/code-mode.rejections.test.ts \
  src/agents/code-mode.test-support.ts \
  src/agents/code-mode.ts \
  src/agents/code-mode.wait.test.ts \
  src/agents/code-mode.worker.ts \
  src/agents/code-mode.output.test.ts

Final targeted lint (Node 26.7.0, passed):

node scripts/run-oxlint.mjs --tsconfig config/tsconfig/oxlint.core.json src/agents/code-mode.test-support.ts src/agents/code-mode.output.test.ts src/agents/code-mode.ts

Final test type graph (Node 26.7.0, passed):

node scripts/run-tsgo.mjs -b test/tsconfig/tsconfig.core.test.agents-root.json --builders 1

Candidate and controlled baseline builds (Node 26.8.1, passed):

pnpm build

Explicit limitations and follow-up

The issue's original default-budget accented-character input also crosses the existing 32,000 weighted-text-unit guard at 128k model context. Its provider-facing wait text was not JSON, so that fixture failed before certifying provenance. The new Euro-symbol default-dense case is additional byte-invariant isolation, not a pass for that original composition case. General text clipping remains enabled and unchanged. A separate follow-up assesses whether Code Mode needs a negotiated, parseable-envelope contract at that boundary; this PR does not claim to solve it or infer lost status/value from invalid JSON.

The large-case Gateway before measurement was not completed: one baseline attempt never reached listening, and the one fresh attempt hit the normal UI's Gateway-changed protection during the already-proven small case. Neither guard was bypassed. Thus complete real before/after proof is the original 1 KiB case; default-budget owner-level failing/passing regressions and large-case after-proof are reported separately. Earlier collector-assumption failures and both baseline failures were retained rather than presented as passes.

LOC category Added Removed Net
Production 216 217 −1
Tests 567 224 +343
Test support 33 0 +33
Docs 10 4 +6

Test counts include moved coverage from the prior wait/headless suites. Proof media, generated builds, and local drivers are not committed. CI on the published head will be recorded before native prepare/merge.

Retain bounded original normalized JSON through worker legs and headless execution instead of truncating earlier markers. Preserve accepted output on later failures and share the output budget with terminal diagnostics.

Fixes #132575.
@clawsweeper

clawsweeper Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation agents Agent runtime and tooling size: XL maintainer Maintainer-authored PR labels Aug 29, 2026
@steipete
steipete marked this pull request as ready for review August 29, 2026 21:09
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. 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 Aug 29, 2026
@clawsweeper

clawsweeper Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 29, 2026, 5:16 PM ET / 21:16 UTC.

ClawSweeper review

What this changes

The PR replaces repeated public truncation projections with retained normalized JSON source so Code Mode reports correct prefixes and omitted-byte counts across exec, wait, and headless runs.

Regression provenance

Possible regression — probable (reproduction; reviewed change; known regression link). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

Keep open. This is a focused repair for a current Code Mode regression; the new single output-state owner preserves source provenance across worker legs without a blocking correctness or security finding.

Priority: P1
Reviewed head: f273b0a5f67fe34448e87a8d257affad42f61a54

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused owner-boundary repair with substantial regression coverage and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: Not applicable to the contributor-proof gate because Repository State identifies the author as a MEMBER; the captured PR body nevertheless records before/after real Gateway and Control UI evidence for the changed worker-to-result path.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Not applicable to the contributor-proof gate because Repository State identifies the author as a MEMBER; the captured PR body nevertheless records before/after real Gateway and Control UI evidence for the changed worker-to-result path.
Evidence reviewed 5 items Current-owner repair: The worker captures normalized output/value source before public projection, while the shared state appends each leg and projects only at delivery; this removes the marker-as-new-source path.
Interactive and suspended callers: The exec path creates one output state, appends every worker result, and uses that same instance through parked snapshots and resumed waits.
Regression coverage: Focused cases cover original-prefix accounting at 1 KiB and default limits, final values, cumulative errors, literal marker-shaped data, interactive waits, and headless execution.
Findings None None.
Security None None.

How this fits together

Code Mode runs guest JavaScript in a QuickJS worker and returns incremental output through exec and wait controls. Worker-leg output is accumulated by the host before becoming model-visible tool results.

flowchart LR
A[Guest Code Mode program] --> B[QuickJS worker]
B --> C[Bounded normalized output source]
C --> D[Cumulative output state]
D --> E[Exec or wait result]
E --> F[Model-visible output and value]
Loading

Before merge

  • Complete next step (P2) - No repair lane is needed: this maintainer-owned PR has no identified actionable defect and should proceed through normal exact-head review and checks.
Agent review details

Security

None.

PR surface

Source +32, Tests +343, Docs +6. Total +381 across 20 files.

View PR surface stats
Area Files Added Removed Net
Source 11 249 217 +32
Tests 8 567 224 +343
Docs 1 10 4 +6
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 20 826 445 +381

Review metrics

Metric Value Why it matters
Production versus test delta production -1, tests +376, docs +6 The bug fix consolidates production ownership while adding focused regression coverage for worker, wait, and headless paths.

Stored data model

Persistent data-model change detected: serialized state: src/agents/code-mode-json.ts, serialized state: src/agents/code-mode.test-support.ts, unknown-data-model-change: src/agents/code-mode-json.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #132575
Summary: This PR is the concrete candidate repair for the open source-reproduced Code Mode provenance bug.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Retain the single cumulative source-and-delivery owner, with the new interactive and headless regression cases guarding original-prefix accounting before normal exact-head merge gates complete.

Do we have a high-confidence way to reproduce the issue?

Yes, at source level: the linked issue supplies a concrete exec/wait and headless scenario, and the branch adds direct regression coverage, though this read-only review did not execute it.

Is this the best way to solve the issue?

Yes. Retaining normalized source at the worker boundary and projecting only at the cumulative delivery owner fixes the repeated-projection invariant rather than compensating after a marker is already emitted.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against d3c07b02e244.

Labels

Label changes:

  • add P1: This repairs incorrect model-visible partial output across interactive and headless Code Mode runs.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Not applicable to the contributor-proof gate because Repository State identifies the author as a MEMBER; the captured PR body nevertheless records before/after real Gateway and Control UI evidence for the changed worker-to-result path.

Label justifications:

  • P1: This repairs incorrect model-visible partial output across interactive and headless Code Mode runs.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Not applicable to the contributor-proof gate because Repository State identifies the author as a MEMBER; the captured PR body nevertheless records before/after real Gateway and Control UI evidence for the changed worker-to-result path.

Evidence

What I checked:

  • Current-owner repair: The worker captures normalized output/value source before public projection, while the shared state appends each leg and projects only at delivery; this removes the marker-as-new-source path. (src/agents/code-mode-json.ts:136, f273b0a5f67f)
  • Interactive and suspended callers: The exec path creates one output state, appends every worker result, and uses that same instance through parked snapshots and resumed waits. (src/agents/code-mode-execution.ts:102, f273b0a5f67f)
  • Regression coverage: Focused cases cover original-prefix accounting at 1 KiB and default limits, final values, cumulative errors, literal marker-shaped data, interactive waits, and headless execution. (src/agents/code-mode.output.test.ts:25, f273b0a5f67f)
  • Feature history: History shows the earlier bounded-output implementation in the same Code Mode path, and the linked merged PR documents the original successful-partial-result contract this repair retains. (src/agents/code-mode-json.ts:73, e6ca5266afe1)
  • Current-main comparison: The verified test merge applies this branch after current main; its affected Code Mode owner files are the same repair surface, rather than unrelated endpoint drift. (src/agents/code-mode-json.ts:130, 23a435338dcd)

Likely related people:

  • steipete: 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.

@steipete

Copy link
Copy Markdown
Contributor Author

Pre-merge verification for f273b0a5f67fe34448e87a8d257affad42f61a54:

Exact-head CI run 33275339573, attempt 1, completed successfully. The earlier draft-skipped run is not counted as proof. The repository CI watcher finished GREEN.

The repair keeps original normalized JSON at the worker boundary and one cumulative source/delivery owner through exec, wait, and headless execution, rather than truncating an already-public marker. The existing byte cap and successful partial-result semantics remain. Production is +216/−217 (net −1); tests and test support are net +376, docs net +6.

Verification already recorded in the PR's Evidence section: 1,009 tests across 37 files on Node 26.8.1; 171 focused tests passed again after exact candidate restoration; the preserved pre-fix corpus produced 12 intended failures. Candidate and controlled-baseline builds passed on Node 26.8.1. Changed gates, lint, and type graphs passed on Node 26.7.0, not relabeled as newer-runtime proof. Fresh post-proof Codex autoreview found no actionable P0 issues; its scope was P0-only and the reviewer did not run tests.

Key local entrypoints (the PR body contains the full 37-file selection, isolated-wrapper conditions, and other exact commands):

node scripts/run-vitest.mjs src/agents/code-mode.output.test.ts src/agents/code-mode.limits.test.ts src/agents/code-mode.rejections.test.ts src/agents/code-mode-runtime.test.ts src/agents/code-mode.test.ts
node scripts/run-vitest.mjs src/agents/code-mode.limits.test.ts src/agents/code-mode-headless.test.ts -t 'bounds cumulative original|preserves accepted inline|shares the output budget|bounds original output'

The second command is the intentionally failing preserved pre-fix run, not a candidate failure.

pnpm build

Real compiled Gateway/QuickJS and normal Control UI before/after proof establishes the original 1 KiB defect and its repair: before, the prefix was not original and reported 153 omitted bytes instead of 223; after, the prefix is original and reports exactly 197 omitted bytes. The additional default-dense after-case reaches the unchanged 65,536-byte shared cap and reports exactly 6,645 omitted bytes. Actual provider/history/full-message bytes agree, with one exec and one wait per measured case. This is deterministic AIMock proof, not an authenticated provider or uncoached model. Inspected screenshots and recordings are attached above.

ClawSweeper's latest review identifies no actionable defect and asks for the normal exact-head checks. Those are green. Its stored-data-model heuristic does not identify a persistent migration here: CodeModeRunState.output is held in the process-local activeRuns Map, and the new source shape crosses only this build's worker-thread result boundary. QuickJS snapshot bytes remain process-local and unchanged; no database, persisted transcript schema, external protocol, or upgrade reader changes. See the run-state owner, snapshot parking, and worker result types.

The documented gaps remain: the original accented-character default case is still clipped by the separate generic 32,000-weighted-unit context guard; the Euro fixture does not claim to fix that composition. Large-case Gateway before-proof was blocked by startup/UI admission failures, with no guard bypass or indefinite retries. Complete real before/after proof is the original small case; default-limit owner regressions and large after-proof are separate evidence. The context-envelope contract is a named follow-up, not part of this repair.

@steipete
steipete merged commit caec188 into main Aug 29, 2026
310 checks passed
@steipete
steipete deleted the steipete/code-mode-output-provenance-b4970f branch August 29, 2026 21:36
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 30, 2026
…law#132850)

Retain bounded original normalized JSON through worker legs and headless execution instead of truncating earlier markers. Preserve accepted output on later failures and share the output budget with terminal diagnostics.

Fixes openclaw#132575.
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 maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XL 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.

[Bug]: Code Mode re-truncates markers instead of preserving original output provenance

1 participant