Skip to content

fix: keep private yield context out of chat output - #139801

Merged
obviyus merged 3 commits into
mainfrom
repair/pr-139254
Sep 6, 2026
Merged

obviyus merged 3 commits into
mainfrom
repair/pr-139254

Conversation

@obviyus

@obviyus obviyus commented Sep 6, 2026 •

Copy link
Copy Markdown
Collaborator

Supersedes #139254, preserving the fix and authorship from @Colton-Harris. Related: #25592, #125106.

What Problem This Solves

The successful child-yield tool result repeated private continuation context, which full verbosity could send to chat. Public history could expose its input, and native child completion could resume without that context.

Why This Change Was Made

The shared result producer omits the private field. Native yield settlement writes one hidden context entry through the existing session owner with current-run and writer checks. Public history removes the private argument from display copies while retaining original private input and diagnostic provenance.

User Impact

Users receive optional waiting acknowledgement and normal status. The parent receives private context once after child completion. Existing verbosity, empty acknowledgement, and missing-owned-child behavior remain intact.

Consumers: yield results, public history, and native parent continuation now separate private context from public output.

Evidence

A real Telegram child/yield/resume cycle reproduced disclosure. Candidate embedded and native cycles verified hidden context reaches the first resumed input once and stays out of public output. Baseline comparisons covered verbosity modes. All 629 focused tests passed, including regressions and stale-writer/revoked-settlement checks. Native bridge checks used its upstream contract and isolated fixtures without production data.

@obviyus obviyus self-assigned this Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 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 extensions: codex plugin: file-transfer size: M maintainer Maintainer-authored PR labels Sep 6, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. 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 Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 1:48 AM ET / 05:48 UTC.

ClawSweeper review

What this changes

The PR removes private yield context from tool results and public history while retaining it in hidden session context for native continuation.

Merge readiness

✅ Ready for maintainer review

This remains a useful, focused privacy repair: current main and the latest release still expose the private yield message in successful tool results. No concrete introduced correctness defect was found, and the maintainer-owned replacement preserves the original contribution.

Priority: P1
Reviewed head: 8861e66408ff93d868b7590e40c7649907bcb0bf

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused repair with meaningful lifecycle and privacy regressions, matching dependency source, and no identified blocking defect.
Proof confidence 🌊 off-meta tidepool Not applicable: The repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Its captured body reports embedded and native child/yield/resume validation with private output excluded; raw traces were not independently inspected.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Its captured body reports embedded and native child/yield/resume validation with private output excluded; raw traces were not independently inspected.
Evidence reviewed 9 items Current main still contains the disclosure: The schema describes message as private, but the successful result still includes it. The shared jsonResult helper serializes that payload into returned text as well as details.
Latest-release check: The supplied latest release, v2026.9.2, also returns the private message in the successful yield result; the repair is not already shipped there.
Existing privacy contract: The documented contract distinguishes private resumed-turn context from an optional public waiting acknowledgment; this is an existing-behavior repair.
Findings None None.
Security None None.

How this fits together

Agents use sessions_yield to pause while awaiting child results. OpenClaw separates the private resume context from the acknowledgment and tool status delivered to chat.

flowchart TD
  A[Agent yields with private context] --> B[Yield lifecycle owner]
  B --> C[Public status and acknowledgment]
  C --> D[Chat output]
  B --> E[Successful settlement and writer checks]
  E --> F[Hidden session context]
  F --> G[Resumed parent agent]
  A --> H[Filtered public history]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +68, Tests +166, Docs +2. Total +236 across 18 files.

View PR surface stats
Area Files Added Removed Net
Source 9 88 20 +68
Tests 8 241 75 +166
Docs 1 2 0 +2
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 18 331 95 +236

Review metrics

Metric Value Why it matters
Production and regression coverage Production net +68 lines; tests net +166 lines Production growth supports native context retention and display privacy while reusing the existing storage representation and writer.

Root-cause cluster

