Skip to content

fix(gateway): start under a group-writable HOME when file logs are unavailable - #208499

Merged
obviyus merged 2 commits into
mainfrom
fix/gateway-unsafe-log-dir-startup
Nov 29, 2026
Merged

obviyus merged 2 commits into
mainfrom
fix/gateway-unsafe-log-dir-startup

Conversation

@obviyus

@obviyus obviyus commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

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 (refactor(ui): lowercase log search text only once #207383/improve: do less work when a new Gateway log line arrives #208163). The built-CLI e2e passes locally (13 s).

…available

The Gateway startup summary awaited the default log path and failed startup when the
log directory was unsafe, while the file transport and --local only drop file logs.
getResolvedLoggerSettings now reports the path as absent instead of throwing; the
startup line prints `log file: unavailable` and Doctor reads the same field.
@clawsweeper

clawsweeper Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added gateway Gateway runtime commands Command implementations size: S labels Nov 29, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. clawsweeper:intake:bug Preliminary submission classification; full source review pending. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. labels Nov 29, 2026
@clawsweeper

clawsweeper Bot commented Nov 29, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs changes before merge.

What this changes

This PR lets Gateway startup continue when the default file-log directory is unavailable and reports that outcome consistently to Gateway and Doctor.

Example: On Linux, HOME has mode 0775 and both default logging roots are rejected.

  • Before: Gateway startup fails while resolving the log pathname.
  • After: Gateway startup reports “log file: unavailable” while the transport drops records and warns how to repair the directory.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) A worthwhile, focused ownership repair with limited runtime evidence and one concrete consumer type error.
Proof confidence 🦐 gold shrimp (3/6) The author reports built-CLI main/branch comparisons using isolated HOME 0775 and a synthetic model server, but supplies no inspectable runtime artifact; the committed regression supports the scenario, and the proof exemption makes additional evidence optional.
Patch quality 🦪 silver shellfish (2/6) 1 actionable review finding remain.

The scores reflect the reviewer's assessment. Real behavior proof is not required for maintainer- or bot-authored pull requests.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: A container or shared-HOME installation cannot start its Gateway because an informational log-path lookup fails.
Reason: The maintainer-authored direction restores useful Gateway operation while retaining the existing best-effort logging and unsafe-write refusal contracts.

Merge readiness

⛔ Needs changes before merge - 1 item remains

This PR addresses a current Gateway startup failure and should stay open, but the optional-file return type leaves an existing test with a blocking TypeScript error.

Reviewed head: 0c7c1963e646f91073705e86ebc97fd188c17952

Before merge

  • Narrow the remaining settings test’s optional file value (P2) - Changing this return type makes settings.file a string | undefined, but src/logging/logger-settings.test.ts:112 still calls path.basename(settings.file). The repository enables strict TypeScript checking and includes that test in its state-logging graph, so this introduces a type error even when runtime logging succeeds. Narrow the successful-path value in that test before passing it to basename, preserving the assertion that a default file exists.

Findings

  • [P2] Narrow the remaining settings test’s optional file value — src/logging/logger.ts:642-643
Agent review details

How this fits together

The logging settings reader resolves the transport’s default pathname for Gateway startup and Doctor; filesystem admission remains owned by the logging worker and secure temporary-directory resolver.

flowchart TD
  A[Gateway startup] --> C[Logging settings reader]
  B[Doctor hints] --> C
  C --> D[File log transport]
  D --> E[Logging worker]
  E --> F[Directory admission]
  F --> G[Path or unavailable outcome]
Loading

Technical review

Best possible solution:

Keep the centralized unavailable-path outcome and complete the successful-path type narrowing in the existing logger settings test.

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

Current-main source shows unsafe default-directory rejection escaping the awaited startup summary; the author reports matching built-CLI failures, but this read-only review ran no target code.

Is this the best way to solve the issue?

The existing settings reader is the appropriate owner for an unavailable reporting value, and both production callers are migrated without weakening directory admission or changing the exported SDK settings type.

Full review comments:

  • [P2] Narrow the remaining settings test’s optional file value — src/logging/logger.ts:642-643
    Changing this return type makes settings.file a string | undefined, but src/logging/logger-settings.test.ts:112 still calls path.basename(settings.file). The repository enables strict TypeScript checking and includes that test in its state-logging graph, so this introduces a type error even when runtime logging succeeds. Narrow the successful-path value in that test before passing it to basename, preserving the assertion that a default file exists.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.97

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 66c33cd8dd51.

Provenance checked

  • Default log-path reporting changes intended behavior with a stated reason (5d6a026: Move filesystem admission into the existing worker and propagate refusal instead of returning an unqualified pathname.)
  • Unsafe-directory write refusal and diagnostics keeps the original intent (88eb3d5: Explain the rejected ancestor and its chmod repair while continuing to drop unsafe file writes.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

Acceptance criteria:

  • pnpm test src/logging/logger-settings.test.ts
  • pnpm exec tsgo -p test/tsconfig/tsconfig.core.test.state-logging.json --incremental false

What I checked:

PR surface

Source +1, Tests +80. Total +81 across 7 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 3 11 10 +1
Tests 4 91 11 +80
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 7 102 21 +81

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Labels

Label changes:

  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Label justifications:

  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦐 gold shrimp and patch quality is 🦪 silver shellfish.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action.

Rating scale

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

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed November 29, 2026, 1:57 PM ET / 18:57 UTC.

LoggerResolvedSettings carries the unavailable outcome itself instead of a forked
return type; the remaining settings-test reader asserts its configured path.
@obviyus
obviyus merged commit d2b231e into main Nov 29, 2026
158 of 159 checks passed
@obviyus
obviyus deleted the fix/gateway-unsafe-log-dir-startup branch November 29, 2026 19:34
vyctorbrzezowski added a commit that referenced this pull request Nov 30, 2026
* 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…
tideclaw-bot pushed a commit that referenced this pull request Nov 30, 2026
…available (#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]>

(cherry picked from commit d2b231e)

Release adaptation: Kept the beta permission checks and retry behavior. Ported the required safe-directory warning propagation, HOME-safe diagnostic and regression from 88eb3d5; retained beta transport fixture coverage.

Co-authored-by: RomneyDa <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 30, 2026
…available (openclaw#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 openclaw#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 (openclaw#207383/openclaw#208163). The built-CLI e2e passes locally (13 s).

Co-authored-by: Ayaan Zaidi <[email protected]>
github-actions Bot added a commit to Desicool/openclaw that referenced this pull request Nov 30, 2026
* 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…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

commands Command implementations gateway Gateway runtime impact:ux-friction User-facing flow adds avoidable confusion or support burden without fully blocking progress. P2 Normal backlog priority with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: S status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant