* fix(macos): prevent list_windows from inspecting the host through Peekaboo
* fix(macos): preserve desktop fallback for ineffective foreground actions
* feat(macos,browser): keep approval prompts out of OpenClaw's own automation
Track pending native human-decision surfaces and refuse native computer input while they await a human. Exclude those surfaces from native screen snapshots and reject known Control UI origins in browser automation, including attached tabs.
The separate CUA driver and third-party automation remain out of scope. Related: #174663.
* fix(macos,browser): cover approval sheets and local Control UI aliases
* fix(macos): settle held input when approval blocks automation
* refactor(browser): keep Control UI origin helper internal
* fix(browser): recheck approval tab origin before focus and close
* fix(macos,browser): guard ongoing input and browser cleanup
* fix(browser): inspect protected tabs after stop admission
* fix(browser): recheck Control UI before Chrome MCP effects
* test(browser): share snapshot session fixtures across MCP suites
* Revert "test(browser): share snapshot session fixtures across MCP suites"
This reverts commit b9e6cccc58f58dfcfc5e3a02d26c02efeb8134b9.
* Revert "fix(browser): recheck Control UI before Chrome MCP effects"
This reverts commit f3ad8c27612f5b93ecb61bc6ad8232ddfb00109d.
* refactor(macos): scope approval hardening to native automation
* fix(macos): require an approval capture exclusion
* fix(macos): cancel fallback approval panels on Escape
* fix(webchat): persist voice transcript echo into the user turn for internal clients
WebChat/Control UI and the mobile apps are internal, non-deliverable
message channels, so sendTranscriptEcho skipped them and a voice note
sent from those clients left only a placeholder attachment in history:
the user could see neither what the system heard nor replay it.
When tools.media.audio.echoTranscript is enabled and the send originates
from a WebChat client, transcribe the first audio attachment during
user-turn preparation (echo suppressed in the preflight config to avoid
outbound delivery) and append the formatted transcript to the persisted
user turn text. The transcript then survives history reloads through the
regular chat.history projection, without turning WebChat into an
outbound channel. Telegram/other deliverable-channel echo behavior is
unchanged.
* fix(gateway): preserve admitted voice transcripts in chat history
* fix(gateway): handle empty admitted voice text
* fix(gateway): preserve approval and admission for voice transcript echoes
* fix: bind voice transcription to admitted request
* fix: preserve voice workspace and guard conversion
* test(gateway): preserve first-party exports in voice mocks
* test(gateway): await chat-send preparation before input read
* test(gateway): repair voice fixture types
* test(audio): align fixtures with current main contracts
* fix: preserve approved voice transcripts and audio admission waits
* fix(media): preserve preflight attachment outcome warnings
* style(android): wrap voice attachment MIME detection chain
* test(ui): restore placement confirmation fixture imports
Import the session capability type and existing fixture referenced by the merged stop-confirmation tests. The unchanged file fails eight cases before this repair and all 27 cases pass after it.
* test(ui): align placement fixtures with main
Reuse upstream main fixture repair 8dc9734028 and remove the obsolete capability imports. Preserve all stop-confirmation cases and assertions.
---------
Co-authored-by: dankarization <noreply@users.noreply.github.com>
Co-authored-by: dankarization <26330178+dankarization@users.noreply.github.com>
Co-authored-by: Dallin Romney <dallinromney@gmail.com>
* fix(talk): restore archived backing sessions before voice connects
Reuse the channel archive restore owner for authenticated human Talk starts across relay and browser transports. Preserve session identity and history, refuse tombstones, blocked placement and automation before provider creation, and retain current caller and lifecycle checks across restoration.
Fixes#175027. Consult admission and retention remain unchanged. PR CI owns behavioral proof; local validation is limited to changed-file lint and formatting per maintainer policy.
* test(talk): make restore refusal cases lint clean
* test: correct Talk restore fixtures and await watchdog recovery
* refactor(sessions)!: give each session one controller for turns, queues, and Stop
Replace competing turn, queue, cancellation, and lifecycle owners with one controller per physical session. Migrate bundled callers together and retain source and invocation custody through settlement, restart recovery, and deferred maintenance.
Preserve ACP invocation filters, completion phases and durability, sessionless harness queueing, failure retention, cancellation notifications, and lifecycle diagnostics. Include current main recovery and paired-worker behavior.
BREAKING CHANGE: session-keyed setActiveEmbeddedRun requires host admission; plugin RPC context no longer exposes mutable chatAbortControllers or chatQueuedTurns; start-owner observations use startDeadlineAtMs instead of expiresAtMs. Bundled consumers and SDK migration documentation are updated together.
Replaces #165957.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* fix(sessions): retain admitted identity through retry settlement
Recognize only the last admitted requester attempt during retry backoff. Join collected source admissions before selecting retries, preserving the original failure and avoiding replay of a committed sibling.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* fix(sessions): retire dormant tasks before lifecycle deletion
Cancel the selected paused native task through the existing lifecycle cancellation owner and refuse deletion when retirement fails. Preserve the incoming lost-reply-acknowledgment test while moving its import to the controller.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* fix(sessions): preserve lifecycle identity through cancellation
Use canonical identities for lifecycle Stop, retain same-owner obligation retirement across immutable metadata updates, and correct controller contract fixtures. Move type-only dependencies to their existing contract owners.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* fix(sessions): release suspended completion reservations
Release the exact unclaimed completion input only after durable suspension commits, and recheck the current execution owner before restoring mailbox custody. Preserve claimed work and requester cohorts.
Repair admission, ACP persistence, and idempotent Stop fixtures without weakening their ownership checks.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* fix(sessions): retain physical turn custody across runtime callers
Carry the selected controller through admission, native authority, message
completion, Talk steering, plugin reload, and cron cleanup. Join native
cleanup before replacement admission and bind admitted run identity before
tool construction. Preserve optional-run reload callers by capturing their
unique operation once, without adopting unmatched or replacement runs.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* test(cron): align isolated fixtures with physical session custody
Keep mocked session preparation and configured stores on the same fixture-owned path. Surface early terminal failures while waiting for tool construction, and close case-owned databases before removing their directories.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* fix(plugins): preserve incognito active-run steering
Select the incognito store scope before looking up its session controller,
matching explicit steering and the existing session-routing contract.
Keep configured durable-store routing for other sessions.
Prove the public plugin API delivers guidance to the active incognito run
exactly once without introducing another injection owner.
* fix(sessions): keep incognito recovery on its session owner
Resolve fresh recovery input through the existing incognito store selector
before falling back to the configured durable store. The original operation
can then wake the same mailbox after completing its current reply.
Prove that a dormant retry stays blocked until the original owner completes,
then drains exactly once. Release cancelled fixture custody before admitting
its independent predecessor, matching the production caller lifecycle.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* test(sessions): align cleanup fixtures with controller custody
Exercise heartbeat preemption through a real native attachment and retain
the visible-turn barrier until native cleanup settles. Release cancelled
foreground custody before testing an independently owned resend.
Preserve real exports in the cron MCP-retirement mock and regenerate the
mock ledger to remove its obsolete predecessor entry.
* fix(sessions): bind worker events to their exact turn claim
Resolve worker live-event custody through the existing controller operations and full placement claim so shared session IDs cannot lose watchdog progress or cancelled finishing acknowledgments.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* fix(sessions): preserve physical reply routing and question refusals
Carry explicit session stores through initial mailbox admission, dedupe,
and fresh retry inputs without retargeting captured owners. Restore visible
question refusals without queueing an unaccepted answer.
Align runner and interruption fixtures with admitted session identities,
retain exact cancellation reasons, and release fixture work on failures.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* fix(sessions): preserve completed worker replies during Move
Freeze cancellation when the committed worker reply is handed to its caller,
while retaining controller custody until workspace settlement finishes.
Update the Move fixture to release its transfer before waiting for the
controller's subsequent claim-release checkpoint.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* test(sessions): use supported queue settings in retry fixture
Remove the ignored queue-level debounce option from the explicit-store retry regression. The current schema accepts per-channel debounce settings; this fixture does not need one.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* test(sessions): wait for Stop cleanup deadline before advancing time
Observe the real source-settlement owner after durable kill writes, so fake time cannot run ahead of the deadline it is meant to test. Preserve the public Stop response, durable cancellation and ingress assertions.
* fix(sessions): retain Incognito privacy through deferred recovery
Use the captured controller operation key when a diagnostic alias retires before recovery enters the runtime. Keep failure diagnostics for ordinary sessions and cover alias retirement before and during placement recovery.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* fix(sessions): retain exact native attempt ownership
Validate captured controller attachments directly for stream callbacks,
personal-tool participants, and run-ID liveness. Keep ambiguous session-ID
lookup closed while allowing independent stores to retain their exact owners.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* test(sessions): await cancellation before advancing cleanup time
Wait for the actual backend cancellation before advancing the fake cleanup
clock. Cold placement recovery includes real asynchronous preparation.
Keep the existing cancellation, blocked-custody, and delivery assertions.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* fix(sessions): scope timeout recovery to physical owners
Bind timeout abandonment to the exact native attachment and controller entry.
Use the requester's prepared physical target for completion suppression, and
retain operation and marker identity through recovery and successor cleanup.
Remove the session-ID keyed abandonment indexes so matching IDs in another
store cannot reject, replace, or clear an owner's timeout state.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* test(sessions): provide physical requester targets in delivery fixtures
Match the requester activity contract after timeout recovery moved to physical owners. Preserve each fixture’s activity and delivery assertions while supplying its prepared store, key, and session incarnation.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* fix(sessions): bind Talk completion claims to physical owners
Retain each prepared completion claim independently and promote it only through its admitted controller operation. Resolve steering against the captured current attachment, refresh it for same-operation retries, and retain one-shot completion after normal detach. Preserve two-argument replacement and lifecycle/cancellation revocation.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* test(sessions): keep completion replacement in its physical session
Pass the original session key through intervening and replacement fixture registrations. An omitted key allocates a different agent store after completion, which correctly cannot revoke the original owner’s claim. Keep every completion-fencing and one-shot assertion.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* fix(sessions): bind side-question snapshots to native owners
Store live context on the exact native registration and resolve it through the selected transcript file. Keep same-ID physical conversations independent and prevent stale producers or cleanup from replacing a surviving snapshot.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* fix(sessions): target live permissions by physical owner
Carry the resolved session target into the controller permission operation. Keep same-operation retries and current authority checks while refusing successor acknowledgements and avoiding changes to another store's active run.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* test(sessions): await completion owners before assertions and restart
Wait for native foreground completion and the private announcement's public RPC settlement. Retain the exact native cleanup, provider request count, and prompt-prefix assertions without changing test budgets.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* test(agents): preserve diagnostic exports in side-question fixtures
Keep the real diagnostic module surface while overriding the state-change and debug calls used by the side-question fixtures. Regenerate the mock-export baseline to remove the single obsolete closed-factory entry; retain all context and native-cleanup assertions.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* test(agents): keep side-question diagnostics isolated
Retain the explicit diagnostic fixture instead of loading process-wide recovery, scheduler, and configuration owners. Document its intentional isolation for the mock-export guard while preserving the state-change stub and debug capture.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* fix(sessions): settle steering custody by its selected owner
Capture native teardown from the already-selected controller operation. Keep same-ID physical sessions independent and release recipient continuation authority even when the backend queue receipt is delayed.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* test(sessions): synchronize queue and access revocation fixtures
Wait for actual native-thread queue admission before cancelling or checking ordering. Revoke the HTTP reader through draft visibility because membership removal does not remove its configured view permission.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* test(sessions): keep steering fixture on the gateway contract
Use scoped Gateway spies for the physical-owner steering regression. Preserve method dispatch, unexpected-call errors, and all custody assertions without casting the generic caller type.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* test(codex): initialize the native yield deadline clock
Supply the monotonic start captured by real attempts so the fixture keeps its intended execution deadline instead of arming the missing-clock 1 ms fallback. Preserve the native completion wait and cleanup assertions.
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
---------
Co-authored-by: Josh Lehman <550978+jalehman@users.noreply.github.com>
* fix(android): let native Talk wait for slow agent runs
* fix(android): keep Talk completion responsive during history recovery
Keep final events and local cancellation authoritative while observing slow
native Talk turns. Recover unavailable snapshots through the existing reply
history path and cancel the observer when the local waiter finishes.
Document run timeout ownership and add virtual-time regression coverage.
Original fix by Masato Hoshino; preserves the contributor's run-timeout repair.
Fixes#174879.
Co-authored-by: Masato Hoshino <g515hoshino@gmail.com>
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: Masato Hoshino <g515hoshino@gmail.com>
Container isolation governs only sessions placed on the node. A refused sessions.dispatch leaves the session unplaced, so sessions.send runs it on the Gateway; cloudWorkers.requiredProfile is the policy that forbids Gateway-local execution.
Fixes#166351
Related: #169722
## What Problem This Solves
**Existing folder on device** sessions require you to type an absolute path on the paired device. The **Browse folders** picker lists only the Gateway host, so it cannot help you find the folder on the device.
## User Impact
Admins can choose **Browse folders on <device>** in the New Session project menu, open folders on the selected paired device, and click **Use this folder** to fill the device path. Writers still type the path, because node folder listing is admin-only.
## Why This Change Was Made
- The Gateway already routes `fs.listDir` with `nodeId` to the node's directory listing (#105114). #126187 removed that route from New Session together with legacy `execNode` sessions, so the picker cannot reach it now.
- This change reuses the same picker and Gateway route for device-folder sessions only. The menu item appears when all of these are true:
- device folders are available for the selected device
- the operator is an admin
- the device can invoke `fs.listDir`
- Device listings skip Gateway-only side effects: folder approval, the Git checkout probe and project registration.
- The Gateway now keeps a node's `INVALID_REQUEST` folder errors (for example `ENOENT`) as request errors. Before, it reported them as `UNAVAILABLE`. With this change, a stale or partly typed device path opens the device home folder, the same as the Gateway picker does.
- There is no protocol, schema or config change. The listing is not limited to `nodeHost.workerRuns.folders` roots. The device still checks the chosen folder when the session is created. The docs say this.
## Evidence
**Live, isolated Gateway + separate session-host node (both from this branch), real Control UI:**
- Selected the paired node, chose **Browse folders on Synthetic laptop**, and opened `projects/`. The listing showed the node's own home, not the Gateway's.
- Picked `device-only-tries`. The path field filled, and `sessions.create` stored that `deviceFolder`.
- The session dispatched to the device. A turn ran `pwd > proof.txt`, and the file appeared in the picked folder on the node.
- Typed `/nope/missing-on-device`, then chose browse. The picker opened the device home with no error.
| Before (`main`) | After |
| --- | --- |
|  |  |
| Device listing | Picked folder | Missing typed path falls back |
| --- | --- | --- |
|  |  |  |
**Focused tests:**
- `new-session-page.device-folder.e2e.test.ts`: 4 passed, including the new browse-and-create case and the writer case (no browse item).
- `new-session-page.places` and `operator-scopes` e2e: 19 passed, so Gateway browsing still works.
- `draft-place-browser.test.ts`: 33 passed.
- `src/gateway/server-methods/fs.test.ts`: 16 passed. The new node error-code case fails without the `fs.ts` change.
- `tsgo:ui`, oxlint and oxfmt on the changed files, `ui:i18n:verify`.
**Gap:** the live node ran on the same host as the Gateway. A cross-machine device uses the same node WebSocket path, but I did not exercise one.
**Merge danger:** two-way door. A revert removes the menu item and the error-code change, and no state, config or contract changes. Blast radius: admin operators in New Session with a device-folder-capable paired device. Other `fs.listDir` node callers now see `INVALID_REQUEST` instead of `UNAVAILABLE` for node path errors.
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
Keep the backing agent answer visible and render provider-owned assistant speech in an expandable Voice transcript. Preserve raw history, model context, and missing-speech fallback without guessing which consultation a spoken response replaces.
Co-authored-by: brokemac79 <255583030+brokemac79@users.noreply.github.com>
* fix(media-understanding): hand video to native vision models
* fix(media-understanding): trust configured native video models
* fix(ai): materialize provider context for completions transports
OpenAI Completions ignored provider context handoff, so native video materialization never reached llm-local payloads. The handoff is now memoized and resolved by the transport before request construction.
* fix(agents): install provider context for boundary transports
* fix(ai): estimate video parts as fixed cost in completions preflight
The proxy-like context guard JSON-stringified video_url parts, counting their base64 data URIs as text (~480k estimated tokens for a 1 MB clip) and rejecting the request before it reached the server, which bills the same clip as ~4k frame tokens. Mirrors the existing image_url fixed estimate. Regression test: a 1.05 MB clip passes the guard on a 64k-token context.
* fix(agents): resolve provider-context handoff through @openclaw/ai package specifier
Relative imports of packages/ai/src/provider-types.js made tsdown bundle a second copy of the module into the unified dist, so PROVIDER_CONTEXT_HANDOFF (a unique symbol) existed twice: the embedded wrapper set the copy bundled as llm-*.mjs while the completions transport imported the copy from packages/ai/dist. options[HANDOFF] was therefore always undefined in the transport, the handoff was never consumed, and the prune-time 'video omitted' marker survived into provider payloads. Import the published subpath so both sides share one symbol instance.
* fix(agents): rehydrate non-canonical user media facts at provider materialization
Freshly drained/queued runtime user turns can reach model context with facts only in top-level media fields; transcript append canonicalizes the DB copy but the in-memory copy stayed unprojected, so active-turn video (and any legacy-shaped media) was omitted while later history replays resolved fine. Fall back to canonicalizePersistedUserMessageMedia when neither runtime symbols nor __openclaw carry facts, and trace unprojected media under OPENCLAW_DEBUG_VIDEO_HANDOFF=1. Pinned by replay tests (top-level media fact and bake-then-rematerialize round trip).
* fix(agents): carry non-enumerable runtime media facts across LLM boundary copies
The probe round proved the provider pass sees a different active-user copy than hydration: normalizeMessagesForLlmBoundary re-projects user messages (runtime-context escape, timestamp stamping, blocked-metadata strip) with Object.assign/spread, which drops the non-enumerable symbol fact carriers, and inserts the runtime-context carrier so the active index shifts. The active turn's video therefore reached provider materialization with zero fact channels while history copies (enumerable __openclaw) survived. Re-attach runtime facts on every boundary projection; pinned by attempt-llm-boundary.runtime-facts.test.ts (fails without the fix).
* fix(agents): inject current-turn media facts into provider transcript copies
Census round proved provider-pass user rows are session-layer rebuilds with zero fact carriers (runtime symbols stripped, __openclaw absent), so the active turn's video could never materialize in its own turn regardless of hydration. The run now stashes canonical facts from onUserMessagePersisted/Suppressed on attempt.currentTurnMediaFacts and materializeProviderContext re-injects them onto the active user row when no channel resolves. activeUserIndex also skips runtime-context wrapper rows (fixes 336->337 shift). Two regression tests in images.replay.test.ts.
* fix(tsconfig): map @openclaw/ai/provider-types so worker-graph tests build
* fix(media): skip runtime prompt symbol tags on frozen hydrated message copies
* fix(models): preserve declared video input modality through model resolution
resolveProviderModelInput and the sessions model-registry filtered configured input lists to text|image, so a model declaring input:[text,image,video] reached the openai-completions transport without video. provider-transcript-transform then evaluated supportsVideo=false and replaced the active video block with the '(video omitted: provider does not support video input)' placeholder - canonical=1/converted=0 in the probe. Widen llm-core Model.input to include video, keep video in both resolvers, regression test for inline providers.
* fix(agents): bind media-fact injection to canonical carrier contract and clear stale turn facts
Review follow-up: active-turn detection now uses the shared isRuntimeContextCarrier structural check instead of delimiter-text sniffing, and currentTurnMediaFacts is cleared when a text-only turn replaces the active turn so previous-turn video cannot be re-injected.
* fix(models): keep video capability at the provider boundary
Review alignment: revert the canonical model-input widening (llm-core Model.input and the registry runtime projection stay text/image per the current-main contract test). Declared video now survives only through resolveProviderModelInput onto the provider runtime model, where the provider-side ProviderModel.input union (packages/ai/provider-types) and the openai-completions transport gate already legitimize it. Config schema (ModelDefinitionSchema) and prepared catalog entries already carried video on main; no canonical contract change is needed for native video on custom openai-completions providers.
* fix(ci): satisfy lint and test-type shards
Remove the boolean-to-boolean compare in the native-video capability check and a dead assignment in the media projection; annotate provider-scope video fixtures in the transport/params/inline/replay tests with provider-boundary downcasts matching production.
* fix(ci): annotate provider-boundary assertions for safety ratchet
Add // SAFETY: invariant comments to the new provider-boundary type assertions so the assertion-safety baseline ratchet holds, and drop the now-unused processCompletionsStream import from the transport test (oxlint no-unused-vars).
* test(ci): annotate prepared-catalog mock isolation
check:test-mock-exports requires first-party mock factories to spread the real module or carry a // mock-isolation: reason; the runner.video fixture intentionally stubs the prepared model catalog.
* chore: shrink assertion allowance after native video repair
* test(media): assert normalized queued text at the video boundary
* test(media): complete model fixtures and wrapper imports
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: evomach <50238935+evomach@users.noreply.github.com>
* fix: allow quoted callback URLs through node exec approvals
* fix: reject obscured shell syntax in node approval plans
Keep quoted OAuth callback URLs on the canonical shell parser path and
reject escaped line continuations before classifying mutable operands.
Cover escaped quotes and nested substitutions, folding useful negative
cases from #173257. Preserve exact approved shell argv and document the
node approval contract for literal URLs. Fixes#173240.
Original fix by @fionn77; maintainer cleanup and regression hardening.
Validation: changed-file lint/format and isolated source review. PR CI
owns tests/typechecks; live proof intentionally skipped per maintainer policy.
Co-authored-by: Fionn Gartlan <96302767+fionn77@users.noreply.github.com>
Co-authored-by: xiaopan-xydt <xiao.pan1@xydigit.com>
* fix: preserve script binding through shell carriers
Reject nonliteral shell expansion/grouping and use canonical wrapper
resolution before classifying mutable operands. Fail closed for shell
assignments, negation, eval, coproc, and nested shells. Keep the approved
transport argv unchanged and cover each obscured-interpreter shape.
Unquoted URLs must escape both question marks and ampersands; quoted
callbacks continue through normal approval. PR CI owns runtime proof.
* test: enforce fail-closed node shell preparation
Update the two source-verified integration oracles for unquoted globs
and nested shells to expect preparation rejection before approval,
auto-review, or dispatch. Preserve the ordinary unpinned and env-wrapper
human-approval cases. Document the tighter approval-bound behavior.
CI 38816128230 job 116701763850 exposed these two stale expectations.
All other first-head checks passed. Changed-file lint/format and isolated
P0-P2 source review pass; runtime verification stays in PR CI.
* fix(exec): preserve existing human approval paths for shell commands
Apply literal-separator parsing only to payloads main previously rejected. Restore human approval for unquoted globs and nested shells, and allow escaped ampersands without requiring a quoted question mark. Preserve package-manager rejection where runtime options can hide mutable executables. Keep prepared shell argv unchanged and cover the approval request boundary.
* fix(exec): retain rejection of shell evaluation carriers
Limit literal separator admission to the sh transport used by node exec. Keep other shell grammars and code-evaluating builtins on their existing rejection path, including pathname expansion that can synthesize sensitive builtin options. Operator-free commands retain main behavior.
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: xiaopan-xydt <xiao.pan1@xydigit.com>
Co-authored-by: Fionn Gartlan <96302767+fionn77@users.noreply.github.com>
Replace individual eight-second append deadlines with a thirty-second progress window while audio is outstanding. Preserve the three-second input budget and repeat guidance; report silent relays and keep explicit failures terminal. Add deterministic request-deadline regressions and document the recovery behavior.
## What Problem This Solves
`dir_fetch` silently skipped saved files when reading their metadata failed, then returned a successful incomplete manifest and recorded an allowed outcome. A real tool-boundary regression reproduces this: an extracted `ok.txt` whose `stat` fails is reported as “Fetched 0 files.”
## User Impact
User impact: directory downloads now fail visibly if saved-file metadata cannot be read, instead of reporting a successful incomplete download. Successful downloads are unchanged; no migration or configuration change is needed.
## Why This Change Was Made
Propagate metadata read failures instead of skipping the file. Keep archive extraction, path/policy authorization, size limits, hashing, attachment ordering and the existing successful manifest shape unchanged. Document the visible failure behavior and add one regression to the existing archive suite.
## Best-effort tradeoffs accepted
- A saved file removed or made unreadable before manifest construction now makes the tool fail visibly rather than returning a partial success. The swallowing catch dates to `0603c2327d` (#74742); no human report requiring partial-success behavior was identified. This repairs a reproduced silent failure, not a speculative concurrency mechanism.
## Net LOC
Production: 6 net lines removed (+1/-7). Tests: 23 added. Documentation: 3 added. This is a bug-fix exemption, not a qualifying large cleanup PR.
## Evidence
- Baseline: new tool-boundary regression fails for the intended reason, returning success with `fileCount: 0` instead of rejecting the injected metadata error.
- Fixed: all 18 `dir-fetch-tool.test.ts` cases pass, including archive path/link/collision/expansion protections. Wrapper wall time 161.12 seconds; test-file wall time 138.79 seconds on the loaded shared host. Hosted CI timing pending.
- Lint-suppression suite: 3/3 pass; no new suppressions.
- Fresh independent review of the exact production/test patch: no accepted P0–P2 findings. Documentation adds only the corresponding failure description.
- Source-mapped typecheck of the changed production graph passes. The secondary checkout's package-boundary type/lint attempts correctly refused its shared dependency links; source-mapped proof ran in the owning dependency checkout with the same tool implementation.
- Runtime cycles: 0; Madge cycles: 0. Formatting passes on all three files; diff whitespace check passes.
- Changed-file checks passed conflict markers, line-cap growth and assertion safety. They found stale max-lines baseline entries for two unchanged core test files, then remained capacity-bound in the repo-wide SQLite ratchet. Targeted lint reached the existing 300-second SDK declaration-preparation deadline before lint execution. These are local proof gaps, not claims of green or inherited CI. Exact-head hosted CI is the broad gate.
All runtime proof used task-owned HOME, OpenClaw state/config and XDG directories. No real Gateway/state or remote runner was used.
openclaw update started through a node's system.run exec inherited the node service's identity markers, so the updater treated the node service as the Gateway and hung waiting for Previous-Gateway readiness. The shared host-exec sanitizer now removes inherited node-service identity when the base environment identifies a node service, preserving Gateway identity and explicit overrides. Live proof: Gateway → node system.run running openclaw update --dry-run finished with no service identity keys and no readiness wait. Supersedes #171814, thanks @Leon-SK668.
Fixes#171542
Co-authored-by: Leon-SK668 <0668001470@xydigit.com>
* fix(ui): keep accepted split Talk runs after client failures
Split browser Talk aborted its accepted chat run whenever the transport failed, including the 120-second answer wait. Failure cleanup now leaves the run to finish in the conversation; explicit Stop still aborts it, matching the Gateway relay transport.
* fix(ui): detach accepted Talk turns during non-user cleanup
Keep cleanup disposition through page/session teardown and late admission acknowledgments. Explicit Stop still cancels; timeout tells users the answer will appear in chat. Reuse the existing Talk close contract and remove the relay close wrapper.
Co-authored-by: Masato Hoshino <g515hoshino@gmail.com>
* test(ui): expect detachment during Talk lifecycle cleanup
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: Masato Hoshino <g515hoshino@gmail.com>
Select stock Bun 1.4.3 consistently across setup, cached archives, Docker, package smoke, supported-runtime documentation and runtime admission. Preserve the pinned OpenClaw fork and remove the upstream-fixed grapheme lookup workaround. Reject obsolete Bun in the standalone Team controller before activation.
Proof: focused Node/stock Bun/pinned-fork behavior, admission and preinstall checks; setup/action syntax checks; verified multi-architecture Docker digest; 26 passing Linux controller tests and a before/after activation regression. Independent Codex P2 review and exact-head ClawSweeper found no remaining actionable issues.
Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/38617609269. The PR records inherited wrapper-inventory failures and Node-only load-wave timing pressure with baseline/source evidence; native admission retains the failed CI result and checks all remaining gates.
* fix(media-understanding): treat empty transcripts as silence for every STT provider
* fix(deepgram): reject Flux turns without transcript text
* fix(media): distinguish silent transcripts from malformed responses
Keep silent STT output at the shared transcript owner and remove repeated
adapter validation. Validate OpenRouter objects with the bounded JSON reader,
preserve Deepgram channel ordering, and retain malformed Flux turn failures.
Exercise real response/error parsers and document the SDK empty-string result.
Original fix by @masatohoshino in #171514 for #171512.
Co-authored-by: Masato Hoshino <g515hoshino@gmail.com>
* fix(deepgram): reject missing transcripts in every channel
Reject the whole response when any channel's selected alternative omits its
transcript, even alongside silence or speech. Preserve valid all-empty output,
ordered speech, and malformed-value errors. Cover both missing/silence orders
and speech followed by missing data through the registered provider.
Addresses the ClawSweeper P2 on #171514 for #171512.
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Co-authored-by: Masato Hoshino <g515hoshino@gmail.com>
* fix(ui): browser Talk on Gemini 3.8 Live drops spoken user turns from history
Gemini 3.8 Live sends each input utterance as one complete inputTranscription message without finished, like 3.1. The browser transport finalized complete input only for 3.1, so 3.8 user turns stayed pending and were discarded at stop. Apply the same rule the Gateway relay uses for 3.1 and 3.8.
* test(ui): guard Gemini Talk transcript finality and duplicate completion
---------
Co-authored-by: Peter Steinberger <steipete@gmail.com>
Related: #136048 (non-Git directory semantics) and #142521 (non-Git worker workspace context; this PR does not implement ephemeral cloud workspaces).
## What Problem This Solves
Device-hosted sessions required a Git repository or managed worktree, a constraint inherited from ephemeral cloud sessions, even when a paired personal machine should simply work in an existing non-Git folder.
## User Impact
Users can choose **Existing folder on device** in New Session and run a session directly in an existing folder on a paired session-host device. OpenClaw does not create Git metadata, copy the folder to the Gateway, or sync, reconcile, reset, or delete it.
- `nodeHost.workerRuns.folders` is node-local consent: unset allows existing directories, a non-empty list restricts selection to those roots and their descendants, and `[]` disables the feature and its capability advertisement.
- The session stays pinned to that device: Auto/cloud dispatch, Move, and Continue on Gateway are refused. Attachment staging and the Gateway Files panel are unavailable for these sessions.
- Worker HOME stays in private node storage. Files are not locked against external changes.
## Why This Change Was Made
- `sessions.create` accepts `deviceFolder: { deviceId, path }` (requires `operator.write`); the binding is stored on the existing session entry and the `device-folder` workspace kind reuses the worker execution and lifecycle owners.
- The node owns folder policy and re-validates on every use: absolute or `~` paths only, realpath resolution (symlinks cannot escape a root), no filesystem root, no overlap with private worker storage, and a dev/ino fence between acquisition and execution. One shared rule in `node-workspace-protocol.ts` forbids preparing, resetting, transferring, seeding, or quiescing a device folder, for both ingress parsing and direct node execution.
- Gateway shutdown reads the teardown scope from the durable placement, so stopping an attachment with no in-memory tunnel no longer reaches closed worktree admission.
- A restored existing-folder create retry is owned by its frozen request; current device capacity or runtime no longer blocks it.
- Attachments are refused for device-folder sessions before anything is persisted: `chat.send` rejects them with a clear message, New Session blocks Send while attachments are attached, and worker media preparation never restages historical attachments into a device folder, so one refused file cannot make later turns fail.
- Security tradeoff: a session-host node already runs operator-directed agents with exec, so the allow-all default does not widen that boundary. The folder list is a selection guardrail, not an exec sandbox or a boundary against a compromised Gateway. Deployments that contain `operator.write` with `tools.fs.workspaceOnly` should also set a root list; the docs say so.
- Control UI selection/path input, plus docs for node configuration, session hosting, operator scopes, and workspace behavior.
## Screenshots
Synthetic mocked-Gateway captures (no real paths or tokens).
**Before — only the managed/new-workspace choice**

**After — desktop existing-folder input**

**After — mobile layout**

## Evidence
- **Cross-machine E2E on the final feature code:** a disposable Gateway on one Mac (tailnet TLS, token auth, QA mock model) and a session-host node on a second Mac, both on the same exact head, with `folders` unset and an existing non-Git target folder on the second Mac. Pairing and capability advertisement; create + explicit dispatch (`active`, workspace = the device folder); hosted exec wrote `pwd` and `hostname` into the folder, confirmed by independent readback on that Mac; node restart and an unclean Gateway restart, then a second turn appended to the same file; `~` and a Gateway-only path rejected; reclaim + delete left the folder, sentinel, and absence of `.git` unchanged with no copy in Gateway state.
- **Isolated single-host E2E (25 checks, all pass):** missing/root/file/relative/private-storage rejections; auto-dispatch rejection; node restarts; clean Gateway shutdown with a live tunnel and with a durable attachment but no tunnel; Gateway restart and resume; symlink escape and outside-root rejection under a root list; `[]` disables the capability.
- **Attachment refusal, live:** on the isolated Gateway, a `chat.send` with a text attachment to a device-folder session returns the refusal, the attachment never enters history, and the next text turn and later turns after node and Gateway restarts complete in the folder.
- **Authority, live (real Gateway WebSocket, no mocks):** an operator client granted only `operator.read` + `operator.sessions.write` sends `sessions.create` with `deviceFolder` and gets `FORBIDDEN` / `missingScope: operator.write`; no session row exists afterwards and a debugger logpoint on the node records no workspace command for that request. The full `operator.write` client creates and dispatches the same folder (`active`).
- **Device revocation during awaited admission, live:** with the node process tree stopped (`SIGSTOP`) while `sessions.create` and `sessions.dispatch` wait on it, `devices remove` succeeds, then `SIGCONT`. Create fails with `Selected device changed during folder validation; retry` and leaves no row; dispatch fails with `Device worker installation connection is no longer current`; the node is then disconnected and its old token is rejected. Known bounded behavior: the read-only folder validation request already delivered to the stopped node still runs once on resume (1 ms after removal) before the close frame arrives; its result is discarded, nothing is persisted, and no session command runs. Unit coverage also revokes the caller (real `captureGatewayDeviceRevocation` capture) and the device during validation.
- **Requesting-operator revocation during awaited admission, live:** separate signed operator devices with `operator.write`, real paired node stopped with `SIGSTOP`. Removing the operator while `sessions.create` waits on folder validation: the client gets `gateway closed (4001): device removed`, `sessions.describe` returns `{"session":null}`, the key is absent from `sessions.list`, and the node trace has no worker execution command. Removing a different operator while `sessions.dispatch` waits: the session moves from `provisioning` to `{"state":"failed","terminalReason":"Gateway requester authority changed"}`, `hasActiveRun` is false, and no worker command runs. As with device revocation, one already-delivered read-only folder validation runs on resume and its result is discarded.
- **Inline initial turns are refused:** `sessions.create` with `deviceFolder` plus `message`, `task` or `attachments` is rejected before node I/O; the UI already sends the first message through `sessions.send` after dispatch. The three new cases fail with the validator removed (`3 failed | 12 passed`) and pass with it (`25 passed`).
- **Upgrade compatibility, live:** the `main` merge-base build created a plain session and an explicit-cwd session (turn `ok`); the PR build on the same state dir lists and describes both with their original IDs, a new turn on the old session completes `ok`, and Doctor exits 0 with no session-row load errors.
- **Upgrade from stable `v2026.10.3`, live:** the stable build created a plain session with a completed turn, an explicit-cwd session, a custom model alias and a non-default `thinkingDefault`. Direct startup on the new build exits 78 with "uses schema version 24; … run openclaw doctor --fix" on both this PR and the plain `main` merge base (inherited). After `openclaw doctor --fix --non-interactive` (`v24 -> v26`), the PR Gateway starts, both old sessions list and describe with their original IDs, both settings read back unchanged, a new turn on the old session returns `ok`, and a new device-folder session created after the upgrade dispatches and runs a turn in the folder. One session-event publication warning about an unsettled worker-environment mutation appeared during that dispatch; the turn still succeeded.
- **Focused tests:** device-folder node, tunnel, create, protocol, media, submit-gate and draft-state suites pass; the restored-retry and history-restage regressions fail before their fixes.
- **Hosted CI:** on the exact head `364a000`, every job passes on the first attempt, and so does the Security Review, except `checks-ui-e2e (8/9)`. That job runs `plugins-lifecycle.e2e.test.ts`, which also fails the same way on plain `main` (see the maintainer override comment). Earlier heads hit flaky qa-lab E2E tests and `main`-side ratchet failures that plain `main` also reproduces.
## Merge Danger
Additive optional protocol field and session-entry JSON field; no SQL schema change. Older Gateways reject the new `sessions.create` parameter; older nodes do not advertise the capability, so the option is not offered. Revert removes the feature; existing device-folder sessions would then be unrecognized but their folders are untouched.
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
Bind usage archive discovery to captured database custody. Retain media for oversized transcript sessions while allowing unrelated cleanup. Report protected externally managed immutable layouts without native adoption. Give placement reconciliation the Gateway lifetime instead of the notifying session request.
* fix: Tool Search uses one dispatcher name across providers
Rename the generic dispatcher to dispatch_action and retain read-only historical display plus shipped policy and hook matching. Keep Ollama wire aliases only for directly advertised names that collide with its parser envelopes. Preserve tool_call invocation IDs and event contracts. Builds on #167933 and the local web-tool report from @lator57-gif in #145137.
* fix: preserve legacy dispatcher replay beside direct call tools
* test: align sorted allowlists with the dispatcher name
Reuse bounded session settings snapshots and the existing Gateway computer inventory owners to avoid repeated preparation. Preserve fresh per-attempt authority, model budgets, cancellation, and transcript bindings. Document the settings-file refresh boundary and cover config, plugin, reset, policy, and availability changes.
Three alternating quiet-host pairs measured warmed turn p50 452.3 -> 404.9 ms and first-delta p50 312.6 -> 286.6 ms. Causal SQL medians stay 214 statements / 50 requests / 0 MAIN, with all shared read families unchanged.
Two Codex review rounds, focused regressions, static gates, and exact-head CI validated the change. Two heartbeat failures reproduce identically on scheduled main and are assigned to the red-main owner; landed under the authorized inherited-failure exception.
Reuse successful advisory disk observations for unchanged idle worker placements for up to 15 minutes. Placement activity, binding changes, and runner availability changes refresh on the next maintenance pass. Preserve workspace-volume probes, current-owner validation, and retry behavior.
Exact-head CI 38217476204 passed, including required CI, types, lint, source contracts, and changed tests. The disk monitor passed 14 tests and the placement read projection passed 13 tests. No configuration or migration is required.
Fix iPhone realtime Talk crashing on the first reply and restore audible, interruptible built-in speaker playback. Render iOS replies as Float32 and share the capture-owned voice-processing engine on built-in routes, retaining the existing headset and macOS paths.
Closes#168415
Co-authored-by: Masato Hoshino <g515hoshino@gmail.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
Co-authored-by: Takhoffman <781889+Takhoffman@users.noreply.github.com>
Use ordinary text permissions for authenticated Talk requests while retaining caller authority, normal approvals, denial, cancellation and source revocation. Preserve caller-bound replay and accepted-run settlement.
Co-authored-by: roboclaw-bot <309084314+roboclaw-bot@users.noreply.github.com>
Co-authored-by: brokemac79 <martin_cleary@yahoo.co.uk>
Record a cached OS boot identity with new worker launches. On a confirmed boot change, settle extinct native launches through the existing interrupted-turn owner and release their slots. Keep container cleanup, same-boot recovery, and legacy rows conservative.
Validated with owner regressions and a two-host Linux reboot/Gateway-restart replay. Inherited Doctor CI failure and compatibility-fixture limitations are documented in the PR.
Keep computer execution identity stable across MCP catalog rebuilds and close the provider execution when the admitted run ends. Subordinate approval closures leave it active. The existing restricted artifact action surface and live execution guards remain in place.
Closes#147420.
Proof: real MCP cache/resolver/provider regression 12/12, original production fails with COMPUTER_HOST_BUSY; adjacent binding suite 22/22. Production LOC +23. Type-aware lint, production and affected test types, collision guards and independent review passed; recorded Knip failures reproduce on the unchanged baseline. Required CI and security checks passed.
Co-authored-by: Yalçın Doksanbir <yalcindoksanbir@gmail.com>
## What Problem This Solves
Fixes node services installed through `npx openclaw connect <join-url> --service` or `npx openclaw node install` pointing at npm's disposable `_npx` cache.
## User Impact
The one-paste command installs the selected OpenClaw release into a durable npm prefix under the node's state directory before writing the service. Removing npm's exec cache no longer removes the service's executable. Installation prints the package version, chosen runtime, service command, and a fresh-npx node update command.
## Why This Change Was Made
The service argument resolver previously used the running package's resolved path. #167905 fixes pnpm's replaceable store-generation paths by selecting its existing stable link; npm exec has no stable link to select. This preserves that pnpm behavior and adds node-install promotion through the existing npm update owners (`resolveGlobalInstallTarget`, `runGlobalPackageUpdateSteps`, and their staged publication/rollback/cleanup).
There is one `<state-dir>/npm` prefix, not a prefix per release. The normal state-directory/profile resolver chooses its location. Run `npx -y openclaw@latest node install --force` on the node to update it, retaining the same profile/state-directory settings. An exact version or `@beta` can replace `@latest`. Reinstalling an already-selected version repairs damaged package files. No new settings or package manager.
This does not change `openclaw update` or its existing co-located Gateway selection behavior. Node auto-update still follows the node's npm channel, not the connected Gateway's version/build. The rebase preserves #168653's paired-credential filtering and explicit `--auth-from-env` service argument.
No overlap with Pash/Sarah changes.
## Evidence
Final code: `27b447dc07b737126124ff8847f2059cb8a4f921`. Packaged live proof ran on `292bd19fe934ecf4ee4e3b20b00a03a1b08f7933`; production feature code and docs are unchanged since that proof. The final revision only corrects regression-test platform handling and rebases onto green main.
- **Before:** the regression on baseline `e40606fdea` selected `.npm/_npx/.../node_modules/openclaw/dist/index.js`. In the live isolated replay, published `openclaw@2026.9.9` completed real join-URL enrollment; deleting its npm exec cache made the saved command exit 1 with `MODULE_NOT_FOUND`.
- **After:** the canonical self-contained package passed `scripts/package-openclaw-for-docker.mjs --skip-build --allow-unreleased-changelog` and its tarball inventory/import-graph integrity check. Real `npm exec --package=<candidate.tgz> -- openclaw connect <join-url> --service` promoted that selected package into the node's state-owned npm prefix. Both actual launchd and systemd generators selected the durable entrypoint. After removing `_npx`, executing the persisted command as a separate process connected to the isolated Gateway. The published driver's device identity and node settings were unchanged.
- **Upgrade and repair:** seeded the durable prefix with published `openclaw@2026.9.8`, retained the enrolled node state, and invoked the candidate through fresh npx with `--profile upgrade node install --force`. The prefix became the candidate version. Overwriting its `dist/index.js` and repeating the same command restored the exact original file bytes. The runtime, device identity, and node settings remained unchanged; the repaired persisted command connected after deleting `_npx` again. The prefix contained only `bin` and `lib`, with one `openclaw` package rather than per-release directories.
- **Package identity:** the unpublished candidate shares the version string `2026.9.9` with the public release. An isolated loopback npm registry served the canonical candidate tarball for that version, while forwarding dependency requests to npm. This prevents accidentally testing promotion of the older public package with the same version string; no product behavior was mocked.
- **Focused checks:** 50 tests passed across `src/commands/node-daemon-install-npx.test.ts`, `src/commands/node-daemon-install-helpers.test.ts`, and `src/cli/node-cli/daemon.test.ts`. The new regression uses actual generators and executes their commands after cache deletion. The final portability correction keeps systemd coverage on non-Windows platforms and reads launchd artifacts only on macOS. That corrected regression passed (1.285 s test execution), and the `core-test-commands` type graph passed. Its unchanged durable-path assertion failed on the baseline as expected (pueue 2903).
- **Changed checks:** formatting, conflict/line-count/assertion/SQLite/mock-export ratchets, config docs, plugin boundaries, dependency guards, and the core type graph boundary passed. The prior head's local core typecheck stopped on unrelated `channel-presence-policy.ts:519` TS6133; the branch is now rebased onto the main fix rather than carrying a separate repair.
- **Independent review:** LAND on exact final head `27b447dc07b737126124ff8847f2059cb8a4f921`, including the corrected test, updater-step adapter, and paired-auth preservation.
Sanitized live results:
```text
before-cache-deleted: exit 1 (MODULE_NOT_FOUND)
after: /state/npm/lib/node_modules/openclaw/dist/index.js
node host gateway connected: ws://127.0.0.1:<isolated-port>
upgrade: 2026.9.8 -> candidate 2026.9.9
sameVersionRepair: true
runtimePreserved: true
pairingAndSettingsPreserved: true
connectedAfterCacheDeletion: true
```
**Native-supervisor limitation:** supervisor activation was not verified. Native service installation reaches the existing systemd user-session/profile guards in the unprivileged container; macOS refuses native installation from an isolated HOME. The proof runs actual generated service arguments as a separate live node, not under an activated OS supervisor. Launchd XML was decoded in Linux and passed through the production generated-environment resolver; the macOS regression exercises the actual plist reader. No HOME-guard bypass, privileged container, existing Gateway, or real laptop installation was used.
**CI:** [final-head run 38097819645](https://github.com/openclaw/openclaw/actions/runs/38097819645) passed, including production types, test types, lint, source contracts, and the corrected Linux regression. All applicable PR checks finished with no failure, cancellation, or pending check. The final head is rebased onto green main; no inherited failure waiver or SDK budget change is needed. ClawSweeper is **ready, 5/6**, and the independent reviewer returned **LAND**, both on `27b447dc07b737126124ff8847f2059cb8a4f921`.
## Bounded cost
Only npx-backed node installation needs an additional npm installation. It uses one state-owned prefix and the existing updater's staging, verification, rollback, and cleanup; it does not accumulate per-version prefixes. Reuse verifies the installed package and advertised content inventory, so a same-version damaged package is repaired. Ordinary node execution and model/session paths are unchanged. Non-npx installation adds only entrypoint inspection and installation diagnostics.
Source +104/-2, tests +88/-0, docs +34/-0; net +224 across seven files. The growth reuses the existing package updater rather than adding another installation or state owner.
## Merge Danger
Two-way code change, with a durable npm installation left in the selected node state directory if reverted. A revert restores the old npx service-install behavior; it does not remove an already installed package. Blast radius is headless node service installation and its printed diagnostics; Gateway installation and pnpm launcher resolution are unchanged.
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
## What Problem This Solves
Fixes paired nodes failing to authenticate after `openclaw connect <join-url> --service` when the machine already has credentials for another Gateway.
## User Impact
A node reconnecting to its saved Gateway uses its paired device token instead of an unrelated Gateway token or password from the machine's environment, configuration, or state-directory `.env`. Paired service installations no longer persist those ambient credentials.
Intentional shared-token/password connections remain supported through `openclaw node run --auth-from-env` and `openclaw node install --auth-from-env --force`. This exposes the existing foreground override and records that explicit choice for installed services. If it displaces an available paired credential, the warning names the selected environment variable, never its value. No new configuration keys or token migration are introduced.
## Why This Change Was Made
The node credential owner already recognized a saved pairing but still treated every populated `OPENCLAW_GATEWAY_TOKEN` / `OPENCLAW_GATEWAY_PASSWORD` as an explicit override. The service planner also persisted those ambient values. Environment variables loaded from `env.vars` or the state-directory `.env` therefore had the same effect as an intentional override.
The runtime and service planner now share the same saved-endpoint eligibility check. Default reconnects leave device-token selection and refresh with `GatewayClient`; explicit shared auth uses the existing environment-only path. GatewayClient's trusted-endpoint retry policy is unchanged.
This retains the intent of [#31122](https://github.com/openclaw/openclaw/pull/31122) (intentional service environment credentials survive restarts), [#136253](https://github.com/openclaw/openclaw/pull/136253) (a co-located Gateway must not displace paired-node auth), and [#159360](https://github.com/openclaw/openclaw/pull/159360) (expired fallback setup codes may only resume the saved pairing; no expired bootstrap or shared-auth fallback).
## Evidence
- On baseline `e40606fdea`, an isolated Gateway issued a real join URL and a second isolated machine state completed bootstrap pairing through `connect --service`. The first handshake of the restarted real install-plan command failed authentication for process-env token, process-env password, config `env.vars`, and state-directory `.env`. All four sources were persisted into the service environment. CWD `.env` was already blocked by workspace policy; plain co-located `gateway.auth.*` was already correctly skipped.
- The repaired replay connected on the first handshake for all six sources, without persisting any ambient token/password. The explicit `--auth-from-env` shared-token control also connected, retained its selected credential in the generated service environment, and retained the explicit service argument.
| Credential source | Baseline first handshake | Repaired first handshake | Repaired ambient credential persisted |
| --- | --- | --- | --- |
| Process token | Auth rejection | Connected | No |
| Process password | Auth rejection | Connected | No |
| Config `env.vars` token | Auth rejection | Connected | No |
| State-directory `.env` token | Auth rejection | Connected | No |
| CWD `.env` token | Connected (already blocked) | Connected | No |
| Co-located `gateway.auth.*` | Connected (already skipped) | Connected | No |
| Explicit shared-token flag | — | Connected | Yes, intentionally |
Sanitized authentication excerpts (ephemeral port replaced):
```text
baseline, ambient token:
node host gateway connect failed: unauthorized: gateway token mismatch (provide gateway auth token)
candidate, ambient token:
node host gateway connected: ws://127.0.0.1:<isolated-port>
candidate, explicit shared-token override:
node host: --auth-from-env selects OPENCLAW_GATEWAY_TOKEN instead of the paired device token
node host gateway connected: ws://127.0.0.1:<isolated-port>
```
- **Published-driver × candidate proof:** npm `openclaw@2026.9.9` performed real enrollment and generated service plans for both a join-enrolled node carrying unrelated ambient credentials and an intentional shared-token node without a cached device token. Candidate Doctor migrated their published schema 19 state to schema 20, then the candidate install planner/restart path connected both: the first using its paired token without retaining ambient auth; the second using the explicitly persisted shared token and `--auth-from-env`. Device identity, durable node settings, and the co-located Gateway settings were preserved in both cells.
- The no-cache shared-auth fixture used the published production auth-store owner to remove only its local node-token cache after the published connection; its identity and Gateway-side pairing remained intact. No raw database edits were used.
- **Revocation/final-effect proof on frozen head `dded84b33f34516638a4d2cad8b748be58521734`:** an explicitly approved `system.which` invocation returned `{"bins":{"true":"/usr/bin/true"}}`. After `devices revoke --role node`, restarting the same node with the valid shared Gateway token still present in its environment failed with `AUTH_DEVICE_TOKEN_MISMATCH`; the node never completed hello, and the real invocation returned `{"ok":false,"error":{"type":"cli_error","message":"node pairing changed while invocation was active"}}`. Device identity was unchanged. The live assertions completed; the initial report formatter rejected the CLI's trailing diagnostic footer, so the retained leading JSON objects were independently decoded and asserted.
```text
node host gateway connect failed: unauthorized: device token mismatch (rotate/reissue device token)
node host gateway reconnect paused after close (1008): unauthorized: device token mismatch (rotate/reissue device token) detail=AUTH_DEVICE_TOKEN_MISMATCH; waiting for operator action
```
- The runner regression failed on baseline for all three nonempty ambient credential combinations. The install-plan regression failed because ambient auth was persisted and the explicit service flag was absent.
- Six focused owner suites passed: runner, node runtime/install plan, install helper, node registration/lifecycle, and connect CLI. Existing GatewayClient and candidate-connection suites also passed, including trusted retry and refusal to retry untrusted token mismatches.
- Independent adversarial review returned **LAND** on final head `dded84b33f3`. `git range-diff` confirmed the two commits are patch-identical to the pre-rebase reviewed/proven version `8a906bd94e3`; the published-driver cells ran before that rebase, and the final authorization proof ran against a separately built, frozen checkout of `dded84b33f3`.
**Proof limitation:** the production canonical-home guard correctly refuses an OS-service installation under an isolated temporary HOME. The accepted isolation proof therefore executes the real `buildNodeInstallPlan` output (persisted command and environment) as the second process, against a live isolated Gateway. This is not a claim of exercising an actual OS supervisor. No existing Gateway, node service, or laptop installation was modified.
The published planner is private in the shipped bundle. Its isolation harness loaded a byte-identical copy of the shipped daemon chunk with **only** `export { buildNodeInstallPlan };` appended; authentication, service planning, and guards were not changed. Original chunk: 12,991 bytes, SHA-256 `7d67af30e747f36ea91d87f7b00fffb16ca7111e13dd1d4ce6195812b6de55da`. The actual published CLI performed enrollment. The temporary exported copy was removed afterward.
Final exact-head CI is **green**: [run 38089699521](https://github.com/openclaw/openclaw/actions/runs/38089699521). The previous inherited boundary failure was fixed on `main`, and this branch was rebased onto that fix. Local changed checks passed formatting, ratchets, core types, and core-test types, then stopped on pre-existing unrelated model-auth/solid-lint dead exports; the final hosted gates passed.
## Bounded cost
The runtime reuses the existing saved-endpoint/token eligibility read; only the explicit environment-override path additionally checks whether its warning displaces a pairing. Service installation adds bounded read-only checks of existing node state, identity, and token. No new tables, polling, retries, model calls, or background services are introduced. The new install-plan cases took 26 ms of test execution in the focused run; the six-suite invocation took 325.65 seconds including cold worker compilation.
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
## What Problem This Solves
Fixes: the New Session device picker explains a missing Codex harness as an opaque node-command failure when an OpenAI model cannot run on a paired laptop.
## User Impact
The reason now explains the model/harness/device relationship first, then gives the node-side install, enable, restart, and approval steps. Users can also choose a model using the OpenClaw harness. It says **unavailable**, rather than incorrectly claiming every disabled or denied plugin is uninstalled.
There is no automatic installation, silent harness substitution, or change to node/Gateway approval policy.
## Why This Change Was Made
Codex is an official external plugin, not part of the stock npm node package. A source checkout can also contain the plugin without enabling it on the node. The existing node-local plugin loader already declares `codex.exec-server.stdio.v1` only when the plugin is present and enabled; the new integration coverage preserves missing, explicitly disabled, explicitly denied, and enabled cases. No second capability or availability owner is needed.
The shared required-command authority owns the explanation used by both device discovery and placement. Pending pairing approval and Gateway policy denial keep their existing, distinct remedies.
Provenance:
- [#88451](https://github.com/openclaw/openclaw/pull/88451) introduced the unified OpenAI implicit Codex default (`4c33aaa86c1`); [#104685](https://github.com/openclaw/openclaw/pull/104685) moved effective-route policy into the provider (`1b1cebfe421`). Both were located with `git log -S`.
- [#127202](https://github.com/openclaw/openclaw/pull/127202) introduced the approved paired-device exec-server command (`1353ce0995c`).
- [`d111676bcbf`](d111676bcb) deliberately excluded Codex from the root npm package. This PR preserves that distribution decision.
- Inspected upstream Codex `codex-rs/cli/src/exec_server_command.rs` at `c248f6d48b97eb4a2aa56147a0b11b7d763278b9`: stdio execution is native; remote registration/auth is a separate branch. OpenClaw's plugin owns the pinned binary; the ordinary node does not need a separate Codex login to advertise the command.
No overlap with Pash/Sarah changes in the changed files.
## Evidence
- Regression through the real `environments.list` handler: the new harness explanation assertion fails on `e40606fdea` with the old command-first message (1 failed / 5 passed), and passes after the fix.
- Focused checks: 33 tests passed across the real node plugin-loader integration, node-command policy, and environment-command authority suites. The node integration loads the actual Codex plugin, not a replacement registration fixture.
- Rebased cleanly onto `f3af0db8fc`, including main's repair for the earlier duplicate-import failure. Full CI is green on `bb4428fc20492b523f42d812987261c74d27c138`: 57 passed, 54 skipped, no failures or pending checks; [CI gate](https://github.com/openclaw/openclaw/actions/runs/38089723977/job/114324791021).
- Before the rebase, formatting, focused lint, core typecheck, and all core-test typecheck groups passed. The broad local changed-file gate stopped at repository-wide dead-export findings outside this patch; final verification is the green rebased CI run.
- Actual Control UI before/after captures with deterministic Gateway fixtures, inspected on macOS arm64. The device stays disabled in both images; the improvement is the truthful explanation and recovery choices. The after fixture obtains its message from the production authority function. These are visual reproduction captures, not a live-model execution claim.
### Before

### After

## Bounded cost
No new imports, network calls, binary downloads, processes, polling, state, configuration, or protocol fields. The existing missing-command branch returns a different string. Production code: +4/-1 lines; tests: +50 lines; documentation: +16 lines.
## Merge danger
Two-way door: reverting restores the old explanation. The blast radius is the explanation for an undeclared command owned by the Codex plugin; eligibility, explicit disable/deny decisions, runtime choice, and execution remain unchanged.
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
## What Problem This Solves
Newly joined machines default to a foreground, command-only node, while New Session gives already-paired devices an invalid reconnect command and misleadingly says no session hosts are paired.
## User Impact
The CLI and Control UI now offer `npx -y openclaw connect <join-url> --service --session-host` by default. It installs a background node service that can run agent sessions, with a command-only service alternative. The UI shows the full command instead of clipping its consent flags.
Session hosting remains an explicit device-local choice in the pasted command; the node runtime's default is unchanged. Use hosting only on trusted shared Gateway infrastructure.
Already-paired devices get the supported `openclaw config set nodeHost.workerRuns.enabled true`, then `openclaw node install --force` instructions. The empty-host hint distinguishes pairing from enabling hosting.
## Why This Change Was Made
Preserves the one-paste, single-use onboarding contract from [#122499](https://github.com/openclaw/openclaw/pull/122499) and [#122635](https://github.com/openclaw/openclaw/pull/122635). Corrects the remediation introduced in [#145183](https://github.com/openclaw/openclaw/pull/145183) using the saved-pairing service path documented by [#159810](https://github.com/openclaw/openclaw/pull/159810).
The join handler is its own lazy CLI module rather than adding more responsibilities to the device-management runtime. `-y` only skips [npm's package-install confirmation](https://docs.npmjs.com/cli/v11/commands/npx/); it does not replace OpenClaw consent. No package version is pinned.
No overlap with Pash/Sarah changes.
## Evidence
- Regressions fail on baseline `7e23f938f8` for CLI text/JSON and paired-host/empty-host rendering.
- Real CLI before/after proof used separate isolated Gateways and state directories: the baseline printed `npx openclaw connect <url>`; the candidate printed the service/session-host command and command-only alternative. Both JSON invocations exited 0.
- CLI and lazy-loading tests: 52 passed. The Gateway setup and three UI rendering/picker suites pass after the scope reduction, as does the host-only browser regression. The five connection-dialog browser flows also pass.
- Independent exact-head review: **LAND**, no findings.
- [Exact-head CI](https://github.com/openclaw/openclaw/actions/runs/38083704554): **success**, 46 successful jobs, none failed or cancelled.
- [ClawSweeper](https://github.com/openclaw/openclaw/pull/168623#issuecomment-6101771154): **ready** on `d456a0ebad0fb6bd101821f0f8839896a7fde7f0`, no findings.
- Local `check:changed` passed its ratchets and core/test/UI typechecks, then stopped at the global unused-export scan. The same model-auth and Solid lint exports fail on clean `origin/main` (`e40606fdea96`); the additional pre-existing Solid test-helper export has already been removed upstream in [62629b0d6e](62629b0d6e). None of these files are changed here.
<details>
<summary>Observed CLI output from the isolated Gateway</summary>
The loopback port and single-use code below are normalized; both commands exited 0.
```text
$ openclaw devices join-code
http://127.0.0.1:<port>/j/<code>
npx -y openclaw connect http://127.0.0.1:<port>/j/<code> --service --session-host
Installs a background node service that can run agent sessions.
Command-only node: npx -y openclaw connect http://127.0.0.1:<port>/j/<code> --service
$ openclaw devices join-code --json
{
"joinUrl": "http://127.0.0.1:<port>/j/<code>",
"command": "npx -y openclaw connect http://127.0.0.1:<port>/j/<code> --service --session-host"
}
```
This was captured from the production-identical join handler at `ddebdaccc0a2f53d96ecb185daa54b4918233688`; the final revision removes the deferred picker change and updates its regression expectations without changing that handler.
</details>
### Join command
| Before | After |
| --- | --- |
|  |  |
### Already-paired device
| Before | After |
| --- | --- |
|  |  |
## Bounded cost
No additional RPCs, model calls, polling, retries, or background work. The existing join request and device inventory remain the owners. The command-only alternative uses the same single-use URL.
## Compatibility and Risk
No new config keys, protocol changes, worker-dialect changes, or runtime-selection changes. Reverting restores prior suggestions for future joins; devices already enrolled keep their explicitly enabled service and hosting consent until the operator changes them. The blast radius is device enrollment and New Session guidance, not session execution or authorization.
Co-authored-by: Ayaan Zaidi <hi@obviy.us>
Return the eligibility owner diagnostic before considering advertised capacity, so stale full-slot inventory cannot hide lost pairing or connection identity. Keep default placement and capacity admission unchanged. Add RPC regressions for both stale-inventory refusals.
* fix(talk): preserve voice settlement across close failures
* test(talk): preserve runtime exports in voice fixtures
* fix(talk): settle accepted voice work before shutdown
* fix(talk): retain voice settlement until explicit release
Keep failed entry attempts from releasing a live consult owner, and drain accepted digest retries when later admission fails. Construct the digest owner at its runtime boundary.
* test(talk): assert voice binding during accepted work
* chore(talk): include upstream internal export cleanup
* test(talk): separate digest source recovery coverage
* test(talk): keep lifecycle proof within existing gates
Avoid a shadowed local in lifetime retirement and use the relay fixture defaults without changing shutdown coverage.