Relationship: canonical
Canonical: #139801
Summary: This maintainer-owned replacement incorporates the original producer repair and adds native retention and public-history protection; the broader narration issue remains distinct.

Members:

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

Technical review

Best possible solution:

Keep public yield results limited to status and acknowledgment, with private resume context retained through the existing fenced transcript writer and filtered only in display copies.

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

Yes: the current producer serializes private message text into the successful result consumed by full-verbosity output. This review verified the source path without executing a reproduction.

Is this the best way to solve the issue?

Yes: removing the echo at its producer and preserving native continuation through the existing hidden transcript representation repairs the documented contract without changing verbosity preferences.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 55000bcc08aa.

Labels

Label changes:

  • add P1: The existing private-context contract is violated by full-verbosity chat output in current main and the latest release.
  • 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: The repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Its captured body reports embedded and native child/yield/resume validation with private output excluded; raw traces were not independently inspected.
  • add proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. Removing private text from full-verbosity chat output is observable on Telegram; the PR body reports Test Server validation of that behavior.

Label justifications:

  • P1: The existing private-context contract is violated by full-verbosity chat output in current main and the latest release.
  • 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: The repository state identifies a maintainer-authored PR, so the external-contributor proof gate does not apply. Its captured body reports embedded and native child/yield/resume validation with private output excluded; raw traces were not independently inspected.
  • proof: telegram-e2e: This PR needs Telegram Test Server proof with the repository E2E skill. Removing private text from full-verbosity chat output is observable on Telegram; the PR body reports Test Server validation of that behavior.

Evidence

What I checked:

  • Current main still contains the disclosure: The schema describes message as private, but the successful result still includes it. The shared jsonResult helper serializes that payload into returned text as well as details. (src/agents/tools/sessions-yield-tool.ts:59, 55000bcc08aa)
  • Latest-release check: The supplied latest release, v2026.9.2, also returns the private message in the successful yield result; the repair is not already shipped there. (src/agents/tools/sessions-yield-tool.ts:59, 3928bad9badf)
  • Existing privacy contract: The documented contract distinguishes private resumed-turn context from an optional public waiting acknowledgment; this is an existing-behavior repair. Public docs: docs/tools/subagents.md. (docs/tools/subagents.md:331, 8861e66408ff)
  • Append authority and transaction boundary: The new helper checks current settlement before enqueueing and again through selectReport inside the existing synchronous write transaction. The underlying report writer checks admitted ownership and session rebound before and after the append. (src/config/sessions/session-accessor.sqlite-transcript-reports.ts:171, 8861e66408ff)
  • Focused regression coverage: Added cases cover private result omission, off/on/full progress output, both public history transports without mutating original arguments, native successful/failed settlement, superseded writers, and settlement revocation while waiting for the writer. Tests were inspected, not executed. (src/plugin-sdk/session-transcript-runtime.test.ts:447, 8861e66408ff)
  • Affirmative Codex dependency signal: The patch changes native Codex yield finalization, and the PR explicitly claims compatibility with upstream 0.153.4. The bundled plugin pins that runtime version, making direct dependency inspection applicable. (extensions/codex/package.json:11, 8861e66408ff)

Likely related people:

  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: 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.

@obviyus

obviyus commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

CI completed for 8861e66408ff93d868b7590e40c7649907bcb0bf in run 34014692337. The only failed child job was check-test-types-core-2: TS2353 at src/gateway/session-history-state.test.ts:398, where streamErrorFallbackPending is no longer a property of ChatDisplayProjectionResult.

The introducing change is f172f136350 / #139753, authored and merged by @steipete. Its parent accepts the fixture's two fields. The change renames them to assistantErrorPending and assistantErrorRecoveryObserved in src/gateway/chat-display-projection.core.ts but leaves the fixture unchanged. The fixture lines came from earlier #139715 and were valid before that rename; line blame alone would misidentify the cause.

This PR changes neither the fixture nor the projection result type. CI tested merge d148d16a3a3ab0c911610809d777af47d2eed409 against main cbd94188df1375438f9040f6aa40d33614546e2e. The existing main fix 8a8bfa47531 / #139794 corrects exactly those two properties and landed after that tested base.

