Skip to content

fix: keep runtime context in user messages on compatible Responses endpoints - #168546

Merged
steipete merged 2 commits into
mainfrom
fix/runtime-context-operator-channel
Oct 10, 2026
Merged

steipete merged 2 commits into
mainfrom
fix/runtime-context-operator-channel

Conversation

@steipete

@steipete steipete commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Compatible Responses endpoints could receive runtime context as mid-conversation developer or system messages, even though their chat templates may reject or hoist those messages.

Fixes #164791

User Impact

OpenAI-compatible and local endpoints keep runtime context in a user-role carrier. Supported direct Anthropic API-key routes and native OpenAI Responses retain their existing operator/in-history instruction channel. The docs explain the provider roles, escaped and JSON-quoted conversation data, carrier labels, cache stability, and how operators can discourage narration of internal context.

Why This Change Was Made

Native routing already landed in #163461 and #167698. One typed-carrier branch in the shared Responses converter bypassed the native-endpoint eligibility check used by adjacent operator messages. Reusing that check fixes both provider and transport entrypoints without changing carrier text, ordering, retention, transcript bytes, or the stable system prompt.

The maintainer's decision resolves the carrier-policy question in ask 1. The appendOnlyRuntimeContext configuration switch requested in ask 2 was explicitly declined: role and retention remain capability-driven. This PR does not change stale-bot policy.

Evidence

  • Serialized request captures through both Responses entrypoints reproduce the original defect: localhost carriers were developer/system; they are now user. Native OpenAI retains developer. Canonical and legacy carrier metadata preserve content and order, and input history stays unchanged.
  • Regression failed on the pre-fix code: 2 failed, 9 passed (6.41 s wrapper wall time). Fixed role, steering, and retained-compaction suites: 46 passed in 6.48 s wrapper wall time.
  • Existing native Ollama baseline on the unchanged adapter: two real qwen3:8b turns through pnpm openclaw ... agent --local, exact requested answers, user-role carrier, byte-identical prior messages/tools, and 2,302 cached tokens on the second turn. This is baseline evidence, not a new live Responses-server test.
  • Final changed test file: 11 passed with node scripts/run-vitest.mjs packages/ai/src/transports/openai-responses-prompt-role.test.ts --maxWorkers=1, 7.55 s wrapper wall time (3.35 s Vitest).
  • Core production types, package test types, focused type-aware lint, full docs checks, all eight baseline ratchets, and git diff --check pass.
  • Exact-head CI run passed, including openclaw/ci-gate: 46 successful jobs, 25 skipped. Node test steps took 1299 aggregate CI seconds across 18 selected jobs (27–139 s each; this includes sibling coverage, not just the changed file).
  • Codex autoreview on the final head: scoped-clean, no actionable P0–P2 findings.
  • pnpm prompt:snapshots:gen regenerated seven files with no diff: zero prompt-token drift.
  • No live hosted-provider, llama-server, or interrupted-input continuation proof is claimed. The changed Responses path is covered by production request-body captures before network I/O. ClawSweeper reviewed the exact head with no findings or before-merge items; its live compatible-Responses proof gap falls under the maintainer-approved proof-only override.

Production LOC: +1/-1 (net zero). Tests: +69/-0. Docs: +37/-6.

@clawsweeper

clawsweeper Bot commented Oct 10, 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 size: S labels Oct 10, 2026
@steipete
steipete marked this pull request as ready for review October 10, 2026 17:01
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Oct 10, 2026
@clawsweeper

clawsweeper Bot commented Oct 10, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR keeps runtime-context carriers in the user role on compatible Responses endpoints and documents provider-specific roles.

Example: A reasoning model uses http://localhost:8080/v1 with supportsDeveloperRole enabled.

  • Before: Runtime context is serialized as a developer message.
  • After: Runtime context is serialized as a user message, preserving its content and position.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Focused shared-owner repair with meaningful regression coverage and no actionable findings; changed-path evidence remains in-process.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor-proof gate; both changed Responses entry points have in-process request captures before network I/O, while the declared live Ollama baseline covers an unchanged adapter.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Compatible Responses servers can reject or relocate runtime context sent as mid-conversation developer or system messages.
