fix: keep inter-session provenance out of transcripts#83755
Conversation
|
Codex review: needs maintainer review before merge. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. source-reproducible: current main annotates transcript prompt bodies with PR rating Rank-up moves:
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. PR egg Rarity: 🥚 common. What is this egg doing here?
Real behavior proof Risk before merge
Maintainer options:
Next step before merge Security Review detailsBest possible solution: Land the narrow transcript cleanup after maintainer approval and CI, keeping model-facing provenance in hidden runtime context while tracking broader external-channel delivery problems separately. Do we have a high-confidence way to reproduce the issue? Yes, source-reproducible: current main annotates transcript prompt bodies with Is this the best way to solve the issue? Yes, the patch targets the two transcript prompt sources while leaving model-facing prompts annotated through the existing runtime-context split. The remaining question is maintainer comfort with the supplied proof scope, not a different implementation shape. Label justifications:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against b2c5ba6d4c4e. |
…k / continue_delegate / request_compaction) This is the continuation feature presented in full against current upstream/main. Per upstream's stated cadence canon this is XL; opened as DRAFT for review-quality engagement. Cure-(20) restores additional cure-substrate-original orphans surfaced by impacted-vitest integrity-check + cascade-fixes substrate-internal test consistency surfaced by full-vitest: - Restore src/flows/doctor-repair-flow.ts + .test.ts + src/commands/doctor-session-snapshots.ts + .test.ts (4 files deleted in cure-substrate) plus 4 hunks in src/flows/doctor-health-contributions.ts (runStructuredHealthRepairs + runSessionSnapshotsHealth functions + 2 contribution registrations). Restored from upstream parent bytes (orthogonal to continuation surface; 0 continuation-keyword hits). - Cascade-fix src/agents/subagent-registry.test.ts: add resolveSessionStoreEntry to vi.mock for ../config/sessions.js (cure-(17) family cascade-miss: cure added the call at subagent-registry-helpers.ts:79+102, test mock wasn't updated) + invert/rename the "preserves run-mode keep entries past SESSION_RUN_TTL_MS sweep" test assertion to match the cure's intentional cleanupCompletedAt-based deferred-cleanup-sweep policy for continue_delegate lifecycle. Drift-rebased onto fresh upstream/main 721ad15 (absorbs 2 new upstream commits since cure-(19) parent: fix(outbound): resolve send-capable channel registry openclaw#83733 + fix: keep inter-session provenance out of transcripts openclaw#83755 — both orthogonal to orphan-restore scope). Co-Authored-By: scribe.dandelion.cult <scribe.dandelion.cult@hotmail.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…k / continue_delegate / request_compaction) This is the continuation feature presented in full against current upstream/main. Per upstream's stated cadence canon this is XL; opened as DRAFT for review-quality engagement. Cure-(20)v3 = drift + 2 substrate-restores + 2 surgical test-cascade-fixes: - Class-1 drift-rebase onto upstream/main d124c5a (3 commits beyond cure-(19)'s parent 424c6d0: fix(outbound): resolve send-capable channel registry openclaw#83733, fix: keep inter-session provenance out of transcripts openclaw#83755, fix(cli): fix flaky config set help text test caused by env var leakage and word wrapping openclaw#83423 — all orthogonal to orphan-restore + cascade-fix scope) - Class-2 cure-substrate-original revert restoring 4 deleted files + 1 modified file: src/flows/doctor-repair-flow.{ts,test.ts}, src/commands/doctor-session-snapshots.{ts,test.ts}, src/flows/doctor-health-contributions.ts (4 hunks). All orthogonal to continuation surface (0 keyword hits). Caught by local impacted-vitest after cure-(19) Class-2 revert of src/config/io.ts. - Class-3 cascade-fix in src/agents/subagent-registry.test.ts (test substrate only; runtime unchanged): added resolveSessionStoreEntry mock (cure-(17) family cascade-miss for cure's added call at subagent-registry-helpers.ts:79+102) + renamed/inverted the "preserves run-mode keep entries past SESSION_RUN_TTL_MS sweep" test to "sweeps...after cleanup completes" with expect(run).toBeUndefined() matching cure's intentional cleanupCompletedAt-based deferred- cleanup-sweep policy for continue_delegate lifecycle (cohort byte-walks at Discord 1506039161 + 1506039225 + 1506039263 confirmed cure-behavior IS correct continuation-feature substrate). Co-Authored-By: scribe.dandelion.cult <scribe.dandelion.cult@hotmail.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>


Summary
Verification
OPENCLAW_VITEST_MAX_WORKERS=1 node scripts/run-vitest.mjs src/auto-reply/reply.raw-body.test.ts src/auto-reply/reply/prompt-prelude.test.ts src/auto-reply/reply/get-reply-run.media-only.test.ts src/agents/pi-embedded-runner/run/runtime-context-prompt.test.ts src/agents/pi-embedded-runner/run/attempt.spawn-workspace.context-engine.test.tsgit diff --check origin/main..HEADAUTOREVIEW_AUTO_TESTS=0 .agents/skills/autoreview/scripts/autoreview --mode localReal behavior proof
Behavior addressed: Inter-session messages routed into a Control UI/webchat session were persisted with model-facing provenance text such as
[Inter-session message] ... isUser=false, so the Control UI rendered internal safety context in the visible chat transcript.Real environment tested: Local OpenClaw source checkout, disposable
OPENCLAW_HOMEdirectories, real Control UI in the in-app browser, gateway instances bound to loopback, and a fake OpenAI-compatible local provider used only to make model turns deterministic.Exact steps or command run after this patch: Started the patched gateway with a disposable home and local fake provider, opened the actual Control UI, approved browser pairing, sent a baseline UI message, then sent an inter-session/provenance-shaped message through
chat.sendwithsystemInputProvenance.kind = "inter_session". Captured the fake provider request body to verify model-facing prompt contents, and queriedchat.historyto verify the visible transcript contents.Evidence after fix: The captured model request still contained
[Inter-session message] sourceSession=agent:dev:source-control-ui sourceChannel=webchat sourceTool=sessions_send isUser=falseand the clean test message.chat.historycontained the clean user message and did not contain[Inter-session message].Observed result after fix: The model still receives the provenance/safety context, while Control UI renders only the clean user-visible message text in the chat transcript.
What was not tested: Live external channels such as WhatsApp/Discord were not rerun for this patch; the repro used the gateway/Control UI path plus a deterministic local provider. Full release/CI suites were not run locally.