Repository navigation
fix(cli): one run deadline for openclaw agent on both routes - #208522
Conversation
…outes openclaw agent sent a 600 s CLI fallback as the Gateway run's deadline while --local used agents.defaults.timeoutSeconds (48 h); agent exec hardcoded 600. Only an explicit --timeout now travels.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. |
|
Codex review: passed. What this changesThis PR removes implicit CLI timeout overrides so Gateway and embedded agent runs resolve their defaults consistently. Example: Run openclaw agent without --timeout when the CLI host specifies 600 seconds and the remote Gateway specifies 1800 seconds.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-authored PR addresses a source-confirmed deadline mismatch using the existing timeout owner, with no blocking correctness findings. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherCLI registration passes explicit options into Gateway dispatch or embedded execution; the run owner resolves per-attempt deadlines, and terminal presentation returns replies or timeout diagnostics. flowchart TD
A[Agent CLI options] --> B{Execution route}
B --> C[Gateway admission]
B --> D[Embedded command preparation]
C --> E[Canonical timeout resolver]
D --> E
E --> F[Model attempt and terminal reply]
Technical reviewBest possible solution: Let the existing run timeout resolver own defaults while preserving explicit CLI overrides and the documented per-attempt fallback contract. Do we have a high-confidence way to reproduce the issue? Current-main source establishes the mismatch: Gateway CLI dispatch supplies a host-configured or 600-second override, whereas embedded preparation resolves the canonical default; the PR also reports long-task failures on the Gateway route, but no reproduction was executed during this read-only review. Is this the best way to solve the issue? Removing caller-owned defaults is the smallest complete repair, and the option-registration, exec, yielded-wait, documentation, and diagnostic changes follow that ownership decision. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e9a1a4595b1f. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
PR surfaceSource +1, Tests +88, Docs +1. Total +90 across 18 files. Added test files: 1. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/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. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 29, 2026, 2:43 PM ET / 19:43 UTC. |
|
Landed. |
…both routes (#208644) ## Problem `openclaw agent` without `--timeout` used to get two run deadlines: 600 s through the Gateway (a CLI-side fallback) and `agents.defaults.timeoutSeconds` (48 h by default) with `--local`. #208522 made `resolveAgentTimeoutMs` the only owner on both routes, but its tests stop at the CLI request shape. Nothing at the CLI boundary checks that the two routes resolve the same deadline. ## Change Test only. Adds a second case to `test/e2e/agent-route-parity.built-cli.e2e.test.ts`, which already holds the workspace parity case (#208502): - The run owner's config sets `agents.defaults.timeoutSeconds: 2`, and a synthetic model answers after 8 s. - `agent --local` without `--timeout` times out ("Request timed out before a response was generated") and never sees the late reply. - The Gateway route without `--timeout`, from a CLI whose own config sets no deadline, times out the same way and never sees the late reply. It runs as the separate client a remote Gateway would have. Before #208522, that CLI sent its own 600 s fallback, so the Gateway waited and returned the late reply. The test checks the resolved deadline through the turn's outcome. It does not run for 10 minutes: each turn ends after about 2 s. It matches only timeout text that both the base and this branch print, so it fails on the deadline itself, not on the message wording #208522 changed. ## CI gap PR CI does not run this file, or the other `test/e2e/*.built-cli.e2e.test.ts` files added for class L (`gateway-unsafe-home`). - `ci.yml` runs only named e2e files. - The full `pnpm test:e2e:gateway` suite, which includes `test/**/*.e2e.test.ts`, runs only in the scheduled live checks (daily 04:23 UTC, `include_repo_e2e: true`), release checks and full release candidates (`openclaw-live-and-e2e-checks-reusable.yml`, Gateway 1/4-4/4). - So a regression here shows up nightly, not on the PR that causes it. - Wiring these files into PR CI is a CI-budget decision and is not part of this PR. ## Evidence - Branch (built CLI, local run): both cases in the file pass (13.1 s and 14.1 s). - Base `b170f7d97128^` (before #208522, built with `ocx base`): the new case fails on the Gateway route. The JSON result carries `"text": "ROUTE_DEADLINE_LATE_REPLY"`, because the CLI's 600 s fallback overrode the Gateway's 2 s deadline. - `--local` passes on both, as expected: it always used `resolveAgentTimeoutMs`. - Test only, no production change. Co-authored-by: Ayaan Zaidi <[email protected]>
…ply in the CLI (#207491) ## What Problem This Solves When you run `openclaw agent -m "…"` through the Gateway and the agent hands work to a subagent and yields (`sessions_yield`), the command exits after a few seconds and prints nothing. It even drops the short acknowledgment the model wrote for the user. The subagent's result arrives later in the session, but the terminal never shows it. To the user, the command did nothing. Control UI and Telegram already show a wait state for the same turn, so only the CLI looks dead. Log signature from a production-shaped replay with `gpt-5.4-mini`: `payloads: []`, `meta.yielded: true`, `meta.yieldAcknowledgment: "Waiting for the delegated arithmetic check to finish."`, CLI stdout empty, exit 0 after about 3 s (3 of 5 subagent turns). ## User Impact - After a yield with pending subagents, `openclaw agent` prints the model's acknowledgment, shows "Waiting on N subagent(s)…" while they work, then prints the reply the session gives when they finish, and exits 0. - The wait uses the run's existing `--timeout`, so `--timeout 0` means no deadline. If the wait ends early (timeout, Gateway restart or drop, Ctrl-C) or the follow-up fails, the CLI prints one stderr line naming the session where the result will appear and exits 1. It never exits silently. Ctrl-C during the wait does not abort anything: the turn already ended and the subagents keep running. - `--json` output and timing are unchanged. - `openclaw agent --local` is unchanged. Subagent spawning there is a separate open gap. ## Why This Change Was Made The CLI already holds an authenticated connection for the `agent` call. That connection is an unscoped session-event audience: it has no `session-scoped-events` capability, so the Gateway already sends it the `agent` lifecycle and `chat` events of the session and its child sessions (`server-broadcast.transport.test.ts`, "visits only the session audience"). Control UI renders its wait state from these same events. The CLI now keeps the connection open after a yielded response (`onResponse`) and reads those events (`onEvent`, now passed through `callGateway`). No new RPC, subscription or protocol field. The follow-up is the run that starts in the session after one of the turn's own completion-expecting children (`acceptedSessionSpawns`) ends; its reply is the next terminal `chat` event in the session. A session runs one turn at a time, so a run already in progress when the child ends, or queued behind the follow-up, is not taken. A follow-up that yields again hands over to the next run. Accepted edge: the CLI matches the follow-up by session order, not by run identity. If a different turn starts in the same session in the idle gap after a child ends (or after a follow-up that yields again), that turn's reply is printed instead. With the default `session.dmScope: main`, a channel DM shares `agent:main:main` with a plain `openclaw agent -m`, so a DM that arrives during that gap is the realistic case. The fault is visible and recoverable: the real result still lands in the session. Exact matching needs either the requester-settle run identity in the `agent` response (a protocol change) or a `sessions.messages.subscribe` read of the transcript's subagent-completion marker; both are left for a follow-up. The follow-up's text is printed. Media attached to the follow-up is not (it stays in the session). Reply printing moved from `agent-via-gateway.ts` into `agent-gateway-reply.ts`, because the line-cap ratchet allows no growth in that file. It is unchanged except that an ok reply with no payloads now prints `meta.yieldAcknowledgment`. ## Evidence - **Red on main, green here:** `src/commands/agent-via-gateway.yield.test.ts`. The acknowledgment + follow-up test and the connection-drop test fail on the merge base (nothing printed, exit 0) and pass here. The other two tests cover `--timeout 0` and `--json`. The existing `agent-via-gateway*.test.ts` suites pass: 4 files, 69 passed + 1 skipped. - **Real Gateway, scripted model (isolated state, dist build):** the model spawns one child and yields; the child answers after 20 s. - Main exits after 1.2 s, and only the thinking-level notice is printed. - This branch prints the acknowledgment and "Waiting on 1 subagent…", then "The helper finished: 17 × 19 = 323." It exits 0 after 21 s, with and without a model-written acknowledgment. - A Gateway restart during the wait printed "Stopped waiting for the subagents. Their result will still be added to session agent:main:…" and exited 1. - **Real model, `gpt-5.4-mini`, CLI Gateway route:** 15 trials on this branch, 0 with no visible output. gpt-5.4-mini yielded in 3 of them, and all 3 printed the acknowledgment and then the subagent's result (323) in the same command. Main: 5 trials, no yield in this sample. The main-side signature above is from the earlier replay. - **Event fan-out probe:** on a real Gateway, the `agent` connection received, without subscribing: the turn's `chat` final with `yielded: true`, the child's lifecycle `end`, and the `announce:requester-settle:…:yield-1` lifecycle `start` and `chat` final on the parent session. Not covered: a mocked or real test of more than one child; Discord and other channels are unaffected by this change.    Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 890c189) Companion audit: #207510 one-shot resource settlement and #208522 global deadline are unrelated to non-JSON empty-payload acknowledgment; skip event follower and Gateway call changes. Release adaptation: Port only the stable non-JSON, empty-payload acknowledgment. Keep payload logging in a small sibling and isolate the new test to respect both line-cap checks. Omit the event follower and all Gateway call changes. Co-authored-by: RomneyDa <[email protected]>
* test(gateway): remove unused metadata entry default (#208164) * chore(ui): refresh control ui locales (#208476) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * test(gateway): remove unused prediction fixture default (#208166) * fix: keep the cached sidebar roster check reliable on a cold worker (#208461) Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 410bb4cf-c29c-4e08-8aab-8c0f0b321532 * fix(ios): match the Fast and Ultrafast bolts in the dial and Speed menu (#207692) * fix(ios): balance the Fast and Ultrafast bolts * fix(ios): keep only the composer bolt change * fix(ios): match the Speed menu bolts and space the closed row like a system icon * fix: restore the sidebar snapshot lint check (#208479) * fix: restore the sidebar snapshot lint check Rename local callback parameters and the scoped reader in the owner-filter fixture. Keep the snapshot, cache behavior and assertions unchanged. Co-authored-by: vyctorbrzezowski <[email protected]> * fix: restore the sidebar snapshot lint check Worked on by: - @vyctorbrzezowski Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: ee953e0e-0c10-83c8-9992-53887f23812a --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]> * fix(ui): show automation actions and the calendar icon in chat (#208475) * fix(ui): show automation actions and the calendar icon in chat * fix(ui): preserve existing scheduler detail formatting * fix(ui): show automation actions in the collapsed chat headline * fix: let Workshop target agents on a remote Gateway (#208457) Resolve an explicit Workshop agent against the selected remote Gateway instead of requiring a client workspace. Preserve local selection, offline fallback, and mutation custody. Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 63c9e22e-6f63-4efb-a0ec-9a70623b7bdc * improve(ios): hop the subagent avatars only when three or more are working (#207687) * fix(memory): avoid rereading unchanged transcripts during offline backfill (#208434) Reuse verified transcript candidates across bounded offline backfill batches. Preserve chronological selection, transcript-order checkpoints, and independent Gateway requests. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 3ee04411-cfd2-494c-8b0d-68089159440d * fix(ios): show the chat's name in the header for older chats (#207685) * test(gateway): remove unused global identity fixture default (#208168) * fix(ios): show the chat's name and actions for older chats (#207694) * fix(ios): show the chat's name in the header for older chats * fix(ios): show the chat's name and actions for older chats * fix: report skipped manual automation runs without timing out (#208453) Record the exact manual attempt alongside its finished event. Leave the deferred occurrence, retry policy, and previous job outcome untouched. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: c301e60c-7efb-49a1-b5cf-5ad85cc72d86 * fix: exercise the parent’s final check in child-handoff tests (#208478) Keep the original requester report and answer the same-turn recheck silently before accepting a Goal nudge or ending the browser scenario. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: ae0be9d4-dfa4-488d-85ee-d876220d04cf * test(gateway): remove unused injection source defaults (#208171) * fix: check the current notice for revoked runs after restart (#208484) Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 44c03bd5-4bf1-426c-8e5d-ac798e8aed01 * chore(ui): refresh control ui locales (#208500) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * test(gateway): remove unreachable approval-reader branches (#208148) * fix: model empty announcements in the stream script checkpoint test (#208482) Keep the default announce policy and report the empty-output suppression from the script runner. Without that outcome the scheduler correctly retains the prior checkpoint because required delivery is unknown. Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 0dfba296-8737-4fe6-840e-34a02b298cce * fix: tell browser users when to retry after throttling Co-authored-by: VACInc <[email protected]> * fix: keep agent work moving past recoverable setup failures Co-authored-by: VACInc <[email protected]> * fix(ollama): preserve model namespaces and custom-provider shortcuts (#208401) Try the configured model name first on custom Ollama providers. Retry the shorter name once when Ollama reports that exact model missing. Classify the bounded response before redacting the diagnostic. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 62864529-04ab-4958-9344-d900f5f5c944 OpenClaw-Publication: 10a0d16a-0d8b-477d-bec9-d5a5646cc8ee OpenClaw-Publication: b9c708fb-a950-4344-ab46-7cc0109d0dbe * fix: keep unrelated work going during background waits Co-authored-by: VACInc <[email protected]> * test(gateway): remove unused request fixture defaults (#208141) * fix: report image size presets without marking them ignored (#208436) Report the preset sent by the image provider and flag returned files whose dimensions differ from that preset. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: d1dd36c3-16e3-4571-9f1c-a7281abfecc0 * feat(ios): show messages with many images as a stack that opens the whole gallery (#207679) * feat(ios): open large photo messages as a stack * fix(ios): restore photo stack preview retries * fix: keep the sidebar reload test’s pins in its owner filter (#208510) Give the fixture’s pinned sessions the active owner so the warm-reload checks exercise the same unselected row and all seven PR badges. Keep production filtering and the handoff assertions unchanged. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 5b3e6d5a-8804-4266-a591-dc4e944e476c * fix(packaging): preserve root Ciao when packing hardlinked dependencies (#201049) Pack npm-selected files from a private copy when a bundled dependency shares inodes with a warm pnpm store. Use the existing bundle restager so the installed root package can resolve patched Ciao and the standalone plugin keeps its own dependencies. Keep npm inventory code outside the Docker packaging CLI's startup imports so an isolated checkout can still parse arguments. Refs #198010, #198011 and #199156. Co-authored-by: Vincent Koc <[email protected]> OpenClaw-Publication: 80f31ad4-a520-8ab8-95ad-dc374a12031e Co-authored-by: vincentkoc <[email protected]> * docs: show where to find run status in Threads (#208486) Document the unread dot on collapsed Threads rows and where to find run status, session kind, and token usage. Readers can use the row menu to manage a session. Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: bed96ea2-9fab-49ae-af48-cc68cfd4e937 * fix: retain callers in main-thread stall profiles (#208503) * fix: stop switching models when a session entry changes during a turn (#208480) Root cause: src/agents/failover-error.ts:63 `RUNTIME_COORDINATION_ERROR_NAMES` does not list the SQLite session-entry conflict errors, so model fallback classifies a local session-entry write conflict as a model failure and moves on to the next model. Fixes #208432 ## What Problem This Solves Sometimes another write changes a session's stored entry while a turn is preparing its own write to it. OpenClaw then raises `SqliteSessionMutationConflictError` ("SQLite session state changed while preparing session-entry.patch"). Model fallback treated that local error as a provider failure. It logged `candidate_failed` and tried every configured fallback model, within milliseconds and before any provider request. The turn then ended on the last fallback, often a small local model, or failed with `UNAVAILABLE` when the chain ran out. The reporter saw 136 false fallback decisions across 64 runs on one gateway. ## User Impact A session-entry conflict no longer switches models. The turn stops at the current model and reports the original conflict error. The transcript-conflict sibling (`SqliteTranscriptMutationConflictError`) already worked this way, and so did session capability metadata changes (#179290). Real provider failures fall back exactly as before. This PR stops the false fallback walk. It does not remove the conflict itself (see Evidence). ## Why This Change Was Made `resolveModelFallbackError` already has one owner for local coordination errors: errors named in `RUNTIME_COORDINATION_ERROR_NAMES` resolve to `coordination`. The fallback attempt then logs `chain_stopped reason=local_runtime_coordination` and rethrows the original error. This PR adds two names: - `SqliteSessionMutationConflictError`, the reported error. - `SessionEntryLifecycleUpsertConflictError`, its lifecycle-upsert sibling. It is the same class of stale-entry conflict and takes the same stop path. Both worker transports rebuild these errors under their real names: `session-actor-storage-result.ts` and `openclaw-state-worker-error-identity.ts`. So the name check matches on the real path, wrapped causes included. Changing models can never fix a stale session snapshot, so whichever writer caused the conflict, walking the chain is wrong. This is the same change as #179312. ## Evidence - Source: on main and in the reporter's 2026.11.10-11.12 dist, `resolveModelFallbackError` returns `unknown` for these errors. `model-fallback-attempt.ts` then returns `{ error }` and starts the next candidate. - Regression: two rows in `src/agents/model-fallback.terminal-boundary.test.ts`, one per error. Each sends the conflict through the state-worker encode/decode (`identifyError`/`createError`) into `runWithModelFallback`. - With the classifier change reverted, they fail: the runner treats the conflict as a provider failure and consults provider failover policy. - With it, `run` is called once, no fallback step or error callback fires, and the original error is rethrown. - Control, built Gateway (main `0118f8b774`) in an isolated container with mock providers: a real HTTP 529 from the primary still gives `candidate_failed ... reason=overloaded` and then `candidate_succeeded` on the fallback (3/3 turns). - Not reproduced: the competing writer. On a built main Gateway I tried: - operator `sessions.patch` label changes during turns. They are admitted through session lifecycle and lose the race themselves. - a second `agent` message into the same session mid-turn. It was rejected. - 15 subagent spawns on a Claude CLI fallback chain. - holding an in-candidate session write open for 1.5-3 s. None produced the conflict. The likely source is the Claude CLI runner's in-candidate compare-and-swap writes reading a cached snapshot. That is storage code and out of scope here. The user evidence is the reporter's production logs: 156 conflicts, 136 `candidate_failed` with one error hash, every candidate failing about 30 ms after the previous one, before any provider call. - Details: https://github.com/openclaw/openclaw/pull/208480#issuecomment-7260755152 Thanks @YK-03 for the fix and @Fahd84110 for the detailed report and log analysis. Merge danger: two-way door. Two entries in an error-name list, no stored state or contract change; a revert fully restores the old routing. Blast radius: only turns that hit these local session-entry conflicts, which now stop instead of switching models. Co-authored-by: Ayaan Zaidi <[email protected]> * fix: tell sessions_send notify callers when the target's event queue is full (#208411) Root cause: src/agents/tools/sessions-send-tool.delivery.ts:98 `sessions_send` notify enqueues through `enqueueSystemEventEntry`, which logs the queue owner's `SystemEventQueueFullError` and returns null, so the tool turns a full queue into the generic "Notification was not queued." Fixes #206751 ## What Problem This Solves When a session already has 20 passive notices waiting (for example notify messages sent while it had no turn), every `sessions_send` with `mode: "notify"` to it fails with "Notification was not queued." The caller can't tell why, or what to do; the reason only shows up as a Gateway log line. ## User Impact The notify result now carries the queue's own explanation: "System event queue is full (20 pending). Let the session process pending events before retrying the notification." Nothing else changes: queue size, which turns drain the queue, and the watch-notice text stay as they are. Other refusals (duplicate notice, replaced store) still return "Notification was not queued." ## Why This Change Was Made The queue owner already throws this error for callers that ask for it (`enqueueRequiredSystemEventEntry`, `enqueueSystemEventWithReceipt`). Notify now asks for it on the passive pool too and returns the message. It doesn't switch to the waking API, so a notify still never starts a turn. The draining part of the report (followups and handoffs never consuming the backlog on 2026.11.6) is already fixed on main by #197725 (699e538939bb) and #197692 (794a6a806ff1), first shipped in 2026.11.10-beta.1. The Gateway run below checks that. ## Evidence Built Gateway in a secretless container with a scripted chat-completions model and the built-in runtime. Agent `main`'s main session gets only internal turns. It watches another session that changes three times, receives 21 notifies from another agent, runs a main-session cron systemEvent job, and then gets a `sessions_send` followup. - main e36ee79bf2df: 19 notifies queued (one slot held by a pending watch notice), then `{"status":"error","error":"Notification was not queued."}` twice. - this branch: the same run, but those two results are `{"status":"error","error":"System event queue is full (20 pending). Let the session process pending events before retrying the notification."}`. - Identical on both: three watch changes produced one notice, which was consumed by its own turn. The cron turn did not consume the passive notices, which is intended. The followup turn adopted all 20 notes, and the next notify was queued. Full proof output: https://github.com/openclaw/openclaw/pull/208411#issuecomment-7258856547 - Regression `sessions-send-tool.admission.test.ts` ("tells the notifying caller when the passive queue is full") fails on main with the generic message and passes here. `system-events.capacity`, `local-request-context.session-notify` and `agent-command.sessions-send-system-events` also pass. Thanks @jaimeehenry for the detailed report and refill timings. Merge danger: two-way door. The change only affects the error text of a refused notify; nothing is stored. Blast radius: `sessions_send` notify callers that hit a full queue. Observed proof lines: https://github.com/openclaw/openclaw/pull/208411#issuecomment-7258856547 Co-authored-by: Ayaan Zaidi <[email protected]> * fix(ui): keep desktop chat Details from failing after shell recovery (#208485) Publish the desktop Details observers without returning the signal setter’s result to Solid. Cover empty-panel discovery with a browser regression. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 747c757b-12c9-4962-85e7-629db68d9ab4 * test(gateway): remove unused request fixture default (#208180) * fix(macos): recover credentials from the legacy app directory (#208315) Use the matching bundled Doctor to migrate supported OpenClaw shared state in the separate Mac identity directory, then retry credential admission. Keep independent native imports read-only. Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: f45adf5e-6357-446d-9889-0d50c265a8af * fix(gateway): keep the access-loss notice out of a reset conversation (#208495) ## What Problem This Solves When an owner removes someone from a shared session while that person's reply is streaming, OpenClaw stops the run and posts "Stopped 1 run started by Carol: their access to this session changed." If the stopped producer is still finishing, that notice is written by a background task. If the owner resets the session right after (`/new`, New chat, `sessions.reset`), the reset can commit before that task runs. The notice then opens the **new** conversation with a line about the old one, and the model reads it in its next prompt. On a real Gateway this happened in 29 of 30 attempts. Cause: the notice is addressed by session key only. Reset keeps the transcript id and rotates the conversation's lifecycle revision. The inject checks only the transcript id, so it cannot tell the retired conversation from the new one. ## Fix The notice holds the incarnation of the conversation its runs were stopped in, using the existing transcript-lease owner (`acquireTranscriptLease(chat, pin, { exact: "lifecycle" })`, the same hold cron occurrences use). - The pin comes from the snapshot the Stop already loads, before the stop. The lease is taken inside the background notice task, after it waits for the stopped producer, and released when the task ends. - The lease's check runs through the inject's existing guard argument, which the transcript write calls inside the append. A reset that commits at any point before the append retires the notice. - A retired conversation skips the notice with one info log line ("the conversation was reset or deleted"). Any other failure keeps the existing warning. Neither reaches the permission writer. - The inject reports a revoked hold as an ordinary failure, so the task asks the lease itself before deciding. - No session-id comparison outside the owner: the session-identity ratchet is unchanged. ## The native Codex mirror after a reset: no code A scratch fixture showed that a stopped Codex turn's native mirror can append after the lifecycle revision rotates. That fixture rotated the revision directly. Through `sessions.reset` on a real Codex turn it did not happen (0 of 10): - Isolated Gateway, native Codex app-server, `openai/gpt-5.4-mini`. A ~1500-word reply was stopped mid-stream and the session reset, either right after Stop or by reset alone. - 0 of 10 runs put the partial in the new conversation; all 10 put it before the reset boundary. Control without reset: the partial is persisted (2 of 2). - Why: reset preempts the active run and waits for its settlement, including the mirror write, before committing (`session-reset-service.ts`, `policy: "preempt"`). Rollover and `/new` preempt the same way; delete waits. - Not checked: the implicit daily/idle freshness rotation during a later turn's admission (`deferImplicitRollover`, `agent-session-patch.ts`; CLI and cron callers). Named here as a residual; no failure observed. ## User Impact - A reset right after removing someone opens a clean conversation. - The old conversation keeps the stopped partial reply. Its notice is not written: that conversation was retired by the reset, and the transcript owner does not append to a retired conversation. - Access removal, its immediate reply, and the stopped run are unchanged. Without a reset, the notice is posted as before. - Incognito sessions: reset deletes them; a notice raced by that reset is dropped with a warning instead of the info line. - A sharing or permission change on the same session in the milliseconds between the notice taking its hold and writing also drops the notice with a warning. Ordinary writes by other members do not affect it. - A failed session lookup in the notice is now logged as a warning; it no longer fails the access-removal request on the path without a retained producer. ## Evidence - `src/gateway/server.participation-access-loss.test.ts` (real in-process Gateway): the notice is held at two points, before the notice task starts and after it took its hold, while `sessions.reset` commits. Both cases are red on the merge base on the assertion (the notice is in the new conversation) and green with the fix (6 of 6 in the file). The existing cases, including the notice without a reset, stay green. - Negative control for the test itself: with the notice's pin temporarily taken at notice time instead of before the stop (so the lease is granted after the reset), the "before the notice task starts" case goes red on the assertion. Reverted; not part of the change. - W16's original race on the real in-process Gateway (release the stopped producer, then reset at once, 5 attempts): notice in the new conversation 0 of 5 with the fix; 29 of 30 on main. - Session-identity ratchet unchanged; core typecheck clean. Co-authored-by: Ayaan Zaidi <[email protected]> * fix: keep plugin migrations out of early update preparation (#208473) ## What Problem This Solves Updating to a build with a lower version label but newer database schemas can run that build's plugin maintenance while the old Gateway is still serving. This can migrate live state before the release trial can restore it, leaving the old build unable to read its own database. ## User Impact Candidates declaring a newer state **or agent** schema wait until their own Gateway is ready before maintaining plugins. Real downgrades keep their existing pre-trial maintenance, including releases without schema metadata; no extra command or prompt is added. This fixes the installed updater only. Shipped beta.1/beta.2 updaters keep invoking the candidate's maintenance command early, and the candidate-side command is unchanged: those beta users can still hit the reported semver-lower/schema-newer migration failure. This PR does not claim to repair that first hop. ## Why This Change Was Made The old branch assumed a lower semantic version could not carry a newer database schema. Read the prepared candidate's existing package schema metadata using the shared parser, and retain the branch only when neither schema exceeds the running build's matching version. Missing metadata preserves the older-release behavior. - v2026.11.11 and v2026.11.12 declare state schema 40 and agent schema 42, so both pass the new schema guard against running state 42 / agent 45. They retain pre-trial maintenance when the existing semver check identifies an actual downgrade; equal/newer versions still bypass this branch. - No launcher changes (format 4), new metadata fields, records, statuses, flags, retries, or scheduling. - Net against the base: production **+14**, tests **+33**, docs **+5** lines. The small guard is necessary to preserve downgrade maintenance while preventing early forward migrations; direction takes precedence over a line-neutral target. ## Evidence - **Red on main `3a8456857492`**, mbp-m5, vitest-source: both schema-newer table cases incorrectly ran maintenance; the real plugin-lifecycle child also reached live-state admission before the trial. Three failures were the intended regressions; the three legacy/equal-version controls passed. Test duration 15.38 seconds. - **Green with this change**, mbp-m5, vitest-source: `ocx test src/update/prepare.test.ts -t 'defers semver-lower|maintains downgrade|already-current'` — **14 passed**, including missing metadata, older schemas, newer state, equal-state/newer-agent, and existing already-current behavior. Test duration 15.21 seconds. - Focused lint: both changed TypeScript files passed (5.30 seconds). Formatting: all three changed files passed (8 ms). - Local ClawSweeper reviewed exact head `e3baa43199d79e5ff9d59dc6abc02457d3101aa7`: complete, patch correct, zero source/security findings. Product-path lane results remain separate evidence. - [Current-head PR CI](https://github.com/openclaw/openclaw/actions/runs/46295242495): **green** on `c25395b4cbd6afcfa5159a22736297153d292418`, after the requested main merge brought in #208479's unrelated UI lint fix. The prior [CI run](https://github.com/openclaw/openclaw/actions/runs/46293669143) encountered that unchanged UI lint failure; no updater edits were needed. Build/type coverage ran in CI; no local broad suite was run. - [Package Acceptance](https://github.com/openclaw/openclaw/actions/runs/46294339408) exercised `e3baa43199d79e5ff9d59dc6abc02457d3101aa7`; this behavior proof is retained after the requested main-only merge: - [Survivor 2026.11.11](https://github.com/openclaw/openclaw/actions/runs/46294339408/job/141452129152): **passed** (18m56s). - [Survivor 2026.11.12](https://github.com/openclaw/openclaw/actions/runs/46294339408/job/141452129260): **passed** (24m40s). - [update-restart-auth, openclaw@latest](https://github.com/openclaw/openclaw/actions/runs/46294339408/job/141452129251): **passed** (29m41s). - Package integrity passed. The overall acceptance run is red only because the unrelated [npm 12 installed-package budget check](https://github.com/openclaw/openclaw/actions/runs/46294339408/job/141449644533) found 47,546 entries against a 47,500 budget (#208295); the aggregate correctly reports that failure. No retry or budget change was made. - Beta baselines are intentionally excluded because their shipped updater is not changed. Co-authored-by: Ayaan Zaidi <[email protected]> * fix: dismiss passkey prompts from the remote Browser panel (#208407) Let a remote Browser panel user dismiss a pending native passkey prompt without reloading the page or losing form input. Keep native passkey sign-in available on the host. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 6312d4d5-5a52-4232-8d8d-5d3176acf091 * fix(android): avoid scanning system CAs before pinned Gateway connections (#208425) Implement Android’s hostname-aware trust-manager overload so OkHttp can validate a pinned leaf without indexing the platform CA store. Delegate platform-trusted chains to Android with the connection hostname. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: e7eceedd-d8ad-4117-a9ab-bf17e1b073c9 * fix: preserve child completion inputs across Gateway restarts (#208367) Reuse the accepted requester attribution for a completion replay under the same operator and session when restart no longer has the original tool caller. Keep exact input and receipt conflict checks. Verify both consumed inputs and the model-visible history delivery in the restart fixture. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: df68cb90-0108-4a28-a654-3645f36fe14e OpenClaw-Publication: 5a817054-c824-4889-8949-154e54475698 * test(gateway): remove unused steering fallback default (#208181) * fix: ask for an agent before Linux Quick Chat sends (#208431) Honor the Gateway roster when Quick Chat requires an explicit agent choice. Pressing Return retains the draft and opens the picker. After the user selects an agent, the next Return sends to that agent's session. Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: ad454f08-fdff-4e14-bd03-471ba86defcc * fix: keep Matrix DM replies in the original thread (#208128) Preserve the case-sensitive Matrix DM thread root in session storage and reply ownership. Doctor restores the existing transcript and its idle local worker placement when Matrix delivery metadata identifies the original thread. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 1838c4b4-deed-4503-b3fb-8b73c0f74e0e OpenClaw-Publication: c478e718-8bb8-857e-be0c-91b9b5998ded * feat: choose where automations run (#201285) Let an automation run in a named conversation, use recent messages as context, or send a result to a selected chat. Save the conversation key so the link survives renaming. Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: a62843b0-acd0-83f5-b79e-f5cbf9cdbb9c Co-authored-by: daniel-lxs <[email protected]> * fix: avoid waiting for immutable update records during Gateway startup (#208471) Related: #208359 ## What Problem This Solves Gateway startup can wait for a SQLite child worker before opening its listener on an adopted immutable installation. A stalled worker can delay startup for its 300-second-plus timeout, even though this startup ownership check was meant to be file-only and best effort. ## User Impact Startup no longer inspects the immutable adoption database before binding. Packaging-owned macOS app, desktop app, and container installs still suppress self-update through `openclaw-install-owner.json`. Immutable layouts without that marker also suppress self-update, whether adopted or unadopted. Immutable installations are updated outside the Gateway service. The existing root/current/release layout detector uses file shape and `lstat` only; startup does not read the adoption record or launch its SQLite worker. Strict update admission is unchanged, including its refusal directing users to run `openclaw update` as root outside the service. ## Why This Change Was Made Replace the worker-backed startup inspection with the existing file-only immutable layout detector; keep packaging marker filtering and best-effort inspection warnings. No new statuses, records, timers, caches, owner fields, or other mechanisms. Whole PR versus main: production net -1 line; tests net +10 lines; total net +9. The follow-up versus reviewed head `bbce2253194c` is production +11 and tests +10. Only the startup module, its existing test, and an export on the existing immutable layout detector change. ## Evidence - Original main-baseline proof on mbp-m5 showed startup called `readImmutableInstallRecord` before bind. - The added immutable-layout regression failed against the pre-follow-up startup code: root, current-symlink, and release-directory entry points all incorrectly advertised `update.run`. - With this follow-up, `ocx test src/gateway/server-startup-plugins.test.ts -t "suppresses immutable self-update|advertises self-update"` passed all 7 selected cases on mbp-m5: three immutable entry points (without an owner marker), three packaging owners, and an unmarked mutable installation. Each immutable case asserts no worker-backed record read. Duration 23.93 seconds, mostly compiler preparation; assertions took 27 ms total. - Changed-file Oxfmt and Oxlint checks passed on mbp-m5 (3 files; 0 lint warnings/errors). - No local full build, full suite, browser click, or real worker timeout was run. CI supplies broad proof. Co-authored-by: Ayaan Zaidi <[email protected]> * fix: keep unrelated tools running when a batch hits the repeat limit Co-authored-by: VACInc <[email protected]> * fix: check recorded automation owners before running (#201287) Check the recorded human owner before scheduled work and process-watcher launches. Scheduled occurrences read the saved owner when the in-memory catalog is cold. An administrator can recover a job whose owner has been removed. Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: 01bffa98-2a33-8d2c-89aa-fcd0156303c7 Co-authored-by: daniel-lxs <[email protected]> * fix(gateway): start under a group-writable HOME when file logs are unavailable (#208499) ## Problem `openclaw gateway run` refuses to start when `$HOME` is group-writable without a sticky bit, which is common for shared container volumes: ``` [gateway] sidecars failed to start: WorkerTaskError: Directory "$HOME" is writable by group or others and has no sticky bit. ... Gateway failed to start: ... ``` `openclaw agent --local` in the same HOME runs normally and only drops file logs with `[openclaw] log directory unavailable; records dropped`. Users affected: containerized and shared-HOME installs. Shipped in v2026.11.10. Cause: the logging transport already decides that an unsafe default log directory means "drop records and warn". One reader bypassed that decision. The Gateway startup summary line `log file: <path>` (src/gateway/server-startup-log.ts) awaits `getResolvedLoggerSettings()`, which rethrows the resolution error. Since #197742 moved resolution into a worker, that await fails Gateway startup. Doctor's reader already caught the same error privately. ## Solution `getResolvedLoggerSettings()` owns the outcome. `file` is absent when the default log directory is unavailable, and it never throws for that. - Gateway startup prints `log file: unavailable`. The transport's existing warning still names the cause and the `chmod` fix. - Doctor drops its private try/catch and reads the same field. The directory safety check itself is unchanged. Temp roots, worker scratch and SQLite staging still refuse unsafe ancestors when they are used. ## Impact - The Gateway starts and runs turns under a group-writable HOME, as `--local` already does. File logs are still dropped, with the same warning. - `openclaw logs` and log tail use separate resolvers and are unchanged. - Not a security regression: config, credentials and state already live under the same HOME, and Gateways before v2026.11.10 started there. ## Evidence - `src/logging/logger-file-transport.worker.test.ts` now runs the existing default-root proof, whose `--disposable-default-root` path no test invoked. Its unsafe-directory step asserts `file` is absent. Red on main (`WorkerTaskError ... no sticky bit`), green here. - `test/e2e/gateway-unsafe-home.built-cli.e2e.test.ts`: built CLI, HOME 0775. The Gateway starts, logs `log file: unavailable` plus the transport's warning with the `chmod go-w` fix, and `agent` completes a turn. - Real CLI repro (built dist, isolated HOME 0775 with state under it, fake OpenAI-compatible server): main 3/3 `Gateway failed to start`; this branch 3/3 Gateway ready, turn completed. - Consumer suites green: doctor-format.test.ts, log-tail.test.ts, logger-settings.test.ts, logger-env.test.ts, server-startup-log.test.ts. - Readers of `getResolvedLoggerSettings()`: Gateway startup summary and Doctor's runtime hints (plus tests). `resolveTarget` rejects only while resolving the default root, and the writer already drops records on every such rejection, so the reader and the writer agree on "unavailable". - `LoggerResolvedSettings` (also exported from `openclaw/plugin-sdk/logging-core`) now marks `file` optional. Plugin SDK impact query (`sdk-export:openclaw/plugin-sdk/logging-core#LoggerResolvedSettings`, ClawHub, 2026-11-29): 0 plugins reference it (coverage 2,332 complete / 421 partial / 30 failed of 2,783); no bundled plugin imports it (`rg` over `extensions/`). No SDK function returns this type, so plugins can only construct it. - Typecheck at this head: `pnpm tsgo:core` clean. `pnpm tsgo:core:test` has one error, in `ui/src/pages/logs/view.test.tsx:21`, which this PR does not touch; it comes from base (#207383/#208163). The built-CLI e2e passes locally (13 s). Co-authored-by: Ayaan Zaidi <[email protected]> * chore(release): close out 2026.11.12 on main (#208158) * chore(release): close out 2026.11.12 on main Co-authored-by: RomneyDa <[email protected]> * fix(release): leave locale refresh to its dedicated workflow Co-authored-by: RomneyDa <[email protected]> * ci: refresh closeout checks after main lint fix Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]> * test(gateway): remove unused steering cancellation default (#208173) * fix: recognize the file format for extensionless path lookups (#208516) Root cause: extensions/oc-path/src/cli.ts:92 `loadOcPathFile` chose the parser only from the address's file hint, so an extensionless address such as `oc://alias/count` was parsed as Markdown even when `--file settings.json` named a JSON file. Fixes #208496 Thanks @LinzeShi for the report and the fix. ## What Problem This Solves A caller can reuse an address such as `oc://alias/count` and point it at a JSON file with `--file settings.json`. Even when the file contains `count`, `path resolve` and `path find` report no match and `path set --value-json` refuses the edit. `path emit` already identifies the same file as JSON. ## Fix The shared loader now falls back to the file name when the address has no recognized extension: `kind = addressKind ?? inferKind(absPath)`. `resolve`, `find` and `set` all load through it. A format in the address still wins, so `oc://x.json/count --file snapshot.txt` keeps reading JSON. An unknown file extension with no address hint still parses as Markdown, as before. ## Tests One table-driven case in `cli.test.ts` runs resolve, find and a real `set` for both directions (extensionless address on `settings.json`, red on the merge base; JSON address on `snapshot.md`). The near-duplicate `CLI-R04` YAML resolve smoke test was removed: `CLI-F01` already resolves YAML leaves from the workspace. This keeps the file under its line cap. ## Evidence Built CLI (`pnpm build`, `node openclaw.mjs path ...`) in a clean container with only the oc-path plugin enabled, merge base `0ebe414929fc` vs this branch. Output is in the evidence comment linked below. - Base: `resolve oc://alias/count --file settings.json` -> exit 1 `resolved:false`; `find 'oc://alias/*'` -> 0 matches; `set ... 2 --value-json` -> `not-writable`. - Fix: resolve -> `valueText "1"`; find -> `oc://alias/count`; set -> exit 0, file is now valid JSON `{"count":2}`. - Unchanged on both: `oc://x.json/count --file snapshot.txt` (JSON, resolve and set), `--file data.unknownext` (no match, emit kind `md`), Markdown frontmatter resolve/set through `oc://AGENTS.md/...` and `oc://alias/...`. Evidence comment: https://github.com/openclaw/openclaw/pull/208516#issuecomment-7261291447 ## Merge danger Two-way door: a revert fully undoes it. No stored state, config or contract change. Blast radius: `openclaw path resolve|find|set` when the address has no recognized extension and `--file` has one. Co-authored-by: Ayaan Zaidi <[email protected]> * fix: keep automatic Activity recaps on the session provider (#208460) Derive the utility route from the same session model and account used for dashboard titles. Preserve configured utility fallbacks and the no-primary-retry policy when the recap chain is exhausted. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 0e68b312-2003-42fd-88df-918a4c915065 * fix: keep the draft caret when closing chat search (#208428) Restore the rich editor’s selection when transcript search closes. Keep the original shortcut control as the focus target and fall back to the composer if that control was removed. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: a91ce076-21d5-4792-8b57-8d51daf9370a * fix: point automations to their signed-out account (#208493) Keep an unavailable fallback model from masking the recorded account refusal. Preserve the catalog miss for the fallback itself and leave cross-provider jobs scheduled. Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 97c31b82-4f5b-4790-bc72-b34b555bb286 * fix(cli): one run deadline for openclaw agent on both routes (#208522) ## What Problem This Solves One command, two deadlines. Without `--timeout`: - `openclaw agent` through the Gateway sent a CLI fallback of **600 s** (`--timeout ?? agents.defaults.timeoutSeconds ?? 600`) as the run's per-attempt deadline. At 600 s the Gateway aborted the attempt and the run ended with `timeoutPhase: "provider"` and "Request timed out before a response was generated". - `openclaw agent --local` resolved `agents.defaults.timeoutSeconds`, which defaults to **48 hours**, as Gateway turns and cron do. - `openclaw agent exec` hardcoded **600 s**. So long coding tasks finished with `--local` and were cut at 10 minutes through the Gateway. In a long-task coding evaluation (DeepSWE), 3 of 5 Gateway-route trials ended at 607–608 s, while `--local` trials of the same tasks ran 1,084–2,279 s without a cut. The 600 s dates from when the CLI waited on a bounded client timer. That wait has been unbounded for a long time (the CLI waits for the Gateway's terminal result), but the 600 kept travelling as the run's own deadline. Three related bugs come from the same CLI-side value: 1. **Remote Gateway config was overridden.** The CLI sent the CLI host's `agents.defaults.timeoutSeconds`, so a remote Gateway's own setting never applied to CLI turns. 2. **Subagent timeouts were shadowed.** The Gateway gives a turn into a live registered subagent session that subagent's `runTimeoutSeconds` only when the request carries no timeout. The CLI always sent one. 3. **The docs matched only one route.** They said "default 600" for `openclaw agent`, which was true on the Gateway route and false with `--local`. ## Fix `resolveAgentTimeoutMs` (`agents.defaults.timeoutSeconds`, default 48 h) is now the only owner of how long `openclaw agent` and `openclaw agent exec` run, on both routes. - The Gateway route sends `timeout` only when `--timeout` is given; the Gateway resolves the default exactly as for every other turn. - `agent exec` no longer hardcodes 600; without `--timeout` its embedded run resolves the same default. - The CLI's wait for a yielded turn's subagents has no deadline unless `--timeout` is given. It still ends on the follow-up reply, Ctrl-C or disconnect. - Removed the stale transport hint "use --timeout <seconds> to extend the CLI wait". - Help text and docs now state one default for every route: `docs/cli/agent.md`, `docs/tools/agent-send.md`, `docs/gateway/cli-backends.md`, `docs/tools/autoreview.md`, `docs/plugins/codex-harness-reference/timeouts.md`. `--timeout N` behaves exactly as before on both routes, including `0` (unlimited). ## Behavior change - **Old:** without `--timeout`, `openclaw agent` through the Gateway and `openclaw agent exec` stopped each model attempt at **600 s (10 minutes)**. - **New:** they use `agents.defaults.timeoutSeconds`, which is **48 hours** unless configured, the same deadline as `openclaw agent --local`, Control UI and channel turns, and cron. - **To keep the old cap:** pass `--timeout 600`, or set `agents.defaults.timeoutSeconds: 600` in the config (the Gateway's config on the Gateway route). - **Accepted cost:** a script or CI job that relied on the implicit 600 s cap and passes no `--timeout` loses it. A run that neither stalls nor repeats can then run until 48 hours or the job's own limit. Stalled and looping runs are still stopped by the model idle timeout (120 s without output) and the existing loop guards. - **The timeout message** now names the limit that fired and how to raise it: "…the run reached its 10m limit. Please try again, or raise the limit with `--timeout <seconds>` for `openclaw agent`, or `agents.defaults.timeoutSeconds` in your config." ## User Impact - Long tasks through the Gateway are no longer stopped at 10 minutes; `--local` is unchanged. - **Default change:** Gateway-route `openclaw agent` and `agent exec` without `--timeout` now get `agents.defaults.timeoutSeconds` (48 h unless configured) instead of 600 s. Scripts that relied on the implicit 10-minute stop should pass `--timeout 600`. - Autoreview passes launched without a helper timeout can now run up to `agents.defaults.timeoutSeconds` (48 h unless configured) instead of 600 s; helpers that set a timeout are unchanged. - A scripted `openclaw agent` whose yielded turn waits on subagents now waits until they settle (or Ctrl-C/disconnect) instead of exiting 1 at 600 s; pass `--timeout` to bound that wait. - A dead provider is still caught by the model idle timeout (120 s without output). A looping agent is bounded by the configured run deadline and the existing runaway guards. - If the CLI process is killed with SIGKILL or its connection drops, an accepted Gateway run continues and its result is added to the session (accepted execution is bound to the Gateway lifetime, not the caller's connection). Ctrl-C/SIGTERM still sends `chat.abort`, as before. ## Evidence - Red on the merge base, green with the fix: - `src/commands/agent-via-gateway.deadline.test.ts`: without `--timeout`, the Gateway request carries no `timeout` for a local and a remote Gateway (main sent 600 from the CLI host's config). - `src/commands/agent-exec.test.ts`: `agent exec` without `--timeout` passes no timeout to the run (main passed "600"). - `src/cli/program/register.agent.test.ts`: `agent exec fix` without `--timeout` reaches the command with no timeout (main's Commander default injected "600"). - The Gateway already gives a timeout-less request into a registered subagent session that subagent's budget (`agent.session-followup` suite, unchanged). - Affected consumers rerun green: `agent-via-gateway.test.ts`, `agent-via-gateway.yield.test.ts`, `register.agent.test.ts`. - Real-product evidence: the long-task evaluation above (Gateway route 3 of 5 trials cut at 600 s; `--local` none cut). - `src/agents/embedded-agent-runner/run/terminal-timeout.test.ts`: the provider timeout message names the limit that fired (from the run's deadline), `--timeout <seconds>` and `agents.defaults.timeoutSeconds`. Co-authored-by: Ayaan Zaidi <[email protected]> * test(gateway): keep restart recovery fixtures under Gateway ownership (#208302) The shared test harness sets VITEST, which skips the singleton lock. In the restart-resume and yield-restart CI failures, offline SQLite maintenance took the state database while a live Gateway was resuming work. Clear both test markers for those child processes and verify the replacement Gateway owns the lock in the existing SIGKILL case. * chore(ui): refresh control ui locales (#208547) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: reply to agent turns whose session key has uppercase letters (#208435) ## What Problem This Solves `openclaw agent --local` stops with no reply and no error when the session key contains an uppercase letter. Examples are a Slack channel id (`agent:main:channel:C0123ABCDEF`) or a mixed-case DM name (`agent:main:dm:Dana-Okafor`). - No model request is made. Stdout is empty. Node prints only `Warning: Detected unsettled top-level await` and exits with code 13. - Scripts, CI jobs, cron and evaluation harnesses that drive one-shot turns get nothing back. - The OpenAI-compatible HTTP endpoints (`/v1/chat/completions`, `/v1/responses`) with an uppercase `x-openclaw-session-key` never answer: the request hangs in the Gateway. - Lowercase keys, and the Gateway `agent` route, work. Regression from #175837 (one session controller for turns, queues and Stop), first released in v2026.11.5. 2026.10.x and 2026.11.1-11.4 reply normally. On the commit before #175837, both spellings reach the model step; on #175837, the uppercase spelling hangs. ## User Impact - One-shot `agent --local` turns and OpenAI-compatible HTTP requests with mixed-case session keys run and reply again. - They reach the same session as the lowercase spelling, as the Gateway route already does. - `--json` output now reports the stored (canonical) spelling of the session key, which is the spelling the Gateway route already prints. - Signal group ids and Matrix room ids keep their case. Two peers whose ids differ only by case stay two separate sessions. ## Why This Change Was Made The agent command claims a session twice, under two spellings of the same key: - `resolveSessionKeyForRequestInternal` (`src/agents/command/session.ts`) read the store with the canonical key (`normalizeStoreSessionKey`) but returned the request spelling. - The outer turn (`agentCommandInternal` → `withSessionTurn`) claimed the session under that request spelling. - The nested embedded run claims it under the canonical store key. - The session controller matches aliases exactly, so the nested claim did not join the outer turn. Both claims share the session id, so the nested claim queued on the same controller entry behind the outer turn and waited for it forever. - Nothing else was pending, so a one-shot Node process drained its event loop and exited 13. A Gateway process kept the HTTP request open instead. The fix returns the canonical key from the resolver's final path, as its session-id paths already do. `resolveSession`'s second normalize is removed. A request spelling no longer reaches the session controller. #142746 chose to keep the request spelling ("routing keeps the request key"). That choice was harmless until the session controller started matching aliases exactly. The table test that pinned the request spelling now pins the canonical locator, with a note that it supersedes #142746. Caller audit: | Reader | Effect | |---|---| | `resolveSession` → agent command (`--local`, Gateway ingress, HTTP, plugin runtime, hooks) | Gets the canonical key. The Gateway `agent` route already canonicalized, so it is unchanged. | | `resolveSessionKeyForRequestCore`: `session-bootstrap.ts` backfill and Gateway `agent-request-routing.ts` | Inputs are session ids only. These take the session-id paths, which were already canonical. Unchanged. | | `resolveSessionKeyForRequestCore`: `agent-via-gateway.ts` (Gateway route, non-agent-shaped keys) | The result is sent to the Gateway, which canonicalizes it with the same codec. No behavior change. | | `resolveExistingSessionKeyForRequest` (`run-session-target.ts`, `agent-request-routing.ts`) | Session-id lookups. Unchanged. | | `--deliver` | Targets come from `--to`/`--channel` or the session entry's stored route (`resolveAgentDeliveryPlanWithSessionRoute`), not from parsing the key. The outbound session key now equals the runner's key. The Gateway route already passed canonical keys here. | | `--json` | Prints the canonical spelling (the Gateway route already does). | ## Entry point audit: one canonicalizer There is one codec that turns a caller's session key into the stored spelling: `normalizeSessionKeyPreservingOpaquePeerIds` (`packages/session-url-contract/src/session-key-normalization.ts:117`). It lowercases the key except Signal group ids and Matrix room ids. Every other name is a thin wrapper over it: - `normalizeStoreSessionKey` (`src/config/sessions/store-entry.ts:16-18`) returns `normalizeSessionKeyPreservingOpaquePeerIds(sessionKey)` and nothing else. - `parseAgentSessionKey` (`session-key-normalization.ts:160-164`) parses the codec's output. `toAgentStoreSessionKey` (`src/routing/session-key.ts:91`) uses that parse and the codec. - The Gateway's `resolveSessionStoreKey` / `resolveSessionStoreIdentity` (`src/gateway/session-store-key.ts:144`, `:255`) call the codec directly. The nested embedded run always claims the session under this spelling (`src/agents/embedded-agent-runner/run/session-bootstrap.ts:328-338`), so every outer claim must use it too. | Entry point | Path to the session claim | Calls the codec? | |---|---|---| | Gateway `agent` | `src/gateway/agent-turn/agent-request-routing.ts:252` uses the store identity from `session-store-key.ts:255` → `agentCommandFromGatewayIngress` → `resolveSession` | Yes, already on `main` | | `agent --local` | `src/commands/agent-via-gateway.ts:845` → `agentCommand` → `src/agents/command/prepare.ts:242` `resolveSession` → `src/agents/command/session.ts:475-486` | **This PR.** `main` returned the typed spelling. Red-on-main test. | | `/v1/chat/completions` | `src/gateway/openai-http.ts:437` (raw header or `user` key) → `src/gateway/openai-compatible-agent-run.ts:177` → `resolveSession` | **This PR.** Red-on-main test. | | `/v1/responses` | `src/gateway/openresponses-http.ts:272` → `openai-compatible-agent-run.ts:177` → `resolveSession` | **This PR.** Red-on-main test. | | Hooks and webhooks | `src/gateway/server/hooks.ts:315` runs a cron turn with `session:<key>`; `hooks.ts:449` builds its queue key with `resolveCronAgentSessionKey` | Yes, already on `main`, through the cron row | | Cron session targets | `src/cron/session-target.ts:29` → `src/cron/isolated-agent/run-prepare.ts:150` → `src/cron/isolated-agent/session-key.ts:15` `toAgentStoreSessionKey` (run: `agent:main:hook:GitHub-PR-1` → `agent:main:hook:github-pr-1`; `agent:main:signal:group:AbC123` unchanged) | Yes, already on `main` | | `sessions_send` by key | `src/agents/tools/sessions-send-executor.ts:334` `resolveSessionStoreKey`, then the Gateway `agent` method (`sessions-send-tool.delivery.ts:483`) | Yes, already on `main` | | ACP via the agent command or channel dispatch | `src/agents/command/prepare.ts:321` (`acpResolution` from `resolveSession`'s key); `src/auto-reply/reply/dispatch-acp.ts:127` (resolved ACP key) | Yes (agent-command ACP turns through this PR) | | ACP control plane | `src/acp/control-plane/manager.utils.ts:63-85` `resolveAcpSessionTarget` and `acpSessionActorKey` | **This PR.** `main` lowercased with a plain `toLowerCase` before the store codec, which merged case-distinct Signal/Matrix peers into one actor and pointed a mixed-case key at its lowercase neighbor's row. Both now use `normalizeStoreSessionKey`. Red-on-main test. | Also in this PR, `resolveSessionKeyForRequestInternal` normalizes before main-alias matching. `agent:main:MAIN` with a custom `session.mainKey` now reaches the configured main session instead of a separate `agent:main:main` row (red-on-main test). No other listed entry point bypasses the codec. ## Evidence Reproduced on `main` (2cd6be7e) through the published entry point (`node openclaw.mjs agent --local … --json`), with an isolated state dir and no provider (a turn that reaches the model step ends in a visible `Unknown model` error): - 8 of 8 runs with uppercase keys exited 13 with empty stdout and made no model request. 4 of 4 runs with lowercase keys reached the model step. - Swapping case moves the failure: `agent:main:channel:c3tt2oeiaj7` works and `agent:main:dm:Marcus-Lindqvist` fails, so the trigger is case, not the channel kind. - With a local fake OpenAI-compatible provider: `--local` with a lowercase key replied "OK"; with an uppercase key it exited 13 with 0 provider requests. The Gateway `agent` route with the uppercase key replied "OK". `POST /v1/chat/completions` with `x-openclaw-session-key: agent:main:openai:HttpUpper-ABC` got no response in 60 s (0 provider requests); the lowercase spelling answered 200. - An `async_hooks` trace located the pending promise in `claimSessionControllerTask` (the nested claim waiting behind the outer turn on the same controller entry). A probe showed the outer key `…Marcus-Lindqvist` and the nested key `…marcus-lindqvist`. Tests (red on the merge base, green on this branch): - `src/agents/command/session.exact-target.test.ts`: the resolver returns the persisted locator (ULID, Slack-style channel, mixed-case DM and case in the `agent:Main:Signal` prefix are red on base). Both spellings continue the same session. Signal and Matrix opaque peer ids keep their case. Peers that differ only by case (`signal:group:AbC123` / `abc123`, and the same for Matrix) stay separate sessions with separate entries and session ids. That test is green on base too: main already keeps them apart, and this change keeps that. - `src/commands/agent-local.session-key-case.test.ts`: real `agent --local` turns against a fake provider, each bounded by a 45 s race. The Slack-style channel and mixed-case DM rows are red on base ("did not settle"). The case-only Signal pair runs two turns with two distinct sessions. - `src/gateway/openai-compatible-session-key-case.server.test.ts`: `/v1/chat/completions` and `/v1/responses` with an uppercase `x-openclaw-session-key`. Both are red on base ("did not answer" within 45 s). On this branch both reach the model step. - `src/acp/control-plane/manager.utils.session-key-case.test.ts` (new): case-distinct Signal group and Matrix room pairs resolve to distinct ACP targets and actor keys, and the mixed-case target finds its own persisted row. Both rows are red on the merge base, where the targets came out lowercased and merged. - `session.exact-target.test.ts` main-alias rows: `agent:main:MAIN` / `agent:main:Main` with `session.mainKey: "work"` resolve to `agent:main:work`. Red on the merge base, which returned `agent:main:MAIN`. - ACP consumers green after the ACP change: `manager.test`, `manager.initialize-session`, `manager.cancel-session`, `manager.runtime-handle-ensure.reset`, `agent.acp`, plus the three session-key-case files (6 shards). - Consumers rerun green: `session-store`, `session.yielded-parent-reuse`, `agent-command.live-model-switch`, `embedded-agent-runner.e2e`, `session-bootstrap.detached`, `session-suspension`, `agent.session`, `agent-via-gateway` (8 shards). - `pnpm check:changed`: typecheck, lint, format and guards pass. The dead-export scan fails on five exports this change does not touch (the same on `main`). The same CLI reproduction on this branch: all 12 runs reach the model step and end with the visible `Unknown model` error (exit 1, JSON on stdout). None exits 13. | case | session key | exit | stdout | wall | stderr marker | |---|---|---|---|---|---| | lower 1 (fresh) | agent:main:dm:marcus-lindqvist | 1 | 260 B | 8s | Unknown model: openai/gpt-5-mini | | upper 1 (after DM) | agent:main:channel:C3TT2OEIAJ7 | 1 | 260 B | 5s | Unknown model: openai/gpt-5-mini | | upper 2 (repeat) | agent:main:channel:C3TT2OEIAJ7 | 1 | 260 B | 6s | Unknown model: openai/gpt-5-mini | | lower 2 (same session, lowercase) | agent:main:channel:c3tt2oeiaj7 | 1 | 260 B | 11s | Unknown model: openai/gpt-5-mini | | upper 3 (mixed-case DM) | agent:main:dm:Marcus-Lindqvist | 1 | 260 B | 6s | Unknown model: openai/gpt-5-mini | | upper 4 (mixed-case DM repeat) | agent:main:dm:Marcus-Lindqvist | 1 | 260 B | 6s | Unknown model: openai/gpt-5-mini | | lower 3 | agent:main:dm:marcus-lindqvist | 1 | 260 B | 9s | Unknown model: openai/gpt-5-mini | | upper 5 (fresh state, first turn) | agent:main:channel:C3TT2OEIAJ7 | 1 | 260 B | 7s | Unknown model: openai/gpt-5-mini | | upper 6 (Slack-style) | agent:main:slack:channel:C0123ABCDEF | 1 | 260 B | 9s | Unknown model: openai/gpt-5-mini | | upper 7 | agent:main:dm:Dana-Okafor | 1 | 260 B | 10s | Unknown model: openai/gpt-5-mini | | upper 8 (case in prefix) | agent:Main:Channel:C3TT2OEIAJ7 | 1 | 260 B | 12s | Unknown model: openai/gpt-5-mini | | lower 4 | agent:main:channel:c0123abcdef | 1 | 260 B | 8s | Unknown model: openai/gpt-5-mini | Merge danger: two-way door. No stored data, schema, config or protocol changes. Stored session rows already use the canonical key, so a revert restores the old behavior exactly. Blast radius: every caller of the agent command that passes a mixed-case session key. Co-authored-by: Ayaan Zaidi <[email protected]> * fix(release): keep Doctor deprecation deadlines from blocking frozen release sources (#207875) Release npm preflight now enforces the Doctor deprecation registry as of the source's main merge base, through a trusted harness preload. Deadlines reached after a release line leaves main are reported as warnings instead of blocking publication. Main CI and PR guards keep wall-clock enforcement. Co-authored-by: RomneyDa <[email protected]> * fix: show who answered a recovered Linux Quick Chat message (#208515) Keep the original agent's display name with a Quick Chat send so a recovered reply shows who answered when the Gateway default changes. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 31cd1031-73b1-4ad1-8770-1aa7c5fb79f9 * fix: keep fork compaction off the parent’s Claude account (#208415) Check the selected Claude account against the saved native session before manual compaction, including after a restart. A fork can compact on its selected account after its first ordinary turn establishes a native session there. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 34da9584-a62a-4ed5-8cf3-a0b3e6387e25 OpenClaw-Publication: 4527fb28-07bf-43c1-854e-e4a27bd33b16 * fix: keep images for unlisted Ollama Cloud vision models (#208531) Inspect the selected tag through the configured daemon without pulling it. Keep the previous fallback when the daemon cannot describe an unlisted cloud model. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 374db0dd-bba5-450f-b42d-fed88841557f * fix(agents): seed the first persistent turn after a one-shot run (#208502) ## Problem A one-shot run (`openclaw agent --local`, `agent exec`) in a non-empty workspace blocks the first persistent conversation there for 24 hours. Repro on main with the built CLI and a fake model: 1. `openclaw setup --baseline --workspace .` in a project directory holding `README.md` (git or not) 2. `openclaw agent --local -m hi`: works 3. `openclaw gateway run`, then `openclaw agent -m hi`: fails before any model call with `OpenClaw workspace appears to have disappeared after a recent initialization ... | WORKSPACE_VANISHED` The same project without step 2 works. Users affected: anyone who tries a one-shot turn in a project workspace and then uses the Gateway, Control UI or a channel. The skip-then-seed sequence also happens without a Gateway: `agent exec`, then any persistent chat. Cause: in `ensureAgentWorkspaceOwned` (src/agents/workspace.ts), the no-seed branch writes a disappearance attestation for any non-empty workspace without initializing it. Since #206477, every one-shot run takes that branch. The seeding branch then sees no persona files, reads the fresh attestation as "OpenClaw initialized this workspace", and refuses as if the workspace had been wiped. Shipped in v2026.12.1-beta.2. ## Solution One owner, one meaning: only a workspace OpenClaw initialized can vanish. "Initialized" is the existing setup-state marker (`bootstrapSeededAt` / `setupCompletedAt`). That marker lives in SQLite (`workspace_setup_state`, src/agents/workspace-state-store.kernel.ts:69-75), outside the workspace, so `git clean` or a lost mount cannot remove it. Legacy in-workspace state is never parsed at runtime (src/agents/workspace-legacy-state.ts:1-2). The brand-new path in `ensureAgentWorkspaceOwned` now: - refuses when the marker is present and either the attestation or the setup state is recent. This keeps the vanished-workspace guard (#88333) for a lost mount, `git clean -fd`, `git stash -u` and a wipe that leaves project files. Recent setup state without an attestation was already refused further down, by `clearExpiredState`; the refusal now happens explicitly at this decision. - seeds normally when there is no marker. The attestation then came from a no-seed run, and the workspace was never initialized. A no-seed attestation also stops steering the first seeding turn: - The first seeding turn no longer reads attestation hashes when it decides whether setup is complete. In that branch there is no marker, so any attestation came from a no-seed run and never recorded seeded files. Paths that run with a marker (survival evidence, completion repair) still read the hashes, as before. - The "recently attested customization" shortcut is removed. It could fire only without a marker, so a project `AGENTS.md` skipped `BOOTSTRAP.md` after a one-shot turn but not without one. - An expired attestation alone no longer marks a brand-new workspace as "reseeding expired state"; only the marker does. Before, a git project seeded `BOOTSTRAP.md` after 24 h but not before. Writers of an attestation without a setup marker (all in the no-seed branch, src/agents/workspace.ts:589-623): one-shot runs (`agent --local`, `exec`), `agents.defaults.skipBootstrap`, and agent creation with deferred initialization (the Template add flow, src/templates/gateway-add-apply.ts:199-203). That branch writes no persona files, only a purpose `AGENTS.md` when a purpose is given, so a never-initialized workspace has no OpenClaw identity to lose. `rg deferInitialization` finds no production caller that combines a purpose with deferred agent creation (`agents-onboarding.ts` defers a session, not agent creation). All of these writers now read the same way at the first seeding turn. No schema change, no new parameter, no new state. ## Impact - `--local`/`exec` followed by a Gateway or chat turn in a project workspace works. The first persistent turn seeds the same files and setup state as it does without the one-shot turn. - Initialized workspaces still refuse with the same messa…
…he Gateway (#208755) ## What Problem This Solves `openclaw agent --json` through the Gateway returns too early when the agent hands work to a subagent and yields (`sessions_yield`). The CLI prints the yielding turn's envelope (`status: "ok"`, `result.payloads: []`, `result.meta.yielded: true`, `result.requesterContinuationSettled: true`) and exits 0 before the subagent reports and the session resumes. A script, CI job or orchestrator then tears down or moves on while the real work is still pending. Text mode already waits (#207491), and `--local --json` waits too. Reproduced on main (9389d99) through a real isolated Gateway and a scripted model: the turn spawns one child and yields, the child answers after 8 s. | route | exit | time | resumed turn | |---|---|---|---| | Gateway `agent --json` | 0 | 8 s | reaches the model after the CLI exits | | Gateway `agent` (text) | 0 | 24 s | before exit | | `agent --local --json` | 0 | 23 s | before exit; prints the yielding turn's envelope | ## Solution `--json` now uses the same wait as text mode: the existing `createYieldFollower` in `src/commands/agent-gateway-reply.ts`. The two `json ||` early returns are gone. - `--json` writes one document after the follow-up settles: the yielding turn's response, with today's fields. That is the same timing as text mode and `--local --json`. - If the follow-up fails or is aborted, or the wait ends early (explicit `--timeout` or a dropped connection), `--json` writes the documented `ok: false` failure envelope (with `runId` and `origin: "gateway"`) instead of an empty success, prints the same stderr line as text mode, and exits 1. - `SIGINT`/`SIGTERM` during the wait keep the documented signal exit status (130/143) and write nothing to stdout, like any interrupted run: the CLI's signal exit owner exits before the command returns. Text mode behaves the same on main. Not a success, so no empty-success case remains. - No new field, flag, timer, RPC or second envelope. No change to `sessions_yield`. The follow-up's reply text is not added to the `--json` document. The resumed turn is a separate Gateway run, and its full envelope (`result.meta`, `deliveryStatus`) reaches only the in-process announce caller; nothing on the CLI connection supplies it. Putting it on stdout needs a Gateway protocol decision and is out of scope here. The reply is in the session, as with `--local --json` today. ## Bounds - The CLI adds no deadline. The wait ends on the follow-up's terminal `chat` event, an explicit `--timeout` (text-mode rule from #207491), a signal or connection loss. - Without `--timeout`, the follow-up run gets the Gateway's resolved run deadline (`resolveAgentTimeoutMs`, `agent-turn-source-admission.ts:250`). - Accepted edge, inherited from text mode and not changed here: a native subagent spawned without `runTimeoutSeconds` has no run deadline by default (`agents.defaults.subagents.runTimeoutSeconds`, 0 = no timeout, documented in `docs/tools/subagents/tool-reference.md`). Such a child, or a settle wake the Gateway loses while it stays up, keeps a `--json` wait without `--timeout` open until a signal or disconnect. Bounding that from the CLI would need either a CLI-side deadline (a second owner, which #208522 removed) or a Gateway-supplied deadline (protocol). A child with a deadline is bounded: in the repro, a child with `runTimeoutSeconds: 10` timed out, the session resumed, and the CLI exited. ## User Impact - `openclaw agent --json` against a Gateway returns after the resumed turn settles, with exit 0, or exits nonzero with the standard failure envelope when the follow-up fails or the wait ends early. It never returns an empty success at the yield. - Text mode and `--local` are unchanged. ## Evidence - Red on main, green here: `src/commands/agent-via-gateway.yield.test.ts`. The three `--json` cases (reply, failed follow-up, aborted follow-up) fail on main (the CLI stopped waiting before the follow-up) and pass here. The other `agent-via-gateway*` and agent CLI suites pass. - Real CLI and Gateway: new case in `test/e2e/agent-route-parity.built-cli.e2e.test.ts`. A scripted model spawns one child and yields; the child answers once the CLI exits or after 3 s. Main dist: the CLI exits before the resumed turn (red). This branch's dist: the resumed turn runs while the CLI waits, stdout is one JSON document with `result.meta.yielded: true`, exit 0 (green). - Real CLI and Gateway, scripted model, isolated state, this branch's dist: - spawn, yield, child answers in 8 s: `agent --json` exits 0 at 16 s, after the resumed turn's model call (main: exit 0 at 8 s, before it); - Gateway stopped during the wait: exit 1, stdout is `{"ok": false, "runId": "…", "origin": "gateway", "error": {"type": "cli_error", "message": "Stopped waiting for the subagents. Their result will still be added to session agent:main:main."}}`, the same line on stderr; - `SIGTERM` during the wait: exit 143, empty stdout (no truncated document; nothing is written on that path). - Docs: `docs/cli/agent.md` notes, `docs/tools/agent-send.md`. Co-authored-by: Ayaan Zaidi <[email protected]>
…204313) After mid-turn compaction, the retry that crosses the compaction boundary continued through a hidden user turn ("Continue the current task from the existing transcript…") plus a runtime carrier. That prompt was persisted. Every such retry added another hidden user turn, and the user's own question was gone from history: compaction had summarized it as part of the split turn. - The question the user asked stays in the conversation history after compaction. The next turn sees it verbatim, instead of a hidden "continue" instruction. - No hidden continuation turn is added after compaction when the user's turn can be replayed. - The next turn's request extends the retry request byte for byte, so the provider prompt cache keeps working across the turn. - **One owner decides the retry mode.** `continueFromCurrentTranscript` (`session-prompt-state.ts`) now replays a persisted keyed user turn in place unless the attempt left an unsettled tail (partial output, or an operator abort mid-flight; callers pass `unsettledTail`). The caller-chosen `replayCurrentUserTurn` option is removed. The hidden prompt stays only for non-replayable turns. - **The replayed turn is written where the model sees it.** `persistCompactedCurrentUserTurnReplay` (`pre-persisted-user-turn.ts`), called from the replay branch of `prepareEmbeddedAttemptSessionBoundary`, appends the turn after the kept tail when a compaction summarized it. The original row keeps the turn key, because the transcript identity index is unique per session. The copy uses a key derived from the turn key and the compaction entry id, so repeated retries after the same compaction write it once, and a second compaction writes one new copy. It is `display: false`, so the chat still shows the question once. - **Submission replays that row in place.** `resolveCurrentUserTurnContextKey` returns the key under which the current turn sits in live context (its own row or its replay copy). Prompt submission and the compaction budget use it, so a later retry (for example after a rate limit) reuses the copy and its carrier instead of appending the question again. - Accepted edge, no code: if the process crashes between the compaction commit and the copy's write, the restart writes no copy for that run. The question stays in the original row and in the summary. Real-API replay (gpt-4.1-mini, captured wire pair: the retry after compaction, then the first request of the next turn; fresh seed and cache key per trial). The metric that does not depend on request length is whether the next turn reuses the whole cacheable retry prefix. | Arm, trial | Retry input | Next-turn input | Next-turn cached | Next-turn uncached | New tokens in next turn | Retry prefix fully cached | Question in next-turn history | |---|---|---|---|---|---|---|---| | main, 1 | 9,071 | 9,153 | 8,960 | 193 | 82 | yes | no (hidden prompt instead) | | main, 2 | 9,073 | 9,155 | 8,960 | 195 | 82 | yes | no | | this PR, 1 | 8,995 | 9,077 | 8,832 | 245 | 82 | yes | yes | | this PR, 2 | 8,998 | 9,080 | 8,832 | 248 | 82 | yes | yes | | this PR, 3 | 8,999 | 9,081 | 8,960 | 121 | 82 | yes | yes | | this PR, 4 | 8,993 | 9,075 | 8,832 | 243 | 82 | yes | yes | | replay without persistence (rejected design) | 9,007 | 9,059 | 7,936 | 1,123 | 52 | no (breaks at the user turn) | no | - The provider caches in 128-token blocks. Next-turn uncached = the 82 new tokens (the same in both arms) + the retry's tail inside its last partial block. That tail depends only on where the retry length falls, not on changed bytes. - "Fully cached" means the next turn caches as much as resending the identical retry request. The control resend caches 8,832 for this PR's retry (8,996 tokens) and 8,960 for main's (9,072 tokens, 76 tokens longer because of the hidden prompt). The next request's input starts with the retry's full input byte for byte. Tests: - `agent-runner-compaction-fallback.test.ts` (mid-turn case) checks: - the warm summary request equals the previous request plus one instruction; - a rate-limited first retry and the second retry after the same compaction send the identical request, with the keyed turn once and no hidden prompt; - the next turn's input starts with the retry's input and holds the question once. It is red on `main` (hidden prompt) and on the previous head of this PR (the rate-limited retry), and green here. - The fixture's stale `largestPrompt < 800_000` check moves to the end of the test, unchanged, so the new assertions run first. It fails on `main` too (851,263 at the 85% trigger) and has its own owner. - `embedded-agent-runner.prompt-cache.test.ts`: the fixture window is raised so its journey stays below the compaction trigger. This test covers prefix stability; the compaction-fallback test owns the warm summary shape. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit 39bdddd) Release adaptation: Preserve the stable ChatGPT V2 compaction boundary and test the cold-summary retry, without importing the warm-summary feature or its unrelated assertion. Companion audit: #204443 changes only fixture sizing; stable test retains its pre-existing budget assertion. #207519 consolidates separate output-limit tests; #208522 is separately ordered in this lane; #204111 warm summaries are not needed for the stable cold path. Co-authored-by: RomneyDa <[email protected]>
One command, two deadlines. Without `--timeout`: - `openclaw agent` through the Gateway sent a CLI fallback of **600 s** (`--timeout ?? agents.defaults.timeoutSeconds ?? 600`) as the run's per-attempt deadline. At 600 s the Gateway aborted the attempt and the run ended with `timeoutPhase: "provider"` and "Request timed out before a response was generated". - `openclaw agent --local` resolved `agents.defaults.timeoutSeconds`, which defaults to **48 hours**, as Gateway turns and cron do. - `openclaw agent exec` hardcoded **600 s**. So long coding tasks finished with `--local` and were cut at 10 minutes through the Gateway. In a long-task coding evaluation (DeepSWE), 3 of 5 Gateway-route trials ended at 607–608 s, while `--local` trials of the same tasks ran 1,084–2,279 s without a cut. The 600 s dates from when the CLI waited on a bounded client timer. That wait has been unbounded for a long time (the CLI waits for the Gateway's terminal result), but the 600 kept travelling as the run's own deadline. Three related bugs come from the same CLI-side value: 1. **Remote Gateway config was overridden.** The CLI sent the CLI host's `agents.defaults.timeoutSeconds`, so a remote Gateway's own setting never applied to CLI turns. 2. **Subagent timeouts were shadowed.** The Gateway gives a turn into a live registered subagent session that subagent's `runTimeoutSeconds` only when the request carries no timeout. The CLI always sent one. 3. **The docs matched only one route.** They said "default 600" for `openclaw agent`, which was true on the Gateway route and false with `--local`. `resolveAgentTimeoutMs` (`agents.defaults.timeoutSeconds`, default 48 h) is now the only owner of how long `openclaw agent` and `openclaw agent exec` run, on both routes. - The Gateway route sends `timeout` only when `--timeout` is given; the Gateway resolves the default exactly as for every other turn. - `agent exec` no longer hardcodes 600; without `--timeout` its embedded run resolves the same default. - The CLI's wait for a yielded turn's subagents has no deadline unless `--timeout` is given. It still ends on the follow-up reply, Ctrl-C or disconnect. - Removed the stale transport hint "use --timeout <seconds> to extend the CLI wait". - Help text and docs now state one default for every route: `docs/cli/agent.md`, `docs/tools/agent-send.md`, `docs/gateway/cli-backends.md`, `docs/tools/autoreview.md`, `docs/plugins/codex-harness-reference/timeouts.md`. `--timeout N` behaves exactly as before on both routes, including `0` (unlimited). - **Old:** without `--timeout`, `openclaw agent` through the Gateway and `openclaw agent exec` stopped each model attempt at **600 s (10 minutes)**. - **New:** they use `agents.defaults.timeoutSeconds`, which is **48 hours** unless configured, the same deadline as `openclaw agent --local`, Control UI and channel turns, and cron. - **To keep the old cap:** pass `--timeout 600`, or set `agents.defaults.timeoutSeconds: 600` in the config (the Gateway's config on the Gateway route). - **Accepted cost:** a script or CI job that relied on the implicit 600 s cap and passes no `--timeout` loses it. A run that neither stalls nor repeats can then run until 48 hours or the job's own limit. Stalled and looping runs are still stopped by the model idle timeout (120 s without output) and the existing loop guards. - **The timeout message** now names the limit that fired and how to raise it: "…the run reached its 10m limit. Please try again, or raise the limit with `--timeout <seconds>` for `openclaw agent`, or `agents.defaults.timeoutSeconds` in your config." - Long tasks through the Gateway are no longer stopped at 10 minutes; `--local` is unchanged. - **Default change:** Gateway-route `openclaw agent` and `agent exec` without `--timeout` now get `agents.defaults.timeoutSeconds` (48 h unless configured) instead of 600 s. Scripts that relied on the implicit 10-minute stop should pass `--timeout 600`. - Autoreview passes launched without a helper timeout can now run up to `agents.defaults.timeoutSeconds` (48 h unless configured) instead of 600 s; helpers that set a timeout are unchanged. - A scripted `openclaw agent` whose yielded turn waits on subagents now waits until they settle (or Ctrl-C/disconnect) instead of exiting 1 at 600 s; pass `--timeout` to bound that wait. - A dead provider is still caught by the model idle timeout (120 s without output). A looping agent is bounded by the configured run deadline and the existing runaway guards. - If the CLI process is killed with SIGKILL or its connection drops, an accepted Gateway run continues and its result is added to the session (accepted execution is bound to the Gateway lifetime, not the caller's connection). Ctrl-C/SIGTERM still sends `chat.abort`, as before. - Red on the merge base, green with the fix: - `src/commands/agent-via-gateway.deadline.test.ts`: without `--timeout`, the Gateway request carries no `timeout` for a local and a remote Gateway (main sent 600 from the CLI host's config). - `src/commands/agent-exec.test.ts`: `agent exec` without `--timeout` passes no timeout to the run (main passed "600"). - `src/cli/program/register.agent.test.ts`: `agent exec fix` without `--timeout` reaches the command with no timeout (main's Commander default injected "600"). - The Gateway already gives a timeout-less request into a registered subagent session that subagent's budget (`agent.session-followup` suite, unchanged). - Affected consumers rerun green: `agent-via-gateway.test.ts`, `agent-via-gateway.yield.test.ts`, `register.agent.test.ts`. - Real-product evidence: the long-task evaluation above (Gateway route 3 of 5 trials cut at 600 s; `--local` none cut). - `src/agents/embedded-agent-runner/run/terminal-timeout.test.ts`: the provider timeout message names the limit that fired (from the run's deadline), `--timeout <seconds>` and `agents.defaults.timeoutSeconds`. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit b170f7d) Release adaptation: Do not restore the absent newer yielded-turn follower. Stable yields return the existing reply; only execution deadlines end up with the Gateway/local owners instead of the CLI hardcoded value. Companion audit: The independent #208644 transport work is not needed by this stable route; preserve explicit zero and nonzero timeout tests. Co-authored-by: RomneyDa <[email protected]>
## What Problem This Solves One command, two deadlines. Without `--timeout`: - `openclaw agent` through the Gateway sent a CLI fallback of **600 s** (`--timeout ?? agents.defaults.timeoutSeconds ?? 600`) as the run's per-attempt deadline. At 600 s the Gateway aborted the attempt and the run ended with `timeoutPhase: "provider"` and "Request timed out before a response was generated". - `openclaw agent --local` resolved `agents.defaults.timeoutSeconds`, which defaults to **48 hours**, as Gateway turns and cron do. - `openclaw agent exec` hardcoded **600 s**. So long coding tasks finished with `--local` and were cut at 10 minutes through the Gateway. In a long-task coding evaluation (DeepSWE), 3 of 5 Gateway-route trials ended at 607–608 s, while `--local` trials of the same tasks ran 1,084–2,279 s without a cut. The 600 s dates from when the CLI waited on a bounded client timer. That wait has been unbounded for a long time (the CLI waits for the Gateway's terminal result), but the 600 kept travelling as the run's own deadline. Three related bugs come from the same CLI-side value: 1. **Remote Gateway config was overridden.** The CLI sent the CLI host's `agents.defaults.timeoutSeconds`, so a remote Gateway's own setting never applied to CLI turns. 2. **Subagent timeouts were shadowed.** The Gateway gives a turn into a live registered subagent session that subagent's `runTimeoutSeconds` only when the request carries no timeout. The CLI always sent one. 3. **The docs matched only one route.** They said "default 600" for `openclaw agent`, which was true on the Gateway route and false with `--local`. ## Fix `resolveAgentTimeoutMs` (`agents.defaults.timeoutSeconds`, default 48 h) is now the only owner of how long `openclaw agent` and `openclaw agent exec` run, on both routes. - The Gateway route sends `timeout` only when `--timeout` is given; the Gateway resolves the default exactly as for every other turn. - `agent exec` no longer hardcodes 600; without `--timeout` its embedded run resolves the same default. - The CLI's wait for a yielded turn's subagents has no deadline unless `--timeout` is given. It still ends on the follow-up reply, Ctrl-C or disconnect. - Removed the stale transport hint "use --timeout <seconds> to extend the CLI wait". - Help text and docs now state one default for every route: `docs/cli/agent.md`, `docs/tools/agent-send.md`, `docs/gateway/cli-backends.md`, `docs/tools/autoreview.md`, `docs/plugins/codex-harness-reference/timeouts.md`. `--timeout N` behaves exactly as before on both routes, including `0` (unlimited). ## Behavior change - **Old:** without `--timeout`, `openclaw agent` through the Gateway and `openclaw agent exec` stopped each model attempt at **600 s (10 minutes)**. - **New:** they use `agents.defaults.timeoutSeconds`, which is **48 hours** unless configured, the same deadline as `openclaw agent --local`, Control UI and channel turns, and cron. - **To keep the old cap:** pass `--timeout 600`, or set `agents.defaults.timeoutSeconds: 600` in the config (the Gateway's config on the Gateway route). - **Accepted cost:** a script or CI job that relied on the implicit 600 s cap and passes no `--timeout` loses it. A run that neither stalls nor repeats can then run until 48 hours or the job's own limit. Stalled and looping runs are still stopped by the model idle timeout (120 s without output) and the existing loop guards. - **The timeout message** now names the limit that fired and how to raise it: "…the run reached its 10m limit. Please try again, or raise the limit with `--timeout <seconds>` for `openclaw agent`, or `agents.defaults.timeoutSeconds` in your config." ## User Impact - Long tasks through the Gateway are no longer stopped at 10 minutes; `--local` is unchanged. - **Default change:** Gateway-route `openclaw agent` and `agent exec` without `--timeout` now get `agents.defaults.timeoutSeconds` (48 h unless configured) instead of 600 s. Scripts that relied on the implicit 10-minute stop should pass `--timeout 600`. - Autoreview passes launched without a helper timeout can now run up to `agents.defaults.timeoutSeconds` (48 h unless configured) instead of 600 s; helpers that set a timeout are unchanged. - A scripted `openclaw agent` whose yielded turn waits on subagents now waits until they settle (or Ctrl-C/disconnect) instead of exiting 1 at 600 s; pass `--timeout` to bound that wait. - A dead provider is still caught by the model idle timeout (120 s without output). A looping agent is bounded by the configured run deadline and the existing runaway guards. - If the CLI process is killed with SIGKILL or its connection drops, an accepted Gateway run continues and its result is added to the session (accepted execution is bound to the Gateway lifetime, not the caller's connection). Ctrl-C/SIGTERM still sends `chat.abort`, as before. ## Evidence - Red on the merge base, green with the fix: - `src/commands/agent-via-gateway.deadline.test.ts`: without `--timeout`, the Gateway request carries no `timeout` for a local and a remote Gateway (main sent 600 from the CLI host's config). - `src/commands/agent-exec.test.ts`: `agent exec` without `--timeout` passes no timeout to the run (main passed "600"). - `src/cli/program/register.agent.test.ts`: `agent exec fix` without `--timeout` reaches the command with no timeout (main's Commander default injected "600"). - The Gateway already gives a timeout-less request into a registered subagent session that subagent's budget (`agent.session-followup` suite, unchanged). - Affected consumers rerun green: `agent-via-gateway.test.ts`, `agent-via-gateway.yield.test.ts`, `register.agent.test.ts`. - Real-product evidence: the long-task evaluation above (Gateway route 3 of 5 trials cut at 600 s; `--local` none cut). - `src/agents/embedded-agent-runner/run/terminal-timeout.test.ts`: the provider timeout message names the limit that fired (from the run's deadline), `--timeout <seconds>` and `agents.defaults.timeoutSeconds`. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit b170f7d) Release adaptation: Beta.3 does not have the yielded-reply relay introduced by #207491. Keep its existing reply path and port the run-owner deadline, command defaults, timeout diagnostic and request-boundary regression without introducing the unrelated relay. Co-authored-by: RomneyDa <[email protected]>
…both routes (#208644) ## Problem `openclaw agent` without `--timeout` used to get two run deadlines: 600 s through the Gateway (a CLI-side fallback) and `agents.defaults.timeoutSeconds` (48 h by default) with `--local`. #208522 made `resolveAgentTimeoutMs` the only owner on both routes, but its tests stop at the CLI request shape. Nothing at the CLI boundary checks that the two routes resolve the same deadline. ## Change Test only. Adds a second case to `test/e2e/agent-route-parity.built-cli.e2e.test.ts`, which already holds the workspace parity case (#208502): - The run owner's config sets `agents.defaults.timeoutSeconds: 2`, and a synthetic model answers after 8 s. - `agent --local` without `--timeout` times out ("Request timed out before a response was generated") and never sees the late reply. - The Gateway route without `--timeout`, from a CLI whose own config sets no deadline, times out the same way and never sees the late reply. It runs as the separate client a remote Gateway would have. Before #208522, that CLI sent its own 600 s fallback, so the Gateway waited and returned the late reply. The test checks the resolved deadline through the turn's outcome. It does not run for 10 minutes: each turn ends after about 2 s. It matches only timeout text that both the base and this branch print, so it fails on the deadline itself, not on the message wording #208522 changed. ## CI gap PR CI does not run this file, or the other `test/e2e/*.built-cli.e2e.test.ts` files added for class L (`gateway-unsafe-home`). - `ci.yml` runs only named e2e files. - The full `pnpm test:e2e:gateway` suite, which includes `test/**/*.e2e.test.ts`, runs only in the scheduled live checks (daily 04:23 UTC, `include_repo_e2e: true`), release checks and full release candidates (`openclaw-live-and-e2e-checks-reusable.yml`, Gateway 1/4-4/4). - So a regression here shows up nightly, not on the PR that causes it. - Wiring these files into PR CI is a CI-budget decision and is not part of this PR. ## Evidence - Branch (built CLI, local run): both cases in the file pass (13.1 s and 14.1 s). - Base `b170f7d97128^` (before #208522, built with `ocx base`): the new case fails on the Gateway route. The JSON result carries `"text": "ROUTE_DEADLINE_LATE_REPLY"`, because the CLI's 600 s fallback overrode the Gateway's 2 s deadline. - `--local` passes on both, as expected: it always used `resolveAgentTimeoutMs`. - Test only, no production change. Co-authored-by: Ayaan Zaidi <[email protected]> (cherry picked from commit d31aefe) Co-authored-by: RomneyDa <[email protected]>
…w#208522) ## What Problem This Solves One command, two deadlines. Without `--timeout`: - `openclaw agent` through the Gateway sent a CLI fallback of **600 s** (`--timeout ?? agents.defaults.timeoutSeconds ?? 600`) as the run's per-attempt deadline. At 600 s the Gateway aborted the attempt and the run ended with `timeoutPhase: "provider"` and "Request timed out before a response was generated". - `openclaw agent --local` resolved `agents.defaults.timeoutSeconds`, which defaults to **48 hours**, as Gateway turns and cron do. - `openclaw agent exec` hardcoded **600 s**. So long coding tasks finished with `--local` and were cut at 10 minutes through the Gateway. In a long-task coding evaluation (DeepSWE), 3 of 5 Gateway-route trials ended at 607–608 s, while `--local` trials of the same tasks ran 1,084–2,279 s without a cut. The 600 s dates from when the CLI waited on a bounded client timer. That wait has been unbounded for a long time (the CLI waits for the Gateway's terminal result), but the 600 kept travelling as the run's own deadline. Three related bugs come from the same CLI-side value: 1. **Remote Gateway config was overridden.** The CLI sent the CLI host's `agents.defaults.timeoutSeconds`, so a remote Gateway's own setting never applied to CLI turns. 2. **Subagent timeouts were shadowed.** The Gateway gives a turn into a live registered subagent session that subagent's `runTimeoutSeconds` only when the request carries no timeout. The CLI always sent one. 3. **The docs matched only one route.** They said "default 600" for `openclaw agent`, which was true on the Gateway route and false with `--local`. ## Fix `resolveAgentTimeoutMs` (`agents.defaults.timeoutSeconds`, default 48 h) is now the only owner of how long `openclaw agent` and `openclaw agent exec` run, on both routes. - The Gateway route sends `timeout` only when `--timeout` is given; the Gateway resolves the default exactly as for every other turn. - `agent exec` no longer hardcodes 600; without `--timeout` its embedded run resolves the same default. - The CLI's wait for a yielded turn's subagents has no deadline unless `--timeout` is given. It still ends on the follow-up reply, Ctrl-C or disconnect. - Removed the stale transport hint "use --timeout <seconds> to extend the CLI wait". - Help text and docs now state one default for every route: `docs/cli/agent.md`, `docs/tools/agent-send.md`, `docs/gateway/cli-backends.md`, `docs/tools/autoreview.md`, `docs/plugins/codex-harness-reference/timeouts.md`. `--timeout N` behaves exactly as before on both routes, including `0` (unlimited). ## Behavior change - **Old:** without `--timeout`, `openclaw agent` through the Gateway and `openclaw agent exec` stopped each model attempt at **600 s (10 minutes)**. - **New:** they use `agents.defaults.timeoutSeconds`, which is **48 hours** unless configured, the same deadline as `openclaw agent --local`, Control UI and channel turns, and cron. - **To keep the old cap:** pass `--timeout 600`, or set `agents.defaults.timeoutSeconds: 600` in the config (the Gateway's config on the Gateway route). - **Accepted cost:** a script or CI job that relied on the implicit 600 s cap and passes no `--timeout` loses it. A run that neither stalls nor repeats can then run until 48 hours or the job's own limit. Stalled and looping runs are still stopped by the model idle timeout (120 s without output) and the existing loop guards. - **The timeout message** now names the limit that fired and how to raise it: "…the run reached its 10m limit. Please try again, or raise the limit with `--timeout <seconds>` for `openclaw agent`, or `agents.defaults.timeoutSeconds` in your config." ## User Impact - Long tasks through the Gateway are no longer stopped at 10 minutes; `--local` is unchanged. - **Default change:** Gateway-route `openclaw agent` and `agent exec` without `--timeout` now get `agents.defaults.timeoutSeconds` (48 h unless configured) instead of 600 s. Scripts that relied on the implicit 10-minute stop should pass `--timeout 600`. - Autoreview passes launched without a helper timeout can now run up to `agents.defaults.timeoutSeconds` (48 h unless configured) instead of 600 s; helpers that set a timeout are unchanged. - A scripted `openclaw agent` whose yielded turn waits on subagents now waits until they settle (or Ctrl-C/disconnect) instead of exiting 1 at 600 s; pass `--timeout` to bound that wait. - A dead provider is still caught by the model idle timeout (120 s without output). A looping agent is bounded by the configured run deadline and the existing runaway guards. - If the CLI process is killed with SIGKILL or its connection drops, an accepted Gateway run continues and its result is added to the session (accepted execution is bound to the Gateway lifetime, not the caller's connection). Ctrl-C/SIGTERM still sends `chat.abort`, as before. ## Evidence - Red on the merge base, green with the fix: - `src/commands/agent-via-gateway.deadline.test.ts`: without `--timeout`, the Gateway request carries no `timeout` for a local and a remote Gateway (main sent 600 from the CLI host's config). - `src/commands/agent-exec.test.ts`: `agent exec` without `--timeout` passes no timeout to the run (main passed "600"). - `src/cli/program/register.agent.test.ts`: `agent exec fix` without `--timeout` reaches the command with no timeout (main's Commander default injected "600"). - The Gateway already gives a timeout-less request into a registered subagent session that subagent's budget (`agent.session-followup` suite, unchanged). - Affected consumers rerun green: `agent-via-gateway.test.ts`, `agent-via-gateway.yield.test.ts`, `register.agent.test.ts`. - Real-product evidence: the long-task evaluation above (Gateway route 3 of 5 trials cut at 600 s; `--local` none cut). - `src/agents/embedded-agent-runner/run/terminal-timeout.test.ts`: the provider timeout message names the limit that fired (from the run's deadline), `--timeout <seconds>` and `agents.defaults.timeoutSeconds`. Co-authored-by: Ayaan Zaidi <[email protected]>
…both routes (openclaw#208644) ## Problem `openclaw agent` without `--timeout` used to get two run deadlines: 600 s through the Gateway (a CLI-side fallback) and `agents.defaults.timeoutSeconds` (48 h by default) with `--local`. openclaw#208522 made `resolveAgentTimeoutMs` the only owner on both routes, but its tests stop at the CLI request shape. Nothing at the CLI boundary checks that the two routes resolve the same deadline. ## Change Test only. Adds a second case to `test/e2e/agent-route-parity.built-cli.e2e.test.ts`, which already holds the workspace parity case (openclaw#208502): - The run owner's config sets `agents.defaults.timeoutSeconds: 2`, and a synthetic model answers after 8 s. - `agent --local` without `--timeout` times out ("Request timed out before a response was generated") and never sees the late reply. - The Gateway route without `--timeout`, from a CLI whose own config sets no deadline, times out the same way and never sees the late reply. It runs as the separate client a remote Gateway would have. Before openclaw#208522, that CLI sent its own 600 s fallback, so the Gateway waited and returned the late reply. The test checks the resolved deadline through the turn's outcome. It does not run for 10 minutes: each turn ends after about 2 s. It matches only timeout text that both the base and this branch print, so it fails on the deadline itself, not on the message wording openclaw#208522 changed. ## CI gap PR CI does not run this file, or the other `test/e2e/*.built-cli.e2e.test.ts` files added for class L (`gateway-unsafe-home`). - `ci.yml` runs only named e2e files. - The full `pnpm test:e2e:gateway` suite, which includes `test/**/*.e2e.test.ts`, runs only in the scheduled live checks (daily 04:23 UTC, `include_repo_e2e: true`), release checks and full release candidates (`openclaw-live-and-e2e-checks-reusable.yml`, Gateway 1/4-4/4). - So a regression here shows up nightly, not on the PR that causes it. - Wiring these files into PR CI is a CI-budget decision and is not part of this PR. ## Evidence - Branch (built CLI, local run): both cases in the file pass (13.1 s and 14.1 s). - Base `0991e6a06171^` (before openclaw#208522, built with `ocx base`): the new case fails on the Gateway route. The JSON result carries `"text": "ROUTE_DEADLINE_LATE_REPLY"`, because the CLI's 600 s fallback overrode the Gateway's 2 s deadline. - `--local` passes on both, as expected: it always used `resolveAgentTimeoutMs`. - Test only, no production change. Co-authored-by: Ayaan Zaidi <[email protected]>
* test(gateway): remove unused metadata entry default (#208164) * chore(ui): refresh control ui locales (#208476) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * test(gateway): remove unused prediction fixture default (#208166) * fix: keep the cached sidebar roster check reliable on a cold worker (#208461) Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 410bb4cf-c29c-4e08-8aab-8c0f0b321532 * fix(ios): match the Fast and Ultrafast bolts in the dial and Speed menu (#207692) * fix(ios): balance the Fast and Ultrafast bolts * fix(ios): keep only the composer bolt change * fix(ios): match the Speed menu bolts and space the closed row like a system icon * fix: restore the sidebar snapshot lint check (#208479) * fix: restore the sidebar snapshot lint check Rename local callback parameters and the scoped reader in the owner-filter fixture. Keep the snapshot, cache behavior and assertions unchanged. Co-authored-by: vyctorbrzezowski <[email protected]> * fix: restore the sidebar snapshot lint check Worked on by: - @vyctorbrzezowski Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: ee953e0e-0c10-83c8-9992-53887f23812a --------- Co-authored-by: roboclaw-bot <[email protected]> Co-authored-by: vyctorbrzezowski <[email protected]> * fix(ui): show automation actions and the calendar icon in chat (#208475) * fix(ui): show automation actions and the calendar icon in chat * fix(ui): preserve existing scheduler detail formatting * fix(ui): show automation actions in the collapsed chat headline * fix: let Workshop target agents on a remote Gateway (#208457) Resolve an explicit Workshop agent against the selected remote Gateway instead of requiring a client workspace. Preserve local selection, offline fallback, and mutation custody. Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 63c9e22e-6f63-4efb-a0ec-9a70623b7bdc * improve(ios): hop the subagent avatars only when three or more are working (#207687) * fix(memory): avoid rereading unchanged transcripts during offline backfill (#208434) Reuse verified transcript candidates across bounded offline backfill batches. Preserve chronological selection, transcript-order checkpoints, and independent Gateway requests. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 3ee04411-cfd2-494c-8b0d-68089159440d * fix(ios): show the chat's name in the header for older chats (#207685) * test(gateway): remove unused global identity fixture default (#208168) * fix(ios): show the chat's name and actions for older chats (#207694) * fix(ios): show the chat's name in the header for older chats * fix(ios): show the chat's name and actions for older chats * fix: report skipped manual automation runs without timing out (#208453) Record the exact manual attempt alongside its finished event. Leave the deferred occurrence, retry policy, and previous job outcome untouched. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: c301e60c-7efb-49a1-b5cf-5ad85cc72d86 * fix: exercise the parent’s final check in child-handoff tests (#208478) Keep the original requester report and answer the same-turn recheck silently before accepting a Goal nudge or ending the browser scenario. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: ae0be9d4-dfa4-488d-85ee-d876220d04cf * test(gateway): remove unused injection source defaults (#208171) * fix: check the current notice for revoked runs after restart (#208484) Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 44c03bd5-4bf1-426c-8e5d-ac798e8aed01 * chore(ui): refresh control ui locales (#208500) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * test(gateway): remove unreachable approval-reader branches (#208148) * fix: model empty announcements in the stream script checkpoint test (#208482) Keep the default announce policy and report the empty-output suppression from the script runner. Without that outcome the scheduler correctly retains the prior checkpoint because required delivery is unknown. Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 0dfba296-8737-4fe6-840e-34a02b298cce * fix: tell browser users when to retry after throttling Co-authored-by: VACInc <[email protected]> * fix: keep agent work moving past recoverable setup failures Co-authored-by: VACInc <[email protected]> * fix(ollama): preserve model namespaces and custom-provider shortcuts (#208401) Try the configured model name first on custom Ollama providers. Retry the shorter name once when Ollama reports that exact model missing. Classify the bounded response before redacting the diagnostic. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 62864529-04ab-4958-9344-d900f5f5c944 OpenClaw-Publication: 10a0d16a-0d8b-477d-bec9-d5a5646cc8ee OpenClaw-Publication: b9c708fb-a950-4344-ab46-7cc0109d0dbe * fix: keep unrelated work going during background waits Co-authored-by: VACInc <[email protected]> * test(gateway): remove unused request fixture defaults (#208141) * fix: report image size presets without marking them ignored (#208436) Report the preset sent by the image provider and flag returned files whose dimensions differ from that preset. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: d1dd36c3-16e3-4571-9f1c-a7281abfecc0 * feat(ios): show messages with many images as a stack that opens the whole gallery (#207679) * feat(ios): open large photo messages as a stack * fix(ios): restore photo stack preview retries * fix: keep the sidebar reload test’s pins in its owner filter (#208510) Give the fixture’s pinned sessions the active owner so the warm-reload checks exercise the same unselected row and all seven PR badges. Keep production filtering and the handoff assertions unchanged. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 5b3e6d5a-8804-4266-a591-dc4e944e476c * fix(packaging): preserve root Ciao when packing hardlinked dependencies (#201049) Pack npm-selected files from a private copy when a bundled dependency shares inodes with a warm pnpm store. Use the existing bundle restager so the installed root package can resolve patched Ciao and the standalone plugin keeps its own dependencies. Keep npm inventory code outside the Docker packaging CLI's startup imports so an isolated checkout can still parse arguments. Refs #198010, #198011 and #199156. Co-authored-by: Vincent Koc <[email protected]> OpenClaw-Publication: 80f31ad4-a520-8ab8-95ad-dc374a12031e Co-authored-by: vincentkoc <[email protected]> * docs: show where to find run status in Threads (#208486) Document the unread dot on collapsed Threads rows and where to find run status, session kind, and token usage. Readers can use the row menu to manage a session. Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: bed96ea2-9fab-49ae-af48-cc68cfd4e937 * fix: retain callers in main-thread stall profiles (#208503) * fix: stop switching models when a session entry changes during a turn (#208480) Root cause: src/agents/failover-error.ts:63 `RUNTIME_COORDINATION_ERROR_NAMES` does not list the SQLite session-entry conflict errors, so model fallback classifies a local session-entry write conflict as a model failure and moves on to the next model. Fixes #208432 ## What Problem This Solves Sometimes another write changes a session's stored entry while a turn is preparing its own write to it. OpenClaw then raises `SqliteSessionMutationConflictError` ("SQLite session state changed while preparing session-entry.patch"). Model fallback treated that local error as a provider failure. It logged `candidate_failed` and tried every configured fallback model, within milliseconds and before any provider request. The turn then ended on the last fallback, often a small local model, or failed with `UNAVAILABLE` when the chain ran out. The reporter saw 136 false fallback decisions across 64 runs on one gateway. ## User Impact A session-entry conflict no longer switches models. The turn stops at the current model and reports the original conflict error. The transcript-conflict sibling (`SqliteTranscriptMutationConflictError`) already worked this way, and so did session capability metadata changes (#179290). Real provider failures fall back exactly as before. This PR stops the false fallback walk. It does not remove the conflict itself (see Evidence). ## Why This Change Was Made `resolveModelFallbackError` already has one owner for local coordination errors: errors named in `RUNTIME_COORDINATION_ERROR_NAMES` resolve to `coordination`. The fallback attempt then logs `chain_stopped reason=local_runtime_coordination` and rethrows the original error. This PR adds two names: - `SqliteSessionMutationConflictError`, the reported error. - `SessionEntryLifecycleUpsertConflictError`, its lifecycle-upsert sibling. It is the same class of stale-entry conflict and takes the same stop path. Both worker transports rebuild these errors under their real names: `session-actor-storage-result.ts` and `openclaw-state-worker-error-identity.ts`. So the name check matches on the real path, wrapped causes included. Changing models can never fix a stale session snapshot, so whichever writer caused the conflict, walking the chain is wrong. This is the same change as #179312. ## Evidence - Source: on main and in the reporter's 2026.11.10-11.12 dist, `resolveModelFallbackError` returns `unknown` for these errors. `model-fallback-attempt.ts` then returns `{ error }` and starts the next candidate. - Regression: two rows in `src/agents/model-fallback.terminal-boundary.test.ts`, one per error. Each sends the conflict through the state-worker encode/decode (`identifyError`/`createError`) into `runWithModelFallback`. - With the classifier change reverted, they fail: the runner treats the conflict as a provider failure and consults provider failover policy. - With it, `run` is called once, no fallback step or error callback fires, and the original error is rethrown. - Control, built Gateway (main `64503d2d75`) in an isolated container with mock providers: a real HTTP 529 from the primary still gives `candidate_failed ... reason=overloaded` and then `candidate_succeeded` on the fallback (3/3 turns). - Not reproduced: the competing writer. On a built main Gateway I tried: - operator `sessions.patch` label changes during turns. They are admitted through session lifecycle and lose the race themselves. - a second `agent` message into the same session mid-turn. It was rejected. - 15 subagent spawns on a Claude CLI fallback chain. - holding an in-candidate session write open for 1.5-3 s. None produced the conflict. The likely source is the Claude CLI runner's in-candidate compare-and-swap writes reading a cached snapshot. That is storage code and out of scope here. The user evidence is the reporter's production logs: 156 conflicts, 136 `candidate_failed` with one error hash, every candidate failing about 30 ms after the previous one, before any provider call. - Details: https://github.com/openclaw/openclaw/pull/208480#issuecomment-7260755152 Thanks @YK-03 for the fix and @Fahd84110 for the detailed report and log analysis. Merge danger: two-way door. Two entries in an error-name list, no stored state or contract change; a revert fully restores the old routing. Blast radius: only turns that hit these local session-entry conflicts, which now stop instead of switching models. Co-authored-by: Ayaan Zaidi <[email protected]> * fix: tell sessions_send notify callers when the target's event queue is full (#208411) Root cause: src/agents/tools/sessions-send-tool.delivery.ts:98 `sessions_send` notify enqueues through `enqueueSystemEventEntry`, which logs the queue owner's `SystemEventQueueFullError` and returns null, so the tool turns a full queue into the generic "Notification was not queued." Fixes #206751 ## What Problem This Solves When a session already has 20 passive notices waiting (for example notify messages sent while it had no turn), every `sessions_send` with `mode: "notify"` to it fails with "Notification was not queued." The caller can't tell why, or what to do; the reason only shows up as a Gateway log line. ## User Impact The notify result now carries the queue's own explanation: "System event queue is full (20 pending). Let the session process pending events before retrying the notification." Nothing else changes: queue size, which turns drain the queue, and the watch-notice text stay as they are. Other refusals (duplicate notice, replaced store) still return "Notification was not queued." ## Why This Change Was Made The queue owner already throws this error for callers that ask for it (`enqueueRequiredSystemEventEntry`, `enqueueSystemEventWithReceipt`). Notify now asks for it on the passive pool too and returns the message. It doesn't switch to the waking API, so a notify still never starts a turn. The draining part of the report (followups and handoffs never consuming the backlog on 2026.11.6) is already fixed on main by #197725 (c418b20a51fb) and #197692 (e0a9dad7cd1c), first shipped in 2026.11.10-beta.1. The Gateway run below checks that. ## Evidence Built Gateway in a secretless container with a scripted chat-completions model and the built-in runtime. Agent `main`'s main session gets only internal turns. It watches another session that changes three times, receives 21 notifies from another agent, runs a main-session cron systemEvent job, and then gets a `sessions_send` followup. - main ff5c787a6229: 19 notifies queued (one slot held by a pending watch notice), then `{"status":"error","error":"Notification was not queued."}` twice. - this branch: the same run, but those two results are `{"status":"error","error":"System event queue is full (20 pending). Let the session process pending events before retrying the notification."}`. - Identical on both: three watch changes produced one notice, which was consumed by its own turn. The cron turn did not consume the passive notices, which is intended. The followup turn adopted all 20 notes, and the next notify was queued. Full proof output: https://github.com/openclaw/openclaw/pull/208411#issuecomment-7258856547 - Regression `sessions-send-tool.admission.test.ts` ("tells the notifying caller when the passive queue is full") fails on main with the generic message and passes here. `system-events.capacity`, `local-request-context.session-notify` and `agent-command.sessions-send-system-events` also pass. Thanks @jaimeehenry for the detailed report and refill timings. Merge danger: two-way door. The change only affects the error text of a refused notify; nothing is stored. Blast radius: `sessions_send` notify callers that hit a full queue. Observed proof lines: https://github.com/openclaw/openclaw/pull/208411#issuecomment-7258856547 Co-authored-by: Ayaan Zaidi <[email protected]> * fix(ui): keep desktop chat Details from failing after shell recovery (#208485) Publish the desktop Details observers without returning the signal setter’s result to Solid. Cover empty-panel discovery with a browser regression. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 747c757b-12c9-4962-85e7-629db68d9ab4 * test(gateway): remove unused request fixture default (#208180) * fix(macos): recover credentials from the legacy app directory (#208315) Use the matching bundled Doctor to migrate supported OpenClaw shared state in the separate Mac identity directory, then retry credential admission. Keep independent native imports read-only. Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: f45adf5e-6357-446d-9889-0d50c265a8af * fix(gateway): keep the access-loss notice out of a reset conversation (#208495) ## What Problem This Solves When an owner removes someone from a shared session while that person's reply is streaming, OpenClaw stops the run and posts "Stopped 1 run started by Carol: their access to this session changed." If the stopped producer is still finishing, that notice is written by a background task. If the owner resets the session right after (`/new`, New chat, `sessions.reset`), the reset can commit before that task runs. The notice then opens the **new** conversation with a line about the old one, and the model reads it in its next prompt. On a real Gateway this happened in 29 of 30 attempts. Cause: the notice is addressed by session key only. Reset keeps the transcript id and rotates the conversation's lifecycle revision. The inject checks only the transcript id, so it cannot tell the retired conversation from the new one. ## Fix The notice holds the incarnation of the conversation its runs were stopped in, using the existing transcript-lease owner (`acquireTranscriptLease(chat, pin, { exact: "lifecycle" })`, the same hold cron occurrences use). - The pin comes from the snapshot the Stop already loads, before the stop. The lease is taken inside the background notice task, after it waits for the stopped producer, and released when the task ends. - The lease's check runs through the inject's existing guard argument, which the transcript write calls inside the append. A reset that commits at any point before the append retires the notice. - A retired conversation skips the notice with one info log line ("the conversation was reset or deleted"). Any other failure keeps the existing warning. Neither reaches the permission writer. - The inject reports a revoked hold as an ordinary failure, so the task asks the lease itself before deciding. - No session-id comparison outside the owner: the session-identity ratchet is unchanged. ## The native Codex mirror after a reset: no code A scratch fixture showed that a stopped Codex turn's native mirror can append after the lifecycle revision rotates. That fixture rotated the revision directly. Through `sessions.reset` on a real Codex turn it did not happen (0 of 10): - Isolated Gateway, native Codex app-server, `openai/gpt-5.4-mini`. A ~1500-word reply was stopped mid-stream and the session reset, either right after Stop or by reset alone. - 0 of 10 runs put the partial in the new conversation; all 10 put it before the reset boundary. Control without reset: the partial is persisted (2 of 2). - Why: reset preempts the active run and waits for its settlement, including the mirror write, before committing (`session-reset-service.ts`, `policy: "preempt"`). Rollover and `/new` preempt the same way; delete waits. - Not checked: the implicit daily/idle freshness rotation during a later turn's admission (`deferImplicitRollover`, `agent-session-patch.ts`; CLI and cron callers). Named here as a residual; no failure observed. ## User Impact - A reset right after removing someone opens a clean conversation. - The old conversation keeps the stopped partial reply. Its notice is not written: that conversation was retired by the reset, and the transcript owner does not append to a retired conversation. - Access removal, its immediate reply, and the stopped run are unchanged. Without a reset, the notice is posted as before. - Incognito sessions: reset deletes them; a notice raced by that reset is dropped with a warning instead of the info line. - A sharing or permission change on the same session in the milliseconds between the notice taking its hold and writing also drops the notice with a warning. Ordinary writes by other members do not affect it. - A failed session lookup in the notice is now logged as a warning; it no longer fails the access-removal request on the path without a retained producer. ## Evidence - `src/gateway/server.participation-access-loss.test.ts` (real in-process Gateway): the notice is held at two points, before the notice task starts and after it took its hold, while `sessions.reset` commits. Both cases are red on the merge base on the assertion (the notice is in the new conversation) and green with the fix (6 of 6 in the file). The existing cases, including the notice without a reset, stay green. - Negative control for the test itself: with the notice's pin temporarily taken at notice time instead of before the stop (so the lease is granted after the reset), the "before the notice task starts" case goes red on the assertion. Reverted; not part of the change. - W16's original race on the real in-process Gateway (release the stopped producer, then reset at once, 5 attempts): notice in the new conversation 0 of 5 with the fix; 29 of 30 on main. - Session-identity ratchet unchanged; core typecheck clean. Co-authored-by: Ayaan Zaidi <[email protected]> * fix: keep plugin migrations out of early update preparation (#208473) ## What Problem This Solves Updating to a build with a lower version label but newer database schemas can run that build's plugin maintenance while the old Gateway is still serving. This can migrate live state before the release trial can restore it, leaving the old build unable to read its own database. ## User Impact Candidates declaring a newer state **or agent** schema wait until their own Gateway is ready before maintaining plugins. Real downgrades keep their existing pre-trial maintenance, including releases without schema metadata; no extra command or prompt is added. This fixes the installed updater only. Shipped beta.1/beta.2 updaters keep invoking the candidate's maintenance command early, and the candidate-side command is unchanged: those beta users can still hit the reported semver-lower/schema-newer migration failure. This PR does not claim to repair that first hop. ## Why This Change Was Made The old branch assumed a lower semantic version could not carry a newer database schema. Read the prepared candidate's existing package schema metadata using the shared parser, and retain the branch only when neither schema exceeds the running build's matching version. Missing metadata preserves the older-release behavior. - v2026.11.11 and v2026.11.12 declare state schema 40 and agent schema 42, so both pass the new schema guard against running state 42 / agent 45. They retain pre-trial maintenance when the existing semver check identifies an actual downgrade; equal/newer versions still bypass this branch. - No launcher changes (format 4), new metadata fields, records, statuses, flags, retries, or scheduling. - Net against the base: production **+14**, tests **+33**, docs **+5** lines. The small guard is necessary to preserve downgrade maintenance while preventing early forward migrations; direction takes precedence over a line-neutral target. ## Evidence - **Red on main `baf938dfb8c2`**, mbp-m5, vitest-source: both schema-newer table cases incorrectly ran maintenance; the real plugin-lifecycle child also reached live-state admission before the trial. Three failures were the intended regressions; the three legacy/equal-version controls passed. Test duration 15.38 seconds. - **Green with this change**, mbp-m5, vitest-source: `ocx test src/update/prepare.test.ts -t 'defers semver-lower|maintains downgrade|already-current'` — **14 passed**, including missing metadata, older schemas, newer state, equal-state/newer-agent, and existing already-current behavior. Test duration 15.21 seconds. - Focused lint: both changed TypeScript files passed (5.30 seconds). Formatting: all three changed files passed (8 ms). - Local ClawSweeper reviewed exact head `e3baa43199d79e5ff9d59dc6abc02457d3101aa7`: complete, patch correct, zero source/security findings. Product-path lane results remain separate evidence. - [Current-head PR CI](https://github.com/openclaw/openclaw/actions/runs/46295242495): **green** on `c25395b4cbd6afcfa5159a22736297153d292418`, after the requested main merge brought in #208479's unrelated UI lint fix. The prior [CI run](https://github.com/openclaw/openclaw/actions/runs/46293669143) encountered that unchanged UI lint failure; no updater edits were needed. Build/type coverage ran in CI; no local broad suite was run. - [Package Acceptance](https://github.com/openclaw/openclaw/actions/runs/46294339408) exercised `e3baa43199d79e5ff9d59dc6abc02457d3101aa7`; this behavior proof is retained after the requested main-only merge: - [Survivor 2026.11.11](https://github.com/openclaw/openclaw/actions/runs/46294339408/job/141452129152): **passed** (18m56s). - [Survivor 2026.11.12](https://github.com/openclaw/openclaw/actions/runs/46294339408/job/141452129260): **passed** (24m40s). - [update-restart-auth, openclaw@latest](https://github.com/openclaw/openclaw/actions/runs/46294339408/job/141452129251): **passed** (29m41s). - Package integrity passed. The overall acceptance run is red only because the unrelated [npm 12 installed-package budget check](https://github.com/openclaw/openclaw/actions/runs/46294339408/job/141449644533) found 47,546 entries against a 47,500 budget (#208295); the aggregate correctly reports that failure. No retry or budget change was made. - Beta baselines are intentionally excluded because their shipped updater is not changed. Co-authored-by: Ayaan Zaidi <[email protected]> * fix: dismiss passkey prompts from the remote Browser panel (#208407) Let a remote Browser panel user dismiss a pending native passkey prompt without reloading the page or losing form input. Keep native passkey sign-in available on the host. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 6312d4d5-5a52-4232-8d8d-5d3176acf091 * fix(android): avoid scanning system CAs before pinned Gateway connections (#208425) Implement Android’s hostname-aware trust-manager overload so OkHttp can validate a pinned leaf without indexing the platform CA store. Delegate platform-trusted chains to Android with the connection hostname. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: e7eceedd-d8ad-4117-a9ab-bf17e1b073c9 * fix: preserve child completion inputs across Gateway restarts (#208367) Reuse the accepted requester attribution for a completion replay under the same operator and session when restart no longer has the original tool caller. Keep exact input and receipt conflict checks. Verify both consumed inputs and the model-visible history delivery in the restart fixture. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: df68cb90-0108-4a28-a654-3645f36fe14e OpenClaw-Publication: 5a817054-c824-4889-8949-154e54475698 * test(gateway): remove unused steering fallback default (#208181) * fix: ask for an agent before Linux Quick Chat sends (#208431) Honor the Gateway roster when Quick Chat requires an explicit agent choice. Pressing Return retains the draft and opens the picker. After the user selects an agent, the next Return sends to that agent's session. Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: ad454f08-fdff-4e14-bd03-471ba86defcc * fix: keep Matrix DM replies in the original thread (#208128) Preserve the case-sensitive Matrix DM thread root in session storage and reply ownership. Doctor restores the existing transcript and its idle local worker placement when Matrix delivery metadata identifies the original thread. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 1838c4b4-deed-4503-b3fb-8b73c0f74e0e OpenClaw-Publication: c478e718-8bb8-857e-be0c-91b9b5998ded * feat: choose where automations run (#201285) Let an automation run in a named conversation, use recent messages as context, or send a result to a selected chat. Save the conversation key so the link survives renaming. Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: a62843b0-acd0-83f5-b79e-f5cbf9cdbb9c Co-authored-by: daniel-lxs <[email protected]> * fix: avoid waiting for immutable update records during Gateway startup (#208471) Related: #208359 ## What Problem This Solves Gateway startup can wait for a SQLite child worker before opening its listener on an adopted immutable installation. A stalled worker can delay startup for its 300-second-plus timeout, even though this startup ownership check was meant to be file-only and best effort. ## User Impact Startup no longer inspects the immutable adoption database before binding. Packaging-owned macOS app, desktop app, and container installs still suppress self-update through `openclaw-install-owner.json`. Immutable layouts without that marker also suppress self-update, whether adopted or unadopted. Immutable installations are updated outside the Gateway service. The existing root/current/release layout detector uses file shape and `lstat` only; startup does not read the adoption record or launch its SQLite worker. Strict update admission is unchanged, including its refusal directing users to run `openclaw update` as root outside the service. ## Why This Change Was Made Replace the worker-backed startup inspection with the existing file-only immutable layout detector; keep packaging marker filtering and best-effort inspection warnings. No new statuses, records, timers, caches, owner fields, or other mechanisms. Whole PR versus main: production net -1 line; tests net +10 lines; total net +9. The follow-up versus reviewed head `bbce2253194c` is production +11 and tests +10. Only the startup module, its existing test, and an export on the existing immutable layout detector change. ## Evidence - Original main-baseline proof on mbp-m5 showed startup called `readImmutableInstallRecord` before bind. - The added immutable-layout regression failed against the pre-follow-up startup code: root, current-symlink, and release-directory entry points all incorrectly advertised `update.run`. - With this follow-up, `ocx test src/gateway/server-startup-plugins.test.ts -t "suppresses immutable self-update|advertises self-update"` passed all 7 selected cases on mbp-m5: three immutable entry points (without an owner marker), three packaging owners, and an unmarked mutable installation. Each immutable case asserts no worker-backed record read. Duration 23.93 seconds, mostly compiler preparation; assertions took 27 ms total. - Changed-file Oxfmt and Oxlint checks passed on mbp-m5 (3 files; 0 lint warnings/errors). - No local full build, full suite, browser click, or real worker timeout was run. CI supplies broad proof. Co-authored-by: Ayaan Zaidi <[email protected]> * fix: keep unrelated tools running when a batch hits the repeat limit Co-authored-by: VACInc <[email protected]> * fix: check recorded automation owners before running (#201287) Check the recorded human owner before scheduled work and process-watcher launches. Scheduled occurrences read the saved owner when the in-memory catalog is cold. An administrator can recover a job whose owner has been removed. Co-authored-by: vyctorbrzezowski <[email protected]> OpenClaw-Publication: 01bffa98-2a33-8d2c-89aa-fcd0156303c7 Co-authored-by: daniel-lxs <[email protected]> * fix(gateway): start under a group-writable HOME when file logs are unavailable (#208499) ## Problem `openclaw gateway run` refuses to start when `$HOME` is group-writable without a sticky bit, which is common for shared container volumes: ``` [gateway] sidecars failed to start: WorkerTaskError: Directory "$HOME" is writable by group or others and has no sticky bit. ... Gateway failed to start: ... ``` `openclaw agent --local` in the same HOME runs normally and only drops file logs with `[openclaw] log directory unavailable; records dropped`. Users affected: containerized and shared-HOME installs. Shipped in v2026.11.10. Cause: the logging transport already decides that an unsafe default log directory means "drop records and warn". One reader bypassed that decision. The Gateway startup summary line `log file: <path>` (src/gateway/server-startup-log.ts) awaits `getResolvedLoggerSettings()`, which rethrows the resolution error. Since #197742 moved resolution into a worker, that await fails Gateway startup. Doctor's reader already caught the same error privately. ## Solution `getResolvedLoggerSettings()` owns the outcome. `file` is absent when the default log directory is unavailable, and it never throws for that. - Gateway startup prints `log file: unavailable`. The transport's existing warning still names the cause and the `chmod` fix. - Doctor drops its private try/catch and reads the same field. The directory safety check itself is unchanged. Temp roots, worker scratch and SQLite staging still refuse unsafe ancestors when they are used. ## Impact - The Gateway starts and runs turns under a group-writable HOME, as `--local` already does. File logs are still dropped, with the same warning. - `openclaw logs` and log tail use separate resolvers and are unchanged. - Not a security regression: config, credentials and state already live under the same HOME, and Gateways before v2026.11.10 started there. ## Evidence - `src/logging/logger-file-transport.worker.test.ts` now runs the existing default-root proof, whose `--disposable-default-root` path no test invoked. Its unsafe-directory step asserts `file` is absent. Red on main (`WorkerTaskError ... no sticky bit`), green here. - `test/e2e/gateway-unsafe-home.built-cli.e2e.test.ts`: built CLI, HOME 0775. The Gateway starts, logs `log file: unavailable` plus the transport's warning with the `chmod go-w` fix, and `agent` completes a turn. - Real CLI repro (built dist, isolated HOME 0775 with state under it, fake OpenAI-compatible server): main 3/3 `Gateway failed to start`; this branch 3/3 Gateway ready, turn completed. - Consumer suites green: doctor-format.test.ts, log-tail.test.ts, logger-settings.test.ts, logger-env.test.ts, server-startup-log.test.ts. - Readers of `getResolvedLoggerSettings()`: Gateway startup summary and Doctor's runtime hints (plus tests). `resolveTarget` rejects only while resolving the default root, and the writer already drops records on every such rejection, so the reader and the writer agree on "unavailable". - `LoggerResolvedSettings` (also exported from `openclaw/plugin-sdk/logging-core`) now marks `file` optional. Plugin SDK impact query (`sdk-export:openclaw/plugin-sdk/logging-core#LoggerResolvedSettings`, ClawHub, 2026-11-29): 0 plugins reference it (coverage 2,332 complete / 421 partial / 30 failed of 2,783); no bundled plugin imports it (`rg` over `extensions/`). No SDK function returns this type, so plugins can only construct it. - Typecheck at this head: `pnpm tsgo:core` clean. `pnpm tsgo:core:test` has one error, in `ui/src/pages/logs/view.test.tsx:21`, which this PR does not touch; it comes from base (#207383/#208163). The built-CLI e2e passes locally (13 s). Co-authored-by: Ayaan Zaidi <[email protected]> * chore(release): close out 2026.11.12 on main (#208158) * chore(release): close out 2026.11.12 on main Co-authored-by: RomneyDa <[email protected]> * fix(release): leave locale refresh to its dedicated workflow Co-authored-by: RomneyDa <[email protected]> * ci: refresh closeout checks after main lint fix Co-authored-by: RomneyDa <[email protected]> --------- Co-authored-by: RomneyDa <[email protected]> * test(gateway): remove unused steering cancellation default (#208173) * fix: recognize the file format for extensionless path lookups (#208516) Root cause: extensions/oc-path/src/cli.ts:92 `loadOcPathFile` chose the parser only from the address's file hint, so an extensionless address such as `oc://alias/count` was parsed as Markdown even when `--file settings.json` named a JSON file. Fixes #208496 Thanks @LinzeShi for the report and the fix. ## What Problem This Solves A caller can reuse an address such as `oc://alias/count` and point it at a JSON file with `--file settings.json`. Even when the file contains `count`, `path resolve` and `path find` report no match and `path set --value-json` refuses the edit. `path emit` already identifies the same file as JSON. ## Fix The shared loader now falls back to the file name when the address has no recognized extension: `kind = addressKind ?? inferKind(absPath)`. `resolve`, `find` and `set` all load through it. A format in the address still wins, so `oc://x.json/count --file snapshot.txt` keeps reading JSON. An unknown file extension with no address hint still parses as Markdown, as before. ## Tests One table-driven case in `cli.test.ts` runs resolve, find and a real `set` for both directions (extensionless address on `settings.json`, red on the merge base; JSON address on `snapshot.md`). The near-duplicate `CLI-R04` YAML resolve smoke test was removed: `CLI-F01` already resolves YAML leaves from the workspace. This keeps the file under its line cap. ## Evidence Built CLI (`pnpm build`, `node openclaw.mjs path ...`) in a clean container with only the oc-path plugin enabled, merge base `8ec71b2a1326` vs this branch. Output is in the evidence comment linked below. - Base: `resolve oc://alias/count --file settings.json` -> exit 1 `resolved:false`; `find 'oc://alias/*'` -> 0 matches; `set ... 2 --value-json` -> `not-writable`. - Fix: resolve -> `valueText "1"`; find -> `oc://alias/count`; set -> exit 0, file is now valid JSON `{"count":2}`. - Unchanged on both: `oc://x.json/count --file snapshot.txt` (JSON, resolve and set), `--file data.unknownext` (no match, emit kind `md`), Markdown frontmatter resolve/set through `oc://AGENTS.md/...` and `oc://alias/...`. Evidence comment: https://github.com/openclaw/openclaw/pull/208516#issuecomment-7261291447 ## Merge danger Two-way door: a revert fully undoes it. No stored state, config or contract change. Blast radius: `openclaw path resolve|find|set` when the address has no recognized extension and `--file` has one. Co-authored-by: Ayaan Zaidi <[email protected]> * fix: keep automatic Activity recaps on the session provider (#208460) Derive the utility route from the same session model and account used for dashboard titles. Preserve configured utility fallbacks and the no-primary-retry policy when the recap chain is exhausted. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 0e68b312-2003-42fd-88df-918a4c915065 * fix: keep the draft caret when closing chat search (#208428) Restore the rich editor’s selection when transcript search closes. Keep the original shortcut control as the focus target and fall back to the composer if that control was removed. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: a91ce076-21d5-4792-8b57-8d51daf9370a * fix: point automations to their signed-out account (#208493) Keep an unavailable fallback model from masking the recorded account refusal. Preserve the catalog miss for the fallback itself and leave cross-provider jobs scheduled. Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 97c31b82-4f5b-4790-bc72-b34b555bb286 * fix(cli): one run deadline for openclaw agent on both routes (#208522) ## What Problem This Solves One command, two deadlines. Without `--timeout`: - `openclaw agent` through the Gateway sent a CLI fallback of **600 s** (`--timeout ?? agents.defaults.timeoutSeconds ?? 600`) as the run's per-attempt deadline. At 600 s the Gateway aborted the attempt and the run ended with `timeoutPhase: "provider"` and "Request timed out before a response was generated". - `openclaw agent --local` resolved `agents.defaults.timeoutSeconds`, which defaults to **48 hours**, as Gateway turns and cron do. - `openclaw agent exec` hardcoded **600 s**. So long coding tasks finished with `--local` and were cut at 10 minutes through the Gateway. In a long-task coding evaluation (DeepSWE), 3 of 5 Gateway-route trials ended at 607–608 s, while `--local` trials of the same tasks ran 1,084–2,279 s without a cut. The 600 s dates from when the CLI waited on a bounded client timer. That wait has been unbounded for a long time (the CLI waits for the Gateway's terminal result), but the 600 kept travelling as the run's own deadline. Three related bugs come from the same CLI-side value: 1. **Remote Gateway config was overridden.** The CLI sent the CLI host's `agents.defaults.timeoutSeconds`, so a remote Gateway's own setting never applied to CLI turns. 2. **Subagent timeouts were shadowed.** The Gateway gives a turn into a live registered subagent session that subagent's `runTimeoutSeconds` only when the request carries no timeout. The CLI always sent one. 3. **The docs matched only one route.** They said "default 600" for `openclaw agent`, which was true on the Gateway route and false with `--local`. ## Fix `resolveAgentTimeoutMs` (`agents.defaults.timeoutSeconds`, default 48 h) is now the only owner of how long `openclaw agent` and `openclaw agent exec` run, on both routes. - The Gateway route sends `timeout` only when `--timeout` is given; the Gateway resolves the default exactly as for every other turn. - `agent exec` no longer hardcodes 600; without `--timeout` its embedded run resolves the same default. - The CLI's wait for a yielded turn's subagents has no deadline unless `--timeout` is given. It still ends on the follow-up reply, Ctrl-C or disconnect. - Removed the stale transport hint "use --timeout <seconds> to extend the CLI wait". - Help text and docs now state one default for every route: `docs/cli/agent.md`, `docs/tools/agent-send.md`, `docs/gateway/cli-backends.md`, `docs/tools/autoreview.md`, `docs/plugins/codex-harness-reference/timeouts.md`. `--timeout N` behaves exactly as before on both routes, including `0` (unlimited). ## Behavior change - **Old:** without `--timeout`, `openclaw agent` through the Gateway and `openclaw agent exec` stopped each model attempt at **600 s (10 minutes)**. - **New:** they use `agents.defaults.timeoutSeconds`, which is **48 hours** unless configured, the same deadline as `openclaw agent --local`, Control UI and channel turns, and cron. - **To keep the old cap:** pass `--timeout 600`, or set `agents.defaults.timeoutSeconds: 600` in the config (the Gateway's config on the Gateway route). - **Accepted cost:** a script or CI job that relied on the implicit 600 s cap and passes no `--timeout` loses it. A run that neither stalls nor repeats can then run until 48 hours or the job's own limit. Stalled and looping runs are still stopped by the model idle timeout (120 s without output) and the existing loop guards. - **The timeout message** now names the limit that fired and how to raise it: "…the run reached its 10m limit. Please try again, or raise the limit with `--timeout <seconds>` for `openclaw agent`, or `agents.defaults.timeoutSeconds` in your config." ## User Impact - Long tasks through the Gateway are no longer stopped at 10 minutes; `--local` is unchanged. - **Default change:** Gateway-route `openclaw agent` and `agent exec` without `--timeout` now get `agents.defaults.timeoutSeconds` (48 h unless configured) instead of 600 s. Scripts that relied on the implicit 10-minute stop should pass `--timeout 600`. - Autoreview passes launched without a helper timeout can now run up to `agents.defaults.timeoutSeconds` (48 h unless configured) instead of 600 s; helpers that set a timeout are unchanged. - A scripted `openclaw agent` whose yielded turn waits on subagents now waits until they settle (or Ctrl-C/disconnect) instead of exiting 1 at 600 s; pass `--timeout` to bound that wait. - A dead provider is still caught by the model idle timeout (120 s without output). A looping agent is bounded by the configured run deadline and the existing runaway guards. - If the CLI process is killed with SIGKILL or its connection drops, an accepted Gateway run continues and its result is added to the session (accepted execution is bound to the Gateway lifetime, not the caller's connection). Ctrl-C/SIGTERM still sends `chat.abort`, as before. ## Evidence - Red on the merge base, green with the fix: - `src/commands/agent-via-gateway.deadline.test.ts`: without `--timeout`, the Gateway request carries no `timeout` for a local and a remote Gateway (main sent 600 from the CLI host's config). - `src/commands/agent-exec.test.ts`: `agent exec` without `--timeout` passes no timeout to the run (main passed "600"). - `src/cli/program/register.agent.test.ts`: `agent exec fix` without `--timeout` reaches the command with no timeout (main's Commander default injected "600"). - The Gateway already gives a timeout-less request into a registered subagent session that subagent's budget (`agent.session-followup` suite, unchanged). - Affected consumers rerun green: `agent-via-gateway.test.ts`, `agent-via-gateway.yield.test.ts`, `register.agent.test.ts`. - Real-product evidence: the long-task evaluation above (Gateway route 3 of 5 trials cut at 600 s; `--local` none cut). - `src/agents/embedded-agent-runner/run/terminal-timeout.test.ts`: the provider timeout message names the limit that fired (from the run's deadline), `--timeout <seconds>` and `agents.defaults.timeoutSeconds`. Co-authored-by: Ayaan Zaidi <[email protected]> * test(gateway): keep restart recovery fixtures under Gateway ownership (#208302) The shared test harness sets VITEST, which skips the singleton lock. In the restart-resume and yield-restart CI failures, offline SQLite maintenance took the state database while a live Gateway was resuming work. Clear both test markers for those child processes and verify the replacement Gateway owns the lock in the existing SIGKILL case. * chore(ui): refresh control ui locales (#208547) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * fix: reply to agent turns whose session key has uppercase letters (#208435) ## What Problem This Solves `openclaw agent --local` stops with no reply and no error when the session key contains an uppercase letter. Examples are a Slack channel id (`agent:main:channel:C0123ABCDEF`) or a mixed-case DM name (`agent:main:dm:Dana-Okafor`). - No model request is made. Stdout is empty. Node prints only `Warning: Detected unsettled top-level await` and exits with code 13. - Scripts, CI jobs, cron and evaluation harnesses that drive one-shot turns get nothing back. - The OpenAI-compatible HTTP endpoints (`/v1/chat/completions`, `/v1/responses`) with an uppercase `x-openclaw-session-key` never answer: the request hangs in the Gateway. - Lowercase keys, and the Gateway `agent` route, work. Regression from #175837 (one session controller for turns, queues and Stop), first released in v2026.11.5. 2026.10.x and 2026.11.1-11.4 reply normally. On the commit before #175837, both spellings reach the model step; on #175837, the uppercase spelling hangs. ## User Impact - One-shot `agent --local` turns and OpenAI-compatible HTTP requests with mixed-case session keys run and reply again. - They reach the same session as the lowercase spelling, as the Gateway route already does. - `--json` output now reports the stored (canonical) spelling of the session key, which is the spelling the Gateway route already prints. - Signal group ids and Matrix room ids keep their case. Two peers whose ids differ only by case stay two separate sessions. ## Why This Change Was Made The agent command claims a session twice, under two spellings of the same key: - `resolveSessionKeyForRequestInternal` (`src/agents/command/session.ts`) read the store with the canonical key (`normalizeStoreSessionKey`) but returned the request spelling. - The outer turn (`agentCommandInternal` → `withSessionTurn`) claimed the session under that request spelling. - The nested embedded run claims it under the canonical store key. - The session controller matches aliases exactly, so the nested claim did not join the outer turn. Both claims share the session id, so the nested claim queued on the same controller entry behind the outer turn and waited for it forever. - Nothing else was pending, so a one-shot Node process drained its event loop and exited 13. A Gateway process kept the HTTP request open instead. The fix returns the canonical key from the resolver's final path, as its session-id paths already do. `resolveSession`'s second normalize is removed. A request spelling no longer reaches the session controller. #142746 chose to keep the request spelling ("routing keeps the request key"). That choice was harmless until the session controller started matching aliases exactly. The table test that pinned the request spelling now pins the canonical locator, with a note that it supersedes #142746. Caller audit: | Reader | Effect | |---|---| | `resolveSession` → agent command (`--local`, Gateway ingress, HTTP, plugin runtime, hooks) | Gets the canonical key. The Gateway `agent` route already canonicalized, so it is unchanged. | | `resolveSessionKeyForRequestCore`: `session-bootstrap.ts` backfill and Gateway `agent-request-routing.ts` | Inputs are session ids only. These take the session-id paths, which were already canonical. Unchanged. | | `resolveSessionKeyForRequestCore`: `agent-via-gateway.ts` (Gateway route, non-agent-shaped keys) | The result is sent to the Gateway, which canonicalizes it with the same codec. No behavior change. | | `resolveExistingSessionKeyForRequest` (`run-session-target.ts`, `agent-request-routing.ts`) | Session-id lookups. Unchanged. | | `--deliver` | Targets come from `--to`/`--channel` or the session entry's stored route (`resolveAgentDeliveryPlanWithSessionRoute`), not from parsing the key. The outbound session key now equals the runner's key. The Gateway route already passed canonical keys here. | | `--json` | Prints the canonical spelling (the Gateway route already does). | ## Entry point audit: one canonicalizer There is one codec that turns a caller's session key into the stored spelling: `normalizeSessionKeyPreservingOpaquePeerIds` (`packages/session-url-contract/src/session-key-normalization.ts:117`). It lowercases the key except Signal group ids and Matrix room ids. Every other name is a thin wrapper over it: - `normalizeStoreSessionKey` (`src/config/sessions/store-entry.ts:16-18`) returns `normalizeSessionKeyPreservingOpaquePeerIds(sessionKey)` and nothing else. - `parseAgentSessionKey` (`session-key-normalization.ts:160-164`) parses the codec's output. `toAgentStoreSessionKey` (`src/routing/session-key.ts:91`) uses that parse and the codec. - The Gateway's `resolveSessionStoreKey` / `resolveSessionStoreIdentity` (`src/gateway/session-store-key.ts:144`, `:255`) call the codec directly. The nested embedded run always claims the session under this spelling (`src/agents/embedded-agent-runner/run/session-bootstrap.ts:328-338`), so every outer claim must use it too. | Entry point | Path to the session claim | Calls the codec? | |---|---|---| | Gateway `agent` | `src/gateway/agent-turn/agent-request-routing.ts:252` uses the store identity from `session-store-key.ts:255` → `agentCommandFromGatewayIngress` → `resolveSession` | Yes, already on `main` | | `agent --local` | `src/commands/agent-via-gateway.ts:845` → `agentCommand` → `src/agents/command/prepare.ts:242` `resolveSession` → `src/agents/command/session.ts:475-486` | **This PR.** `main` returned the typed spelling. Red-on-main test. | | `/v1/chat/completions` | `src/gateway/openai-http.ts:437` (raw header or `user` key) → `src/gateway/openai-compatible-agent-run.ts:177` → `resolveSession` | **This PR.** Red-on-main test. | | `/v1/responses` | `src/gateway/openresponses-http.ts:272` → `openai-compatible-agent-run.ts:177` → `resolveSession` | **This PR.** Red-on-main test. | | Hooks and webhooks | `src/gateway/server/hooks.ts:315` runs a cron turn with `session:<key>`; `hooks.ts:449` builds its queue key with `resolveCronAgentSessionKey` | Yes, already on `main`, through the cron row | | Cron session targets | `src/cron/session-target.ts:29` → `src/cron/isolated-agent/run-prepare.ts:150` → `src/cron/isolated-agent/session-key.ts:15` `toAgentStoreSessionKey` (run: `agent:main:hook:GitHub-PR-1` → `agent:main:hook:github-pr-1`; `agent:main:signal:group:AbC123` unchanged) | Yes, already on `main` | | `sessions_send` by key | `src/agents/tools/sessions-send-executor.ts:334` `resolveSessionStoreKey`, then the Gateway `agent` method (`sessions-send-tool.delivery.ts:483`) | Yes, already on `main` | | ACP via the agent command or channel dispatch | `src/agents/command/prepare.ts:321` (`acpResolution` from `resolveSession`'s key); `src/auto-reply/reply/dispatch-acp.ts:127` (resolved ACP key) | Yes (agent-command ACP turns through this PR) | | ACP control plane | `src/acp/control-plane/manager.utils.ts:63-85` `resolveAcpSessionTarget` and `acpSessionActorKey` | **This PR.** `main` lowercased with a plain `toLowerCase` before the store codec, which merged case-distinct Signal/Matrix peers into one actor and pointed a mixed-case key at its lowercase neighbor's row. Both now use `normalizeStoreSessionKey`. Red-on-main test. | Also in this PR, `resolveSessionKeyForRequestInternal` normalizes before main-alias matching. `agent:main:MAIN` with a custom `session.mainKey` now reaches the configured main session instead of a separate `agent:main:main` row (red-on-main test). No other listed entry point bypasses the codec. ## Evidence Reproduced on `main` (cdb53aff) through the published entry point (`node openclaw.mjs agent --local … --json`), with an isolated state dir and no provider (a turn that reaches the model step ends in a visible `Unknown model` error): - 8 of 8 runs with uppercase keys exited 13 with empty stdout and made no model request. 4 of 4 runs with lowercase keys reached the model step. - Swapping case moves the failure: `agent:main:channel:c3tt2oeiaj7` works and `agent:main:dm:Marcus-Lindqvist` fails, so the trigger is case, not the channel kind. - With a local fake OpenAI-compatible provider: `--local` with a lowercase key replied "OK"; with an uppercase key it exited 13 with 0 provider requests. The Gateway `agent` route with the uppercase key replied "OK". `POST /v1/chat/completions` with `x-openclaw-session-key: agent:main:openai:HttpUpper-ABC` got no response in 60 s (0 provider requests); the lowercase spelling answered 200. - An `async_hooks` trace located the pending promise in `claimSessionControllerTask` (the nested claim waiting behind the outer turn on the same controller entry). A probe showed the outer key `…Marcus-Lindqvist` and the nested key `…marcus-lindqvist`. Tests (red on the merge base, green on this branch): - `src/agents/command/session.exact-target.test.ts`: the resolver returns the persisted locator (ULID, Slack-style channel, mixed-case DM and case in the `agent:Main:Signal` prefix are red on base). Both spellings continue the same session. Signal and Matrix opaque peer ids keep their case. Peers that differ only by case (`signal:group:AbC123` / `abc123`, and the same for Matrix) stay separate sessions with separate entries and session ids. That test is green on base too: main already keeps them apart, and this change keeps that. - `src/commands/agent-local.session-key-case.test.ts`: real `agent --local` turns against a fake provider, each bounded by a 45 s race. The Slack-style channel and mixed-case DM rows are red on base ("did not settle"). The case-only Signal pair runs two turns with two distinct sessions. - `src/gateway/openai-compatible-session-key-case.server.test.ts`: `/v1/chat/completions` and `/v1/responses` with an uppercase `x-openclaw-session-key`. Both are red on base ("did not answer" within 45 s). On this branch both reach the model step. - `src/acp/control-plane/manager.utils.session-key-case.test.ts` (new): case-distinct Signal group and Matrix room pairs resolve to distinct ACP targets and actor keys, and the mixed-case target finds its own persisted row. Both rows are red on the merge base, where the targets came out lowercased and merged. - `session.exact-target.test.ts` main-alias rows: `agent:main:MAIN` / `agent:main:Main` with `session.mainKey: "work"` resolve to `agent:main:work`. Red on the merge base, which returned `agent:main:MAIN`. - ACP consumers green after the ACP change: `manager.test`, `manager.initialize-session`, `manager.cancel-session`, `manager.runtime-handle-ensure.reset`, `agent.acp`, plus the three session-key-case files (6 shards). - Consumers rerun green: `session-store`, `session.yielded-parent-reuse`, `agent-command.live-model-switch`, `embedded-agent-runner.e2e`, `session-bootstrap.detached`, `session-suspension`, `agent.session`, `agent-via-gateway` (8 shards). - `pnpm check:changed`: typecheck, lint, format and guards pass. The dead-export scan fails on five exports this change does not touch (the same on `main`). The same CLI reproduction on this branch: all 12 runs reach the model step and end with the visible `Unknown model` error (exit 1, JSON on stdout). None exits 13. | case | session key | exit | stdout | wall | stderr marker | |---|---|---|---|---|---| | lower 1 (fresh) | agent:main:dm:marcus-lindqvist | 1 | 260 B | 8s | Unknown model: openai/gpt-5-mini | | upper 1 (after DM) | agent:main:channel:C3TT2OEIAJ7 | 1 | 260 B | 5s | Unknown model: openai/gpt-5-mini | | upper 2 (repeat) | agent:main:channel:C3TT2OEIAJ7 | 1 | 260 B | 6s | Unknown model: openai/gpt-5-mini | | lower 2 (same session, lowercase) | agent:main:channel:c3tt2oeiaj7 | 1 | 260 B | 11s | Unknown model: openai/gpt-5-mini | | upper 3 (mixed-case DM) | agent:main:dm:Marcus-Lindqvist | 1 | 260 B | 6s | Unknown model: openai/gpt-5-mini | | upper 4 (mixed-case DM repeat) | agent:main:dm:Marcus-Lindqvist | 1 | 260 B | 6s | Unknown model: openai/gpt-5-mini | | lower 3 | agent:main:dm:marcus-lindqvist | 1 | 260 B | 9s | Unknown model: openai/gpt-5-mini | | upper 5 (fresh state, first turn) | agent:main:channel:C3TT2OEIAJ7 | 1 | 260 B | 7s | Unknown model: openai/gpt-5-mini | | upper 6 (Slack-style) | agent:main:slack:channel:C0123ABCDEF | 1 | 260 B | 9s | Unknown model: openai/gpt-5-mini | | upper 7 | agent:main:dm:Dana-Okafor | 1 | 260 B | 10s | Unknown model: openai/gpt-5-mini | | upper 8 (case in prefix) | agent:Main:Channel:C3TT2OEIAJ7 | 1 | 260 B | 12s | Unknown model: openai/gpt-5-mini | | lower 4 | agent:main:channel:c0123abcdef | 1 | 260 B | 8s | Unknown model: openai/gpt-5-mini | Merge danger: two-way door. No stored data, schema, config or protocol changes. Stored session rows already use the canonical key, so a revert restores the old behavior exactly. Blast radius: every caller of the agent command that passes a mixed-case session key. Co-authored-by: Ayaan Zaidi <[email protected]> * fix(release): keep Doctor deprecation deadlines from blocking frozen release sources (#207875) Release npm preflight now enforces the Doctor deprecation registry as of the source's main merge base, through a trusted harness preload. Deadlines reached after a release line leaves main are reported as warnings instead of blocking publication. Main CI and PR guards keep wall-clock enforcement. Co-authored-by: RomneyDa <[email protected]> * fix: show who answered a recovered Linux Quick Chat message (#208515) Keep the original agent's display name with a Quick Chat send so a recovered reply shows who answered when the Gateway default changes. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 31cd1031-73b1-4ad1-8770-1aa7c5fb79f9 * fix: keep fork compaction off the parent’s Claude account (#208415) Check the selected Claude account against the saved native session before manual compaction, including after a restart. A fork can compact on its selected account after its first ordinary turn establishes a native session there. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 34da9584-a62a-4ed5-8cf3-a0b3e6387e25 OpenClaw-Publication: 4527fb28-07bf-43c1-854e-e4a27bd33b16 * fix: keep images for unlisted Ollama Cloud vision models (#208531) Inspect the selected tag through the configured daemon without pulling it. Keep the previous fallback when the daemon cannot describe an unlisted cloud model. Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 374db0dd-bba5-450f-b42d-fed88841557f * fix(agents): seed the first persistent turn after a one-shot run (#208502) ## Problem A one-shot run (`openclaw agent --local`, `agent exec`) in a non-empty workspace blocks the first persistent conversation there for 24 hours. Repro on main with the built CLI and a fake model: 1. `openclaw setup --baseline --workspace .` in a project directory holding `README.md` (git or not) 2. `openclaw agent --local -m hi`: works 3. `openclaw gateway run`, then `openclaw agent -m hi`: fails before any model call with `OpenClaw workspace appears to have disappeared after a recent initialization ... | WORKSPACE_VANISHED` The same project without step 2 works. Users affected: anyone who tries a one-shot turn in a project workspace and then uses the Gateway, Control UI or a channel. The skip-then-seed sequence also happens without a Gateway: `agent exec`, then any persistent chat. Cause: in `ensureAgentWorkspaceOwned` (src/agents/workspace.ts), the no-seed branch writes a disappearance attestation for any non-empty workspace without initializing it. Since #206477, every one-shot run takes that branch. The seeding branch then sees no persona files, reads the fresh attestation as "OpenClaw initialized this workspace", and refuses as if the workspace had been wiped. Shipped in v2026.12.1-beta.2. ## Solution One owner, one meaning: only a workspace OpenClaw initialized can vanish. "Initialized" is the existing setup-state marker (`bootstrapSeededAt` / `setupCompletedAt`). That marker lives in SQLite (`workspace_setup_state`, src/agents/workspace-state-store.kernel.ts:69-75), outside the workspace, so `git clean` or a lost mount cannot remove it. Legacy in-workspace state is never parsed at runtime (src/agents/workspace-legacy-state.ts:1-2). The brand-new path in `ensureAgentWorkspaceOwned` now: - refuses when the marker is present and either the attestation or the setup state is recent. This keeps the vanished-workspace guard (#88333) for a lost mount, `git clean -fd`, `git stash -u` and a wipe that leaves project files. Recent setup state without an attestation was already refused further down, by `clearExpiredState`; the refusal now happens explicitly at this decision. - seeds normally when there is no marker. The attestation then came from a no-seed run, and the workspace was never initialized. A no-seed attestation also stops steering the first seeding turn: - The first seeding turn no longer reads attestation hashes when it decides whether setup is complete. In that branch there is no marker, so any attestation came from a no-seed run and never recorded seeded files. Paths that run with a marker (survival evidence, completion repair) still read the hashes, as before. - The "recently attested customization" shortcut is removed. It could fire only without a marker, so a project `AGENTS.md` skipped `BOOTSTRAP.md` after a one-shot turn but not without one. - An expired attestation alone no longer marks a brand-new workspace as "reseeding expired state"; only the marker does. Before, a git project seeded `BOOTSTRAP.md` after 24 h but not before. Writers of an attestation without a setup marker (all in the no-seed branch, src/agents/workspace.ts:589-623): one-shot runs (`agent --local`, `exec`), `agents.defaults.skipBootstrap`, and agent creation with deferred initialization (the Template add flow, src/templates/gateway-add-apply.ts:199-203). That branch writes no persona files, only a purpose `AGENTS.md` when a purpose is given, so a never-initialized workspace has no OpenClaw identity to lose. `rg deferInitialization` finds no production caller that combines a purpose with deferred agent creation (`agents-onboarding.ts` defers a session, not agent creation). All of these writers now read the same way at the first seeding turn. No schema change, no new parameter, no new state. ## Impact - `--local`/`exec` followed by a Gateway or chat turn in a project workspace works. The first persistent turn seeds the same files and setup state as it does without the one-shot turn. - Initialized workspaces still refuse with the same messa…
…he Gateway (openclaw#208755) ## What Problem This Solves `openclaw agent --json` through the Gateway returns too early when the agent hands work to a subagent and yields (`sessions_yield`). The CLI prints the yielding turn's envelope (`status: "ok"`, `result.payloads: []`, `result.meta.yielded: true`, `result.requesterContinuationSettled: true`) and exits 0 before the subagent reports and the session resumes. A script, CI job or orchestrator then tears down or moves on while the real work is still pending. Text mode already waits (openclaw#207491), and `--local --json` waits too. Reproduced on main (be5d7c6) through a real isolated Gateway and a scripted model: the turn spawns one child and yields, the child answers after 8 s. | route | exit | time | resumed turn | |---|---|---|---| | Gateway `agent --json` | 0 | 8 s | reaches the model after the CLI exits | | Gateway `agent` (text) | 0 | 24 s | before exit | | `agent --local --json` | 0 | 23 s | before exit; prints the yielding turn's envelope | ## Solution `--json` now uses the same wait as text mode: the existing `createYieldFollower` in `src/commands/agent-gateway-reply.ts`. The two `json ||` early returns are gone. - `--json` writes one document after the follow-up settles: the yielding turn's response, with today's fields. That is the same timing as text mode and `--local --json`. - If the follow-up fails or is aborted, or the wait ends early (explicit `--timeout` or a dropped connection), `--json` writes the documented `ok: false` failure envelope (with `runId` and `origin: "gateway"`) instead of an empty success, prints the same stderr line as text mode, and exits 1. - `SIGINT`/`SIGTERM` during the wait keep the documented signal exit status (130/143) and write nothing to stdout, like any interrupted run: the CLI's signal exit owner exits before the command returns. Text mode behaves the same on main. Not a success, so no empty-success case remains. - No new field, flag, timer, RPC or second envelope. No change to `sessions_yield`. The follow-up's reply text is not added to the `--json` document. The resumed turn is a separate Gateway run, and its full envelope (`result.meta`, `deliveryStatus`) reaches only the in-process announce caller; nothing on the CLI connection supplies it. Putting it on stdout needs a Gateway protocol decision and is out of scope here. The reply is in the session, as with `--local --json` today. ## Bounds - The CLI adds no deadline. The wait ends on the follow-up's terminal `chat` event, an explicit `--timeout` (text-mode rule from openclaw#207491), a signal or connection loss. - Without `--timeout`, the follow-up run gets the Gateway's resolved run deadline (`resolveAgentTimeoutMs`, `agent-turn-source-admission.ts:250`). - Accepted edge, inherited from text mode and not changed here: a native subagent spawned without `runTimeoutSeconds` has no run deadline by default (`agents.defaults.subagents.runTimeoutSeconds`, 0 = no timeout, documented in `docs/tools/subagents/tool-reference.md`). Such a child, or a settle wake the Gateway loses while it stays up, keeps a `--json` wait without `--timeout` open until a signal or disconnect. Bounding that from the CLI would need either a CLI-side deadline (a second owner, which openclaw#208522 removed) or a Gateway-supplied deadline (protocol). A child with a deadline is bounded: in the repro, a child with `runTimeoutSeconds: 10` timed out, the session resumed, and the CLI exited. ## User Impact - `openclaw agent --json` against a Gateway returns after the resumed turn settles, with exit 0, or exits nonzero with the standard failure envelope when the follow-up fails or the wait ends early. It never returns an empty success at the yield. - Text mode and `--local` are unchanged. ## Evidence - Red on main, green here: `src/commands/agent-via-gateway.yield.test.ts`. The three `--json` cases (reply, failed follow-up, aborted follow-up) fail on main (the CLI stopped waiting before the follow-up) and pass here. The other `agent-via-gateway*` and agent CLI suites pass. - Real CLI and Gateway: new case in `test/e2e/agent-route-parity.built-cli.e2e.test.ts`. A scripted model spawns one child and yields; the child answers once the CLI exits or after 3 s. Main dist: the CLI exits before the resumed turn (red). This branch's dist: the resumed turn runs while the CLI waits, stdout is one JSON document with `result.meta.yielded: true`, exit 0 (green). - Real CLI and Gateway, scripted model, isolated state, this branch's dist: - spawn, yield, child answers in 8 s: `agent --json` exits 0 at 16 s, after the resumed turn's model call (main: exit 0 at 8 s, before it); - Gateway stopped during the wait: exit 1, stdout is `{"ok": false, "runId": "…", "origin": "gateway", "error": {"type": "cli_error", "message": "Stopped waiting for the subagents. Their result will still be added to session agent:main:main."}}`, the same line on stderr; - `SIGTERM` during the wait: exit 143, empty stdout (no truncated document; nothing is written on that path). - Docs: `docs/cli/agent.md` notes, `docs/tools/agent-send.md`. Co-authored-by: Ayaan Zaidi <[email protected]>
What Problem This Solves
One command, two deadlines. Without
--timeout:openclaw agentthrough the Gateway sent a CLI fallback of 600 s (--timeout ?? agents.defaults.timeoutSeconds ?? 600) as the run's per-attempt deadline. At 600 s the Gateway aborted the attempt and the run ended withtimeoutPhase: "provider"and "Request timed out before a response was generated".openclaw agent --localresolvedagents.defaults.timeoutSeconds, which defaults to 48 hours, as Gateway turns and cron do.openclaw agent exechardcoded 600 s.So long coding tasks finished with
--localand were cut at 10 minutes through the Gateway. In a long-task coding evaluation (DeepSWE), 3 of 5 Gateway-route trials ended at 607–608 s, while--localtrials of the same tasks ran 1,084–2,279 s without a cut.The 600 s dates from when the CLI waited on a bounded client timer. That wait has been unbounded for a long time (the CLI waits for the Gateway's terminal result), but the 600 kept travelling as the run's own deadline.
Three related bugs come from the same CLI-side value:
agents.defaults.timeoutSeconds, so a remote Gateway's own setting never applied to CLI turns.runTimeoutSecondsonly when the request carries no timeout. The CLI always sent one.openclaw agent, which was true on the Gateway route and false with--local.Fix
resolveAgentTimeoutMs(agents.defaults.timeoutSeconds, default 48 h) is now the only owner of how longopenclaw agentandopenclaw agent execrun, on both routes.timeoutonly when--timeoutis given; the Gateway resolves the default exactly as for every other turn.agent execno longer hardcodes 600; without--timeoutits embedded run resolves the same default.--timeoutis given. It still ends on the follow-up reply, Ctrl-C or disconnect.docs/cli/agent.md,docs/tools/agent-send.md,docs/gateway/cli-backends.md,docs/tools/autoreview.md,docs/plugins/codex-harness-reference/timeouts.md.--timeout Nbehaves exactly as before on both routes, including0(unlimited).Behavior change
--timeout,openclaw agentthrough the Gateway andopenclaw agent execstopped each model attempt at 600 s (10 minutes).agents.defaults.timeoutSeconds, which is 48 hours unless configured, the same deadline asopenclaw agent --local, Control UI and channel turns, and cron.--timeout 600, or setagents.defaults.timeoutSeconds: 600in the config (the Gateway's config on the Gateway route).--timeoutloses it. A run that neither stalls nor repeats can then run until 48 hours or the job's own limit. Stalled and looping runs are still stopped by the model idle timeout (120 s without output) and the existing loop guards.--timeout <seconds>foropenclaw agent, oragents.defaults.timeoutSecondsin your config."User Impact
--localis unchanged.openclaw agentandagent execwithout--timeoutnow getagents.defaults.timeoutSeconds(48 h unless configured) instead of 600 s. Scripts that relied on the implicit 10-minute stop should pass--timeout 600.agents.defaults.timeoutSeconds(48 h unless configured) instead of 600 s; helpers that set a timeout are unchanged.openclaw agentwhose yielded turn waits on subagents now waits until they settle (or Ctrl-C/disconnect) instead of exiting 1 at 600 s; pass--timeoutto bound that wait.chat.abort, as before.Evidence
src/commands/agent-via-gateway.deadline.test.ts: without--timeout, the Gateway request carries notimeoutfor a local and a remote Gateway (main sent 600 from the CLI host's config).src/commands/agent-exec.test.ts:agent execwithout--timeoutpasses no timeout to the run (main passed "600").src/cli/program/register.agent.test.ts:agent exec fixwithout--timeoutreaches the command with no timeout (main's Commander default injected "600").agent.session-followupsuite, unchanged).agent-via-gateway.test.ts,agent-via-gateway.yield.test.ts,register.agent.test.ts.--localnone cut).src/agents/embedded-agent-runner/run/terminal-timeout.test.ts: the provider timeout message names the limit that fired (from the run's deadline),--timeout <seconds>andagents.defaults.timeoutSeconds.