The introducing commit's main CI run was cancelled, so no matching completed main failure is claimed. Attribution rests on the complete before/after source, unchanged fixture, exact candidate compiler error, and the landed correction. The cause is outside this repair and the owned repair workload. All other jobs in the candidate run passed or were skipped.

Proceeding through the guarded unrelated-CI exception under the repository owner's standing approval for causally proven outside-owned failures. No CI job or local type check was rerun for this classification.

@obviyus

obviyus commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

landpr-approve-unrelated-red
pr: 139801
head: 8861e66
run: 34014692337 attempt: 1
failed: check-test-types-core-2 job=101436405303 conclusion=failure
check: openclaw/ci-gate

@obviyus
obviyus merged commit f04aa55 into main Sep 6, 2026
187 of 189 checks passed
@obviyus
obviyus deleted the repair/pr-139254 branch September 6, 2026 05:52
@obviyus

obviyus commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks @Colton-Harris for the original fix in #139254.

Proof: Real Telegram Test Server and native child/yield/resume cycles passed. Independent source-blind acceptance passed all nine original clauses and all eight clarified observations. All 629 focused tests passed.

  • Bug: Full tool output and public history could expose private continuation text. Native resume could lose that context after the parent thread changed.
  • Fix: Return only public yield status and acknowledgment, keep private context in the existing hidden session entry, and omit private arguments from public history copies. Preserve original private input records.
Before After
Full verbosity exposed private context. Public output contains only status and optional acknowledgment.
Native resume could omit private context. The resumed parent receives it once after child completion and completes normally.

Unset/default, on, and off verbosity, empty or omitted acknowledgment, and missing-child ownership behavior were verified. Complete private proof and failed attempts are retained; no raw private runtime records are published.

CI completed for 8861e66408ff93d868b7590e40c7649907bcb0bf in run 34014692337. The only failed child job was check-test-types-core-2: TS2353 at src/gateway/session-history-state.test.ts:398, where streamErrorFallbackPending is no longer a property of ChatDisplayProjectionResult.

The introducing change is f172f136350 / #139753, authored and merged by @steipete. Its parent accepts the fixture's two fields. The change renames them to assistantErrorPending and assistantErrorRecoveryObserved in src/gateway/chat-display-projection.core.ts but leaves the fixture unchanged. The fixture lines came from earlier #139715 and were valid before that rename; line blame alone would misidentify the cause.

This PR changes neither the fixture nor the projection result type. CI tested merge d148d16a3a3ab0c911610809d777af47d2eed409 against main cbd94188df1375438f9040f6aa40d33614546e2e. The existing main fix 8a8bfa47531 / #139794 corrects exactly those two properties and landed after that tested base.

The introducing commit's main CI run was cancelled, so no matching completed main failure is claimed. Attribution rests on the complete before/after source, unchanged fixture, exact candidate compiler error, and the landed correction. The cause is outside this repair and the owned repair workload. All other jobs in the candidate run passed or were skipped.

Proceeding through the guarded unrelated-CI exception under the repository owner's standing approval for causally proven outside-owned failures. No CI job or local type check was rerun for this classification.

Guarded approval: #139801 (comment)

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
Keep private yield context on the existing hidden continuation path, omit it from returned tool content, and remove private input aliases from public history copies. Preserve source input provenance, acknowledgment behavior, and owned-child completion.

Verified with real Telegram Test Server and native child/yield/resume cycles, independent source-blind acceptance of all original and clarified observations, and focused regression/authority checks.

Co-authored-by: Colton Harris <[email protected]>
Co-authored-by: Ayaan Zaidi <[email protected]>
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 extensions: codex gateway Gateway runtime maintainer Maintainer-authored PR P1 High-priority user-facing bug, regression, or broken workflow. plugin: file-transfer proof: telegram-e2e This PR needs Telegram Test Server proof with the repository E2E skill. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M 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.

2 participants