Reason: The maintainer-authored direction settles carrier policy and repairs a bypass of existing endpoint eligibility without adding a setting.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it repairs a current-main Responses compatibility defect through the existing shared serializer, with no actionable introduced defect found.

Priority: P2
Reviewed head: 0e2ea784a9eb37905a8bed93dbf7f139a2ad2112

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: No supplied request/reply trace exercises the changed path against a real compatible Responses server; the live Ollama baseline exercises an unchanged adapter.
Agent review details

How this fits together

Both Responses entry points pass conversation history through a shared serializer that projects internal messages into provider request input.

flowchart LR
  A[Conversation history] --> B[Shared Responses serializer]
  B --> C[Native endpoint eligibility]
  C --> D[Native instruction role]
  C --> E[Compatible user role]
  D --> F[Responses request]
  E --> F
Loading

Technical review

Best possible solution:

Reuse native-endpoint eligibility for runtime-carrier roles while preserving content, ordering, retention, and transcript bytes.

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

Current-main source deterministically promotes marked text carriers on localhost Responses routes, and the PR reports pre-fix regression failures; no target code was executed during this review.

Is this the best way to solve the issue?

The shared serializer is the correct owner, and its existing endpoint check fixes both entry points without adding competing policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 0f08bb02f0b7.

Provenance checked

  • Runtime-carrier instruction-role projection changes intended behavior with a stated reason (cd9913f: Typed runtime carriers replaced implicit handling and projected context at provider-supported instruction authority.)
  • Native Responses eligibility keeps the original intent (a79e29e: Enable native OpenAI instruction updates while preserving compatible-provider roles.)
  • Carrier placement and retention documentation keeps the original intent (fix(agents): preserve Responses cache prefixes across user turns #140849: Retain previous carriers and keep them with user turns to preserve reusable Responses prefixes.)
  • Anthropic and local-provider documentation keeps the original intent (improve(anthropic): append system prompt updates and runtime context in history on Claude routes #163461: Use supported Anthropic in-history system messages while retaining compatibility behavior elsewhere.)
  • System-prompt runtime-context documentation keeps the original intent (6a9bcca: Move temporal facts into runtime context while preserving local prompt-cache prefixes.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit a79e29e adds packages/ai/src/transports/openai-responses-replay-messages-internal.ts:383 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: a79e29ec04fc; files: packages/ai/src/transports/openai-responses-replay-messages-internal.ts)
  • Dallin Romney: Raw commit cd9913f adds packages/ai/src/transports/openai-responses-replay-messages-internal.ts:408 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: cd9913f1b110; files: packages/ai/src/transports/openai-responses-replay-messages-internal.ts)
  • Markus Hartung: Raw commit 18c801d adds docs/concepts/context.md:163 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 18c801daa116; files: docs/concepts/context.md)

PR surface

Source 0, Tests +69, Docs +31. Total +100 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 1 1 1 0
Tests 1 69 0 +69
Docs 2 37 6 +31
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 107 7 +100

Review metrics

Metric Value Why it matters
Production versus regression coverage Production +1/-1; tests +69/-0 Net-zero production growth reuses existing policy; added coverage protects request assembly through both entry points.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Incorrect runtime-message roles affect compatible Responses endpoints within a focused transport boundary.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Add a redacted request/reply trace from a real compatible Responses server showing the user-role carrier and successful response.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only; repair and merge need explicit maintainer commands such as @clawsweeper autofix or @clawsweeper automerge.

History

Review history (2 earlier review cycles)
  • reviewed 2026-10-10T17:07:40.453Z sha 0e2ea78 :: needs maintainer review before merge. :: none
  • reviewed 2026-10-10T17:17:35.643Z sha 0e2ea78 :: needs maintainer review before merge. :: none

Reviewed October 10, 2026, 1:34 PM ET / 17:34 UTC (Revision 3).

@steipete steipete self-assigned this Oct 10, 2026
@steipete
steipete merged commit b5bf83f into main Oct 10, 2026
185 of 186 checks passed
@steipete
steipete deleted the fix/runtime-context-operator-channel branch October 10, 2026 17:39
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

steipete added a commit that referenced this pull request Oct 10, 2026
Align provider-review continuation request captures with #168546. The
ChatGPT Responses fixture is outside the native OpenAI endpoint predicate,
so its runtime carrier keeps the user role and original content blocks.

Keep the exact reviewed steer, carrier ordering, image omission, request
count, transcript immutability and review-settlement assertions. This only
updates two expected arrays; no request assembly or provider policy changes.

Linux proof: 32 focused tests, all 1,454 tests in the original 111-file
shard, and 11 provider-role tests pass. Restoring unconditional instruction
role conversion makes all four affected cases fail. Selected test types,
lint and P2 review pass. The unrelated dead-export failures also reproduce
on the untouched baseline; no ignores or suppressions were changed.
steipete added a commit to ericcaiwx-star/openclaw that referenced this pull request Oct 10, 2026
Keep XML context within consecutive text parts, including empty text, and stop it at native tool or thinking blocks in final extraction and block snapshots. Retain the terminal retry and warning assertions with the sanitized payload expectation.

Align the QA private-completion projection with the compatible Responses user-role carrier contract merged in openclaw#168546. Keep separate ordered messages and all private nonce, media, and channel-delivery assertions.
steipete added a commit that referenced this pull request Oct 10, 2026
Follow #168546's intentional runtime-carrier policy for compatible
Responses endpoints. Decode the actual request using the QA input owner
while preserving developer/system context and every existing private
completion, channel delivery, and restart assertion.

Add focused coverage for native and compatible carriers plus missing,
unmarked, stale, and leaked private data. No production behavior changes.

Proof: reproduced the original smoke failure on Linux; profile 4 passes
all 9 scenarios; QA config passes 312 files / 3347 tests; all type graphs,
targeted typed/boundary lint, import cycles, and P2 review pass.
pnpm test extensions/qa-lab/src/scenario-terminal-context.test.ts
--maxWorkers=1 takes 27s including initial transforms; its 9 test bodies
take under one second. No CI jobs were added.
Check-changed reaches unrelated existing model-auth and Solid unused
exports; its remaining relevant checks were run separately.
steipete added a commit that referenced this pull request Oct 11, 2026
* fix(text): strip GLM arg_key shadow calls on current main

Refresh the shared sanitizer onto the current text-filter composition and drop the gateway harness so the diff stays under the size M line budget.

* fix(text): keep GLM streaming inside the assistant-text profile

The public stripToolCallXmlTags helper stays terminal-only. Streaming holds stay on the private profile path.

* test(text): restore the GLM proof harness on current main

The shrink dropped the stream-phase table and the Gateway chat.final
harness that exercise this sanitizer. Put both back on the conflict-free
branch so they run against the current head.

* test(gateway): remove fixed waits from final-text-only regression

* fix: hide serialized tool markup throughout reply delivery

Keep GLM shadow text and standalone invocation XML in the shared visible-text sanitizer. Hold incomplete stream prefixes, restore finished literal examples, and retain payload context across adjacent native text parts. Preserve prose, code, and native tool execution.

Incorporates the distinct invocation cases from #153635 alongside the GLM repair from #138204. Thanks @ericcaiwx-star and @ruiling-smartbear.

Co-authored-by: Ruilin Gao <[email protected]>

* fix: preserve replies across native content boundaries

Keep XML context within consecutive text parts, including empty text, and stop it at native tool or thinking blocks in final extraction and block snapshots. Retain the terminal retry and warning assertions with the sanitized payload expectation.

Align the QA private-completion projection with the compatible Responses user-role carrier contract merged in #168546. Keep separate ordered messages and all private nonce, media, and channel-delivery assertions.

* fix: remove unused channel migration binding

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Ruilin Gao <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
…dpoints (openclaw#168546)

* fix: keep runtime context in user messages on compatible Responses endpoints

* test: retain serialized Responses request captures
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
Align provider-review continuation request captures with openclaw#168546. The
ChatGPT Responses fixture is outside the native OpenAI endpoint predicate,
so its runtime carrier keeps the user role and original content blocks.

Keep the exact reviewed steer, carrier ordering, image omission, request
count, transcript immutability and review-settlement assertions. This only
updates two expected arrays; no request assembly or provider policy changes.

Linux proof: 32 focused tests, all 1,454 tests in the original 111-file
shard, and 11 provider-role tests pass. Restoring unconditional instruction
role conversion makes all four affected cases fail. Selected test types,
lint and P2 review pass. The unrelated dead-export failures also reproduce
on the untouched baseline; no ignores or suppressions were changed.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
Follow openclaw#168546's intentional runtime-carrier policy for compatible
Responses endpoints. Decode the actual request using the QA input owner
while preserving developer/system context and every existing private
completion, channel delivery, and restart assertion.

Add focused coverage for native and compatible carriers plus missing,
unmarked, stale, and leaked private data. No production behavior changes.

Proof: reproduced the original smoke failure on Linux; profile 4 passes
all 9 scenarios; QA config passes 312 files / 3347 tests; all type graphs,
targeted typed/boundary lint, import cycles, and P2 review pass.
pnpm test extensions/qa-lab/src/scenario-terminal-context.test.ts
--maxWorkers=1 takes 27s including initial transforms; its 9 test bodies
take under one second. No CI jobs were added.
Check-changed reaches unrelated existing model-auth and Solid unused
exports; its remaining relevant checks were run separately.
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 11, 2026
* fix(text): strip GLM arg_key shadow calls on current main

Refresh the shared sanitizer onto the current text-filter composition and drop the gateway harness so the diff stays under the size M line budget.

* fix(text): keep GLM streaming inside the assistant-text profile

The public stripToolCallXmlTags helper stays terminal-only. Streaming holds stay on the private profile path.

* test(text): restore the GLM proof harness on current main

The shrink dropped the stream-phase table and the Gateway chat.final
harness that exercise this sanitizer. Put both back on the conflict-free
branch so they run against the current head.

* test(gateway): remove fixed waits from final-text-only regression

* fix: hide serialized tool markup throughout reply delivery

Keep GLM shadow text and standalone invocation XML in the shared visible-text sanitizer. Hold incomplete stream prefixes, restore finished literal examples, and retain payload context across adjacent native text parts. Preserve prose, code, and native tool execution.

Incorporates the distinct invocation cases from openclaw#153635 alongside the GLM repair from openclaw#138204. Thanks @ericcaiwx-star and @ruiling-smartbear.

Co-authored-by: Ruilin Gao <[email protected]>

* fix: preserve replies across native content boundaries

Keep XML context within consecutive text parts, including empty text, and stop it at native tool or thinking blocks in final extraction and block snapshots. Retain the terminal retry and warning assertions with the sanitized payload expectation.

Align the QA private-completion projection with the compatible Responses user-role carrier contract merged in openclaw#168546. Keep separate ordered messages and all private nonce, media, and channel-delivery assertions.

* fix: remove unused channel migration binding

---------

Co-authored-by: Peter Steinberger <[email protected]>
Co-authored-by: Ruilin Gao <[email protected]>
RomneyDa pushed a commit that referenced this pull request Oct 12, 2026
…dpoints (#168546)

* fix: keep runtime context in user messages on compatible Responses endpoints

* test: retain serialized Responses request captures

(cherry picked from commit b5bf83f)

Backport notes: docs-only conflict in docs/concepts/system-prompt.md: kept the branch's Runtime Context sentence (without main-only local date/time zone wording) and applied only this commit's change, replacing the provider-projection sentence with the link to Runtime context and provider roles.
RomneyDa pushed a commit that referenced this pull request Oct 12, 2026
Align provider-review continuation request captures with #168546. The
ChatGPT Responses fixture is outside the native OpenAI endpoint predicate,
so its runtime carrier keeps the user role and original content blocks.

Keep the exact reviewed steer, carrier ordering, image omission, request
count, transcript immutability and review-settlement assertions. This only
updates two expected arrays; no request assembly or provider policy changes.

Linux proof: 32 focused tests, all 1,454 tests in the original 111-file
shard, and 11 provider-role tests pass. Restoring unconditional instruction
role conversion makes all four affected cases fail. Selected test types,
lint and P2 review pass. The unrelated dead-export failures also reproduce
on the untouched baseline; no ignores or suppressions were changed.

(cherry picked from commit 8445937)
RomneyDa pushed a commit that referenced this pull request Oct 12, 2026
Follow #168546's intentional runtime-carrier policy for compatible
Responses endpoints. Decode the actual request using the QA input owner
while preserving developer/system context and every existing private
completion, channel delivery, and restart assertion.

Add focused coverage for native and compatible carriers plus missing,
unmarked, stale, and leaked private data. No production behavior changes.

Proof: reproduced the original smoke failure on Linux; profile 4 passes
all 9 scenarios; QA config passes 312 files / 3347 tests; all type graphs,
targeted typed/boundary lint, import cycles, and P2 review pass.
pnpm test extensions/qa-lab/src/scenario-terminal-context.test.ts
--maxWorkers=1 takes 27s including initial transforms; its 9 test bodies
take under one second. No CI jobs were added.
Check-changed reaches unrelated existing model-auth and Solid unused
exports; its remaining relevant checks were run separately.

(cherry picked from commit e674d8e)
RomneyDa added a commit that referenced this pull request Oct 17, 2026
…roof

The sessions_send visible-child proof timed out on every 2026.10.5
candidate: its synthetic provider picked the latest user item that lacked
the legacy <<<BEGIN_OPENCLAW_INTERNAL_CONTEXT>>> marker as the user prompt.

Since #168546 (backport 8d66b94), OpenAI-compatible Responses
endpoints, including mock-openai, keep runtime context in a user-role
"OpenClaw runtime context:" carrier after the user turn instead of a
developer message. The fixture then read that carrier as the prompt, never
saw the "send" prompt on turn 2, answered PARENT_READY again, and the test
waited for PARENT_DONE until timeout.

Captured provider requests: v2026.10.4 sends the turn-2 carrier with role
developer; the 10.5 tip sends it with role user. Reverting a293f2e
(#168410) left the failure unchanged.

Select the prompt with the shared qa-lab isInternalRuntimeContextCarrierText
helper, which already accepts current and legacy carrier shapes.
RomneyDa added a commit that referenced this pull request Oct 20, 2026
…roof

The sessions_send visible-child proof timed out on every 2026.10.5
candidate: its synthetic provider picked the latest user item that lacked
the legacy <<<BEGIN_OPENCLAW_INTERNAL_CONTEXT>>> marker as the user prompt.

Since #168546 (backport 8d66b94), OpenAI-compatible Responses
endpoints, including mock-openai, keep runtime context in a user-role
"OpenClaw runtime context:" carrier after the user turn instead of a
developer message. The fixture then read that carrier as the prompt, never
saw the "send" prompt on turn 2, answered PARENT_READY again, and the test
waited for PARENT_DONE until timeout.

Captured provider requests: v2026.10.4 sends the turn-2 carrier with role
developer; the 10.5 tip sends it with role user. Reverting a293f2e
(#168410) left the failure unchanged.

Select the prompt with the shared qa-lab isInternalRuntimeContextCarrierText
helper, which already accepts current and legacy carrier shapes.

(cherry picked from commit d3a06e7)
RomneyDa added a commit that referenced this pull request Oct 20, 2026
…7319)

* fix(test): treat the env-gated Agents API live proof as optional shard evidence

test/gateway-agentsapi.live.test.ts (new since 2026.10.4) skips its only case
unless OPENCLAW_LIVE_AGENTS_API=1, which the native live test-harness shard
never sets, so the shard's no-passing-assertions guard failed it on every
2026.10.5 candidate once the other harness tests went green. Register it in
the existing whole-file opt-in map like the other env-gated live proofs.

(cherry picked from commit 761ef64)

* fix(test): decode the Codex CLI JSON error after plugin uninstall

The live Codex npm plugin lane matched the expected post-uninstall error
against raw --json stdout, where quotes are escaped, so the correct
owner-plugin-not-activatable error never matched. Decode the canonical CLI
error message first, as the 2026.10.4 release line does (a9fd56d).

(cherry picked from commit e8772a9)

* fix(test): scope CLI announcement barrier to parent probe

(cherry picked from commit d5c0db7)
(cherry picked from commit a48d4a8)

* test(live): wait out the crash-loop breaker before the orphan settles

The native subagent restart live proof SIGKILLs the Gateway three times in
about two minutes. The third unclean boot trips the documented restart-loop
breaker (3 unclean boots within 5 minutes, #166238), which pauses restart
settlement, including interrupted subagent recovery (#166846), until the
unclean window drains. The orphan assertion added with the #169144 backport
only waited 30 seconds, so the nonannouncing child was still `running`.

Wait up to 360 seconds for the orphan settlement so the proof covers the
breaker pause and the automatic resume after its window. Assertions are
unchanged. 2026.10.4 passed because it predates the breaker pause, startup
subagent reconciliation, and this assertion.

Deterministic proof: the quiet-child e2e twin with SIGKILL restarts and an
exec-blocked child passes with one prior kill; with two warm-up kills it logs
"restart-loop breaker tripped" and the parent continuation never arrives
within 60 seconds; with a 400-second wait it settles and passes (338s).

(cherry picked from commit 1a4c2a0)

* test(qa-lab): skip user-role runtime carriers in visible-child send proof

The sessions_send visible-child proof timed out on every 2026.10.5
candidate: its synthetic provider picked the latest user item that lacked
the legacy <<<BEGIN_OPENCLAW_INTERNAL_CONTEXT>>> marker as the user prompt.

Since #168546 (backport 8d66b94), OpenAI-compatible Responses
endpoints, including mock-openai, keep runtime context in a user-role
"OpenClaw runtime context:" carrier after the user turn instead of a
developer message. The fixture then read that carrier as the prompt, never
saw the "send" prompt on turn 2, answered PARENT_READY again, and the test
waited for PARENT_DONE until timeout.

Captured provider requests: v2026.10.4 sends the turn-2 carrier with role
developer; the 10.5 tip sends it with role user. Reverting a293f2e
(#168410) left the failure unchanged.

Select the prompt with the shared qa-lab isInternalRuntimeContextCarrierText
helper, which already accepts current and legacy carrier shapes.

(cherry picked from commit d3a06e7)

* test(buzz): skip real reconnect backoff in cold-start recovery

(cherry picked from commit fa2049a)

* fix(release): let the Telegram release lane finish its 25 scenarios

The isolated Telegram candidate job hit its 60-minute limit at scenario 24/25
on every 2026.10.5 candidate (about 62 minutes needed at 102-108s per packaged
Gateway start). main carries the same Telegram scenario set and job, so
raise the job budget to 90 minutes; the calling release-checks job keeps its
210-minute bound.

Also carry the 2026.10.4 release-line fixture fix for
telegram-prepared-delivery-recovery (8b78670): keep the audit receipt in
the shared Gateway workspace and create it up front so the isolated SUT can
append without EACCES. main still writes it under the private tempRoot.

(cherry picked from commit 3cb49f0, adapted to main's runner anchor)

* test(gateway): probe startup readiness on fresh connections

The deferred-fleet startup test failed twice in 2026.10.5 FRV #12 with
`fetch failed` / `read ECONNRESET`. Its Gateway shares the test process's
event loop. A /healthz or /readyz probe could reuse a keep-alive socket
that Undici still treated as live; when the request was written and a
synchronous main-thread startup stall followed, the server's idle-timer
callback ran before the poll phase read the request and destroyed the
socket with the request unread, so the kernel reset the connection.

main still probes with default keep-alive fetches. Probe with
`Connection: close`, matching existing Gateway test probes. Assertions are
unchanged.

(cherry picked from commit e3c63f2, adapted to main's probe sites)

* test(live): expect review effort for Skill Workshop background reviews in the Ultra lane

Since #161057 the Skill Workshop counts iterations per session, so Ultra probe
sessions trigger a background review after idling. The review runs under its
own skill-workshop-review: run and does not inherit the session's thinking
level, so the lane's every-request-is-max assertion failed on 2026.10.5
whenever a review reached the provider.

On main, #173889 pins review runs to thinkLevel "low" (review-run.ts), which
the OpenAI stream wrapper sends as effort "low". Expect that effort for review
runs; Ultra runs and their sessions must still be max, and independent
heartbeats stay medium.

The live file is over the line cap, so the Ultra wire effort policy moves to
a sibling helper with its observation type, and the deterministic review
cases run in the normal helper suite.

(cherry picked from commit ca15213, adapted to main's review thinking level)

* test(release): forward-port 2026.10.4-line upgrade-survivor and runtime-smoke harness fixes

Release-line harness fixes that 2026.10.1-2026.10.5 carried but main never
received:

- cron-scheduled-authority: seed the cron authority specimen through the
  published baseline's own SQLite writer (seedPublishedCronJobs) instead of a
  raw cron/jobs.json that current candidates treat as a retired pre-July
  store; drop owner fields for pre-2026.7.1 baselines
  (usesCronOwnerAtBaseline). The dispatcher passes the package root to
  seedState, and the scenario now requires a published baseline.
- bundled plugin runtime smoke: join deferred read-only update discovery via
  update.status before the package-manager child watchdog. main still defers
  install discovery (`<manager> root -g`) until after ready, so it can race
  the watchdog's no-package-manager-children check.

Skips the codex npm plugin live source-reply grep from the release commit:
main already probes dynamic-tool-source-reply.ts and dynamic-tools.ts.

(cherry picked from commit fcdf0d1, codex grep hunk dropped; cron seed
test adapted to main's executable-mode fixture writes)
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 21, 2026
…nclaw#177319)

* fix(test): treat the env-gated Agents API live proof as optional shard evidence

test/gateway-agentsapi.live.test.ts (new since 2026.10.4) skips its only case
unless OPENCLAW_LIVE_AGENTS_API=1, which the native live test-harness shard
never sets, so the shard's no-passing-assertions guard failed it on every
2026.10.5 candidate once the other harness tests went green. Register it in
the existing whole-file opt-in map like the other env-gated live proofs.

(cherry picked from commit 761ef64)

* fix(test): decode the Codex CLI JSON error after plugin uninstall

The live Codex npm plugin lane matched the expected post-uninstall error
against raw --json stdout, where quotes are escaped, so the correct
owner-plugin-not-activatable error never matched. Decode the canonical CLI
error message first, as the 2026.10.4 release line does (a9fd56d).

(cherry picked from commit e8772a9)

* fix(test): scope CLI announcement barrier to parent probe

(cherry picked from commit d5c0db7)
(cherry picked from commit a48d4a8)

* test(live): wait out the crash-loop breaker before the orphan settles

The native subagent restart live proof SIGKILLs the Gateway three times in
about two minutes. The third unclean boot trips the documented restart-loop
breaker (3 unclean boots within 5 minutes, openclaw#166238), which pauses restart
settlement, including interrupted subagent recovery (openclaw#166846), until the
unclean window drains. The orphan assertion added with the openclaw#169144 backport
only waited 30 seconds, so the nonannouncing child was still `running`.

Wait up to 360 seconds for the orphan settlement so the proof covers the
breaker pause and the automatic resume after its window. Assertions are
unchanged. 2026.10.4 passed because it predates the breaker pause, startup
subagent reconciliation, and this assertion.

Deterministic proof: the quiet-child e2e twin with SIGKILL restarts and an
exec-blocked child passes with one prior kill; with two warm-up kills it logs
"restart-loop breaker tripped" and the parent continuation never arrives
within 60 seconds; with a 400-second wait it settles and passes (338s).

(cherry picked from commit 1a4c2a0)

* test(qa-lab): skip user-role runtime carriers in visible-child send proof

The sessions_send visible-child proof timed out on every 2026.10.5
candidate: its synthetic provider picked the latest user item that lacked
the legacy <<<BEGIN_OPENCLAW_INTERNAL_CONTEXT>>> marker as the user prompt.

Since openclaw#168546 (backport 8d66b94), OpenAI-compatible Responses
endpoints, including mock-openai, keep runtime context in a user-role
"OpenClaw runtime context:" carrier after the user turn instead of a
developer message. The fixture then read that carrier as the prompt, never
saw the "send" prompt on turn 2, answered PARENT_READY again, and the test
waited for PARENT_DONE until timeout.

Captured provider requests: v2026.10.4 sends the turn-2 carrier with role
developer; the 10.5 tip sends it with role user. Reverting a293f2e
(openclaw#168410) left the failure unchanged.

Select the prompt with the shared qa-lab isInternalRuntimeContextCarrierText
helper, which already accepts current and legacy carrier shapes.

(cherry picked from commit d3a06e7)

* test(buzz): skip real reconnect backoff in cold-start recovery

(cherry picked from commit fa2049a)

* fix(release): let the Telegram release lane finish its 25 scenarios

The isolated Telegram candidate job hit its 60-minute limit at scenario 24/25
on every 2026.10.5 candidate (about 62 minutes needed at 102-108s per packaged
Gateway start). main carries the same Telegram scenario set and job, so
raise the job budget to 90 minutes; the calling release-checks job keeps its
210-minute bound.

Also carry the 2026.10.4 release-line fixture fix for
telegram-prepared-delivery-recovery (8b78670): keep the audit receipt in
the shared Gateway workspace and create it up front so the isolated SUT can
append without EACCES. main still writes it under the private tempRoot.

(cherry picked from commit 3cb49f0, adapted to main's runner anchor)

* test(gateway): probe startup readiness on fresh connections

The deferred-fleet startup test failed twice in 2026.10.5 FRV openclaw#12 with
`fetch failed` / `read ECONNRESET`. Its Gateway shares the test process's
event loop. A /healthz or /readyz probe could reuse a keep-alive socket
that Undici still treated as live; when the request was written and a
synchronous main-thread startup stall followed, the server's idle-timer
callback ran before the poll phase read the request and destroyed the
socket with the request unread, so the kernel reset the connection.

main still probes with default keep-alive fetches. Probe with
`Connection: close`, matching existing Gateway test probes. Assertions are
unchanged.

(cherry picked from commit e3c63f2, adapted to main's probe sites)

* test(live): expect review effort for Skill Workshop background reviews in the Ultra lane

Since openclaw#161057 the Skill Workshop counts iterations per session, so Ultra probe
sessions trigger a background review after idling. The review runs under its
own skill-workshop-review: run and does not inherit the session's thinking
level, so the lane's every-request-is-max assertion failed on 2026.10.5
whenever a review reached the provider.

On main, openclaw#173889 pins review runs to thinkLevel "low" (review-run.ts), which
the OpenAI stream wrapper sends as effort "low". Expect that effort for review
runs; Ultra runs and their sessions must still be max, and independent
heartbeats stay medium.

The live file is over the line cap, so the Ultra wire effort policy moves to
a sibling helper with its observation type, and the deterministic review
cases run in the normal helper suite.

(cherry picked from commit ca15213, adapted to main's review thinking level)

* test(release): forward-port 2026.10.4-line upgrade-survivor and runtime-smoke harness fixes

Release-line harness fixes that 2026.10.1-2026.10.5 carried but main never
received:

- cron-scheduled-authority: seed the cron authority specimen through the
  published baseline's own SQLite writer (seedPublishedCronJobs) instead of a
  raw cron/jobs.json that current candidates treat as a retired pre-July
  store; drop owner fields for pre-2026.7.1 baselines
  (usesCronOwnerAtBaseline). The dispatcher passes the package root to
  seedState, and the scenario now requires a published baseline.
- bundled plugin runtime smoke: join deferred read-only update discovery via
  update.status before the package-manager child watchdog. main still defers
  install discovery (`<manager> root -g`) until after ready, so it can race
  the watchdog's no-package-manager-children check.

Skips the codex npm plugin live source-reply grep from the release commit:
main already probes dynamic-tool-source-reply.ts and dynamic-tools.ts.

(cherry picked from commit fcdf0d1, codex grep hunk dropped; cron seed
test adapted to main's executable-mode fixture writes)
wheakerd pushed a commit to wheakerd/clawdbot that referenced this pull request Oct 22, 2026
Backport openclaw#168546 for the extended-stable release audit.

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

docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. 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.

Runtime context is still delivered as a raw <<<BEGIN_OPENCLAW_INTERNAL_CONTEXT>>> user turn in 2026.9.8 (follow-up to #142754)

1 participant