Skip to content

fix(agents): keep read-only steering carriers when publishing suppressed user envelopes - #200156

Merged
steipete merged 1 commit into
mainfrom
fix/steering-symbol-envelope-publish
Nov 16, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/steering-symbol-envelope-publish

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

The Team Gateway crashed on 2026-11-16 at 07:04:29 PST (release 25c9790) with an unhandled promise rejection:

TypeError: Cannot assign to read only property 'Symbol(openclaw.steeringRuntimeContext)' of object '#<Object>'
    at Object.assign (<anonymous>)
    at publishPersistedUserEnvelope (session-tool-result-guard-wrapper)
    at Object.onUserMessagePersistenceSuppressed
    at guardedAppend … drainStoreWriterQueue

The throw happened inside the store writer queue, so the process exited and systemd restarted it. The restart interrupted 13 sessions (restart-resume), 6 subagent waits, 3 cron jobs and two long runs.

Why This Change Was Made

attachSteeringRuntimeContext (src/agents/embedded-agent-runner/run/runtime-context-prompt.ts) defines the steering carrier with Object.defineProperty, enumerable but non-writable. Spread copies of the runtime user message carry that enumerable symbol into the prepared/persisted envelope. publishPersistedUserEnvelope deletes the runtime message's string keys and then ran Object.assign(runtime, persisted, { content }). Object.assign also copies enumerable own symbols, so it tried to overwrite the read-only carrier and threw.

The function's own comment says symbol-carried media and steering facts stay on the runtime message. The fix publishes only string-keyed envelope fields (Object.fromEntries(Object.entries(persisted))), which matches that contract. Production LOC: +2 (one changed line plus a two-line comment explaining the read-only carrier hazard).

User Impact

Steered user turns whose persistence is suppressed no longer crash the Gateway, and the steering carrier on the runtime message is preserved.

Evidence

  • New regression test publishes a suppressed user envelope without rewriting the steering carrier in src/agents/embedded-agent-runner.guard.test.ts. On unfixed main it fails with TypeError: Attempted to assign to readonly property; with the fix it passes.
  • node scripts/run-vitest.mjs src/agents/embedded-agent-runner.guard.test.ts src/agents/session-tool-result-guard.test.ts src/agents/embedded-agent-runner/run/runtime-context-prompt.test.ts: 18 + 37 passed.
  • node scripts/check-changed.mjs: all lanes pass except the dead-export scan, which flags ProjectedContinuationSource in src/config/sessions/session-history-types.ts. That file is untouched here; it's an inherited main regression.
  • Codex autoreview: scoped-clean, no actionable findings.
  • Production evidence: Team Gateway journal, 2026-11-16T15:04:29Z; first occurrence in 7 days of logs.

…sed user envelopes

Object.assign copied the persisted spread-copy's enumerable steering symbol
onto the runtime message's read-only carrier, throwing inside the store
writer and crashing the Gateway on an unhandled rejection. Publish only
string-keyed envelope fields; symbol-carried runtime facts stay prepared.
@clawsweeper

clawsweeper Bot commented Nov 16, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review November 16, 2026 15:32
@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS labels Nov 16, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-16T15:34:17.122445Z 9a4b846 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@steipete
steipete merged commit ade4216 into main Nov 16, 2026
108 of 111 checks passed
@steipete
steipete deleted the fix/steering-symbol-envelope-publish branch November 16, 2026 15:32
vincentkoc added a commit that referenced this pull request Nov 16, 2026
…tgres-compaction-watched-prompt-20261116

* commit '9e810f7101557b006d5ff223d955f14dc43329f0': (23 commits)
  chore(ui): refresh control ui locales (#200164)
  fix(update): stop reporting unset git config keys as failing checks (#200153)
  test: consolidate redundant coverage (198793, part 2) (#198936)
  revert: skills-used full-transcript scan on every chat history page (#200159)
  refactor(sessions): follow the chat by key for stored delivery references (#200099)
  fix(update): bridge 2026.11.5-beta.4 updaters (#200152)
  fix(gateway): avoid filesystem stalls during catalog refresh (#200136)
  fix(ci): match update refusal probe to selected candidate (#200043)
  fix(agents): keep read-only steering carriers when publishing suppressed user envelopes (#200156)
  test: consolidate suites while retaining recovery owners (#198933)
  test: consolidate redundant coverage (198789, part 2) (#198932)
  refactor(cli): consolidate camera command tests (#200144)
  fix(cli): avoid initializing provider runtime during cleanup (#200139)
  fix(ui): show mobile destinations without the drawer exit delay (#198879)
  chore(ui): refresh control ui locales (#200146)
  fix(knowledge): keep historical claims distinct and reject changed retries (#200140)
  fix(ui): align dropdown arrows on mobile New Session
  improve(sessions): archive inactive transcripts by default (#199899)
  refactor(agents): own background commands and yield waits by the chat (#200097)
  fix(models): guessed non-chat models leave the default picker instead of being refused (#200102)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 17, 2026
…sed user envelopes (openclaw#200156)

Object.assign copied the persisted spread-copy's enumerable steering symbol onto the runtime message's read-only carrier, throwing inside the store writer and crashing the Team Gateway (2026-11-16 07:04 PST) on an unhandled rejection. Publish only string-keyed envelope fields; symbol-carried runtime facts stay prepared.

Regression test reproduces the TypeError on main. Production crash hotfix, merged at pinned head after exact-head local proof with no failing CI jobs.
RomneyDa added a commit that referenced this pull request Nov 17, 2026
Backport ade4216. Publish string-keyed persisted envelope fields without assigning readonly symbol carriers.

Co-authored-by: RomneyDa <[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 size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant