Skip to content

feat(cron): give scheduled runs their parent conversation's memory audience - #179062

Merged
jalehman merged 3 commits into
mainfrom
automations/scheduled-parent-memory
Oct 23, 2026
Merged

jalehman merged 3 commits into
mainfrom
automations/scheduled-parent-memory

Conversation

@jalehman

@jalehman jalehman commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Builds on #179011 (merged), #178933, #179834 and #178965 (all merged). It uses #179011's per-run registry. Rebased onto main; the conflict with #181359's cross-agent memory lineage was additive, and both resolveAgentStorePath and scheduledParent are kept.

Related: #178812
Related: #178811

What Problem This Solves

Fixes: a scheduled run created from a conversation reads an empty memory store. The memory audience is resolved from the cron run's own session row. That row is neither a direct-chat root nor a spawned child with lineage receipts, so the native memory provider gets no audience. For example, a knowledge-ingest automation created in the owner's direct chat finds no knowledge.

User Impact

User impact: an automation linked to the exact conversation that created it now gets that conversation's memory audience on each run.

  • A child of the owner's direct chat gets owner-private memory when this occurrence's requester check confirms owner status.
  • A child of a group, channel or non-owner conversation gets that conversation's memory.
  • A requester who has lost owner status loses the private partition on the next run, and no spawn receipt anywhere in the parent's lineage can restore it.
  • An automation that runs inside its linked conversation keeps that conversation's audience. It also gets the occurrence's owner bit instead of the scheduler's missing sender bit.
  • Jobs without a conversation link (operator- or CLI-created) and jobs that store only a session key resolve memory from their run row, as today.

Why This Change Was Made

  • One owner for audiences. resolveMemoryAudienceFromEntry in src/plugins/memory-audience.ts still mints every audience. It now accepts an optional scheduledParent: the exact parent incarnation and owner bit from the run's execution context (feat(cron): add the scheduled-run execution context (no behavior change) #178933). This plays the role a spawn receipt plays for subagents, as the first lineage hop:

    • the run row and the parent each hold a session generation lease;
    • the parent must still be the linked incarnation;
    • the root chat type picks the partition;
    • a later parent reset revokes the grant before provider I/O.

    A link that recorded no lifecycle revision proves only the session id, matching the pause check in feat(cron): pause automations whose creating conversation is gone #178965.
    A parent already reset when the occurrence is admitted does not pause the job (feat(cron): pause automations whose creating conversation is gone #178965): the context builds that occurrence as an unbound parent, so it resolves memory from its own run row, as before this PR.

  • The occurrence caps owner status. Whenever a scheduled parent is supplied, this occurrence's requester result is an upper bound for the whole lineage walk. A spawned parent's receipt, or a spawned session the run executes in, cannot grant owner-private memory after the requester check failed.

  • Who can name the parent. The link is host-stamped at creation: an agent caller's job records the caller's own session (captureCronCreatorSession). Only trusted operator clients without a caller scope can name another session. A model in a group cannot point a job at another conversation's memory. A job restored from a Control UI operator source is parent-linked by design (feat(cron): add the scheduled-run execution context (no behavior change) #178933) and takes its owner bit from the restored operator authority.

  • In-session runs. When the parent is the run's own session, the resolver checks that the admitted row is still the linked incarnation and applies the occurrence's owner bit. It does not hop to itself.

  • Wiring. The execution-context registry from feat(cron): route scheduled child board and widget tools to the parent conversation #179011 exposes the parent for the admitted run. The embedded attempt and the CLI loopback grant both resolve through resolveEmbeddedAttemptMemoryAudience, which now takes the run's own inputs as one object and reads the parent itself. That keeps the embedded dispatch file under its line cap.

  • Codex harness. Core resolves the attempt's memory audience in run-attempt-dispatch.ts before any harness runs and passes it to Codex as memoryAudience, so Codex scheduled runs get the parent audience too.

  • Not covered here: the memory-flush path during compaction.

Evidence

  • End to end through both runtimes (src/cron/execution-context-memory-audience.test.ts): a real occurrence admission and run admission bind the context; the embedded resolver and the CLI loopback resolver each mint the run's audience; a provider is bound to it with the host's bindMemoryProvider. Session rows and generation leases come from the shared fake session owner used by the resolver tests.
    • An owner's direct-chat child gets owner-private memory on both runtimes, and the bound provider is reached.
    • A non-owner requester, and a group parent, get only the conversation's memory.
    • A parent reset mid-run refuses provider I/O on both runtimes before the provider is called.
    • A requester who loses owner status gets only the conversation's memory on the next run.
    • A key-only job and a job with no recorded requester never reach the parent's private memory.
    • With the registry's parent hop removed (the base behavior), the five grant and revocation tests fail.
  • Resolver tests (src/plugins/memory-audience.test.ts): scheduled child grants, stale links, session-id-only links and in-session runs; the owner cap holds through a spawned parent's lineage, for an in-session run on a spawned row, and for a run on a spawned session other than its linked parent. Removing the cap fails the cap tests.
  • Rebased onto main with fix(cron): Discord-DM automations lose owner access even while their creator is an owner #181916, which fixed the scheduled requester owner check for channel (Discord) requesters. The mocked scheduled-parent passthrough case in attempt-memory-audience.test.ts was dropped, as ClawSweeper suggested; the cron composition suite covers that path end to end.
  • Related suites (memory audience, attempt memory audience, CLI MCP memory audience, MCP HTTP and tool-resolution memory audience, cron execution context): pass.
  • QA lab: the bundled QA lab has no native memory provider, so the live proof below uses a local proof plugin and scenarios that are not part of this PR.
  • Static replay on a real Gateway's state copy: the three exact-parent jobs (two child runs and one in-session knowledge-ingest job) gain the parent memory audience, as intended. Every other job keeps resolving from its run row. Nothing is lost, gained unexpectedly or paused.
  • Checks: tsgo:core and tsgo:core:test are clean; type-aware oxlint and oxfmt are clean; the line-cap and mock-export ratchets pass.
  • Autoreview (Codex, P0–P2): two P1 findings about owner status through spawned lineage were fixed with tests. A later P2 assumed jobs restored from a Control UI operator source should not inherit; that contradicts the feat(cron): add the scheduled-run execution context (no behavior change) #178933 design, where such jobs are parent-linked, so it was declined.

Live behavior proof (real Gateway, head d5ef50d0b65)

A scratch build of this head adds a native memory provider (kind: "native") that logs the host-minted audience for every open, search and probe call. QA scenarios then create jobs through the Gateway and force-run them (mock-openai, real Gateway child process). The scenarios and plugin are local proof tooling only.

Scenario This PR main without this PR
Embedded: operator-chat parent → owner-private memory pass denied (no host-minted memory audience)
Embedded: channel DM job without an authenticated requester → that conversation only pass denied
Embedded: group parent → that group's conversation only pass denied
Embedded: parent reset mid-run → provider refuses before I/O pass (0 opens/searches after reset) n/a
CLI loopback: operator-chat parent → owner-private pass denied
CLI loopback: group parent → that group only pass denied
CLI loopback: parent reset mid-run → refused pass n/a
Upgrade from v2026.10.6 jobs and settings intact —
Embedded, Discord owner DM job: owner → owner-private; requester removed from commands.ownerAllowFrom → next occurrence gets that DM conversation only pass —
CLI loopback, same Discord owner DM job flow (provider=qa-memory-cli) pass —
Provider audience log (embedded, redacted)
op=probe  run=agent:qa:qa-channel:direct:dm:qa-operator  audience=owner-private            OWNER-PRIVATE-NOTE   (baseline: owner DM itself)
op=probe  run=agent:qa:cron:e7feb612…                    audience=owner-private            OWNER-PRIVATE-NOTE   (operator-chat parent)
op=probe  run=agent:qa:cron:fcec7d86…                    audience=conversation:<owner DM>  CONVERSATION-NOTE    (DM job, no authenticated requester)
op=probe  run=agent:qa:cron:ed38fd05…                    audience=conversation:<group>     CONVERSATION-NOTE    (group parent)
op=probe  run=agent:qa:cron:fbc0b993…                    audience=owner-private            OWNER-PRIVATE-NOTE   (before reset)
op=probe  run=agent:qa:cron:fbc0b993…                    current=rejected  "memory audience is no longer current"  (after parent reset)

CLI loopback produced the same pattern: owner-private → group conversation only → rejected after reset. On main the same scenarios log audience=null and the probe is denied with no host-minted memory audience.

Requester revocation, Discord (crabline local provider, redacted)

The job is created by the agent from a Discord owner DM, so the host records the authenticated Discord requester. It is force-run, then commands.ownerAllowFrom is replaced so it no longer names that sender, and the same job is force-run again. Provider open calls:

embedded  occurrence 1  run=agent:qa:cron:efa01f6f…:run:6645c187…  audience=owner-private                         OWNER-PRIVATE-NOTE
embedded  occurrence 2  run=agent:qa:cron:efa01f6f…:run:885d96bb…  audience=conversation:<discord owner DM>       CONVERSATION-NOTE
cli       occurrence 1  run=agent:qa:cron:7cc1dbdb…:run:df522597…  audience=owner-private                         OWNER-PRIVATE-NOTE
cli       occurrence 2  run=agent:qa:cron:7cc1dbdb…:run:9e7f6c19…  audience=conversation:<discord owner DM>       CONVERSATION-NOTE

No owner-private open, search or probe follows the revocation on either runtime.

Upgrade. v2026.10.6 created a parent conversation and two jobs (one linked, one unlinked) on isolated state. This build then ran doctor --fix and started on the same state. Both jobs came through with their schedule, payload, delivery and parent link unchanged; the only job diff is doctor's existing migration of the built-in heartbeat job. Both Gateways report 2026.10.6 because this branch does not bump the package version; the second one ran from this PR's source.

Known limitation (outside this PR; fails closed)

@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: M labels Oct 21, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Scheduled runs inherit their linked conversation’s memory audience, capped by the occurrence’s requester authority.

Example: An owner creates a nightly knowledge-ingest automation from a direct conversation.

  • Before: The cron session receives no native memory audience and cannot read the owner’s knowledge.
  • After: The run receives owner-private memory while its requester remains an owner; later non-owner occurrences receive only the conversation’s memory.

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) Focused implementation with shipped-entry-point authority proof, upgrade evidence, successful current-head gates, and no actionable findings.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (logs): At the reviewed head, supplied real Gateway logs exercise embedded and CLI scheduled jobs through a native proof provider: owner grants succeed, group and unauthenticated-requester jobs remain conversation-scoped, resets reject before further provider I/O, and revoked requesters lose private access on the next occurrence.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: Conversation-created automations cannot access the native memory available to their creating conversation.
Reason: The maintainer-authored direction addresses observed automation failures using the already-established execution context without a new setting or persistent schema.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it supplies useful scheduled-run memory inheritance still missing on main, with adequate live proof and no actionable findings.

Priority: P2
Reviewed head: d5ef50d0b65cc26801c2ea57654ea18800c13d07

Before merge

None.

Findings

None.

Agent review details

How this fits together

Cron admission supplies the exact parent conversation and requester result; the shared host resolver turns those facts into a session-bound audience whose leases guard native memory provider calls.

flowchart LR
  A[Stored automation] --> B[Occurrence admission]
  B --> C[Run context registry]
  C --> D[Embedded and CLI resolvers]
  D --> E[Host memory audience]
  E --> F[Currency guard]
  F --> G[Native memory provider]
Loading

Technical review

Best possible solution:

Use the existing audience resolver and session leases to consume the admitted scheduled-parent context across both runtimes.

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

Current-main source lacks the scheduled-parent hop, and the supplied Gateway comparison records denied memory access before this change; no target code was executed during this review.

Is this the best way to solve the issue?

The patch is a focused extension of the authoritative resolver, preserving legacy jobs and transport-specific delivery while sharing audience and revocation decisions.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 34c95cb9e001.

Provenance checked

  • Host audience resolution keeps the original intent (a9f6758: Centralize audience minting and enforce exact lineage and currency before native memory access.)
  • CLI loopback memory access keeps the original intent (196332e: Give admitted CLI turns the same host-resolved audience while keeping it outside child-visible context.)
  • Scheduled resource authority keeps the original intent (240a90e: Derive parent resources and requester authority once per scheduled occurrence from existing stored facts.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Josh Lehman: Raw commit a9f6758 adds src/plugins/memory-audience.ts:35 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: a9f675839a0d; files: src/plugins/memory-audience.ts)
  • Peter Steinberger: Raw commit 553c6bd adds src/agents/embedded-agent-runner/run/run-attempt-dispatch.ts:43 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 553c6bde778c; files: src/agents/embedded-agent-runner/run/run-attempt-dispatch.ts)

PR surface

Source +75, Tests +411. Total +486 across 9 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 5 94 19 +75
Tests 4 415 4 +411
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 9 509 23 +486

Review metrics

Metric Value Why it matters
Production versus test changes Production +94/-19 lines; tests +415/-4 lines The production growth extends existing owners; tests cover runtime composition, incarnation checks, and owner caps through distinct lineage paths.

Labels

Label changes:

No label changes.

Label justifications:

  • P2: Restores useful native memory access for conversation-linked automations with a limited affected surface.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🦞 diamond lobster and patch quality is 🦞 diamond lobster.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.

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.

History

Review history (5 earlier review cycles)
  • reviewed 2026-10-21T05:49:04.499Z sha 1740acc :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-23T17:40:16.879Z sha 8e54e7d :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-23T17:47:01.965Z sha 8e54e7d :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-23T19:37:00.570Z sha 8e54e7d :: needs real behavior proof before merge. :: none
  • reviewed 2026-10-23T21:44:24.053Z sha d5ef50d :: needs maintainer review before merge. :: none

Reviewed October 23, 2026, 5:52 PM ET / 21:52 UTC (Revision 6).

@jalehman
jalehman marked this pull request as draft October 21, 2026 06:31
@jalehman
jalehman force-pushed the automations/scheduled-board-target branch from 37dec8a to 4b7e8e2 Compare October 21, 2026 07:15
@jalehman
jalehman force-pushed the automations/scheduled-parent-memory branch from 1740acc to 100ac78 Compare October 21, 2026 07:24
@jalehman
jalehman force-pushed the automations/scheduled-board-target branch from 4b7e8e2 to 1b75a1a Compare October 21, 2026 15:16
@jalehman
jalehman force-pushed the automations/scheduled-parent-memory branch from 100ac78 to 064189d Compare October 21, 2026 15:44
@jalehman
jalehman marked this pull request as ready for review October 21, 2026 15:44
@jalehman
jalehman marked this pull request as draft October 21, 2026 15:48
@jalehman
jalehman force-pushed the automations/scheduled-board-target branch from 1b75a1a to c055c5e Compare October 21, 2026 15:55
@jalehman
jalehman force-pushed the automations/scheduled-parent-memory branch from 064189d to 859d601 Compare October 21, 2026 15:55
@jalehman
jalehman marked this pull request as ready for review October 21, 2026 15:58
@jalehman
jalehman marked this pull request as draft October 21, 2026 17:50
@jalehman
jalehman force-pushed the automations/scheduled-board-target branch from c055c5e to 3343c42 Compare October 21, 2026 19:52
@jalehman
jalehman force-pushed the automations/scheduled-parent-memory branch from 859d601 to fac8f7f Compare October 21, 2026 19:52
@jalehman
jalehman force-pushed the automations/scheduled-board-target branch from 3343c42 to b5a7413 Compare October 21, 2026 19:56
@jalehman
jalehman force-pushed the automations/scheduled-parent-memory branch from fac8f7f to fc8567e Compare October 21, 2026 19:56
@jalehman
jalehman force-pushed the automations/scheduled-board-target branch from b5a7413 to ffc0372 Compare October 21, 2026 19:59
@jalehman
jalehman force-pushed the automations/scheduled-parent-memory branch from fc8567e to 941c2b0 Compare October 21, 2026 19:59
@jalehman
jalehman force-pushed the automations/scheduled-board-target branch from ffc0372 to 66855bf Compare October 22, 2026 18:04
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Oct 23, 2026
@jalehman
jalehman merged commit ddbf65c into main Oct 23, 2026
149 checks passed
@jalehman

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@jalehman
jalehman deleted the automations/scheduled-parent-memory branch October 23, 2026 22:56
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 24, 2026
…dience (openclaw#179062)

* feat(cron): give scheduled runs their parent conversation's memory audience

* test(cron): prove scheduled children reach the provider with their parent's memory audience

Drives a real occurrence admission and registry through the embedded and
CLI memory resolvers into a bound provider: an owner's direct-chat child
gets owner-private memory, a non-owner or group parent gets only the
conversation, a parent reset mid-run refuses provider I/O on both
runtimes, a revoked requester loses private memory on the next run, and
key-only or requester-less jobs never reach the parent's private memory.

* test(agents): drop mocked scheduled-parent passthrough covered by cron composition
obviyus added a commit that referenced this pull request Nov 29, 2026
## What Problem This Solves

Automations created before OpenClaw recorded the creating conversation (every job without `sourceConversation`, i.e. created before #179062) name that conversation only by session key. Their scheduled runs get no memory at all: every `knowledge_*` or memory tool call fails with "the host granted this session no memory audience", and the Gateway logs `memory audience unavailable: root session agent:<agent>:cron:<job>:run:<run> has no durable chat type`. The same runs still hold owner-only tools such as `exec`. A production automation that reads and writes the owner's knowledge vault every week hit this on every run.

## User Impact

- A key-only detached automation (`isolated` / `current`) now reads its conversation's current memory, the same way a bound automation does:
  - created in the owner's direct chat: the owner's private memory;
  - created in a group or channel: only that conversation's memory, never owner-private.
- When the job recorded a requester (profile or channel sender), that requester's owner status is checked at each occurrence first; without one, the run's existing owner bit decides, as it already does for the run's tools.
- If the conversation row is gone, archived or cannot be read, the run proceeds exactly as before (no memory, no pause, no failure).
- Board, workspace, sandbox, event target and the run's tools are unchanged. `main` and `session:<key>` targets are unchanged.
- `automations bind` stays available for the exact-incarnation link but is no longer needed for memory. Docs (`cli/cron` "Binding older jobs", `automation/cron-jobs/payloads`) and Doctor's unbound note say so.

Accepted edge case: a key-only run whose agent sandbox mode is `non-main` or `all` now gets owner-private memory it did not have, when the job was created in the owner's direct chat. The owner created these jobs in their own DM, and the run already holds owner authority.

## Why This Change Was Made

`resolveScheduledPrincipal` classifies these jobs as `unbound-parent` and gives them legacy owner authority, but `buildScheduledExecutionContext` pointed their memory at the cron run row, which never has a chat type, so the memory resolver always denied. The fix stays in the existing owner:

- `admitScheduledOccurrence` (`src/cron/execution-context-admission.ts`): for an `unbound-parent` principal on a detached run, read the key-linked conversation row once. A failed read becomes "no row". No generation lease, workspace binding, sandbox or pause change. A recorded requester is admitted per occurrence through the existing `admitScheduledRequesterGrant`.
- `buildScheduledExecutionContext` (`src/cron/execution-context.ts`): with a live row, memory becomes `{ source: "parent", parent: <current sessionKey/sessionId/lifecycleRevision>, owner }`. Everything else for `unbound-parent` is unchanged.
- The memory resolver (`src/plugins/memory-audience.ts`) does not change: it already maps a direct root + owner to owner-private and direct/group/channel to that conversation's partition, for both the embedded and the CLI runtime.
- `scheduledParentKeyOf` now derives the key from `resolveScheduledPrincipal` itself, so Doctor's access review and the development replay read the same row the runtime does; the replay vector (`execution-context-projection.ts`) already labels the memory gain as intended, so it needed no edit.

Not changed: Doctor auto-bind or any stored-row write, jobs with no parent key, bound jobs with no recorded requester. On current `main`, bound jobs keep following their conversation after a reset (#205887), so no reset-degraded path exists to special-case.

## Evidence

Real-admission tests (red on the merge base `bb5c001bb6fc`, green on this head; 6 tests failed on base, all pass on head):

- `execution-context-memory-audience.test.ts` (real admission → registry → embedded and CLI resolvers): key-only owner-DM job → owner-private; key-only group job → that group's conversation only; key-only job with a revoked recorded requester → conversation only; key-only job whose conversation is gone → no audience, run admitted.
- `execution-context.test.ts`: key-only detached job gets parent memory and nothing else (board/workspace/sandbox stay the run's); archived, removed and in-session (`session:<key>`) cases keep run-session memory.
- `execution-context-admission.test.ts`: key-only read takes no generation lease; a failed read still admits the run with its own memory.
- `isolated-agent/run.bind-parent.test.ts` (real cron service + timer): the unbound job now reaches its conversation's memory, without a run-row receipt.

Local runs: the 27 test files that import the changed sources passed (`ocx test`, 6 shards). `pnpm check:changed`: typecheck, lint, guards all ok; the dead-export scan fails only on files this PR does not touch (`src/agents/command/types.ts`, `src/plugins/native-module-require.ts`, `ui/src/...`, `src/gateway/server-methods/update.test-harness.ts`), same as `main`.

End to end, scratch Gateway from source, `plugins.slots.memory: "knowledge"`, real model (`openai/gpt-5.5`). An owner Control UI direct chat was created by one real `chat.send` (row `chatType: "direct"`). A key-only isolated `agentTurn` job (owner key = that chat, no `sourceConversation`, no recorded requester, no tool policy, `toolsAllow` incl. `knowledge_remember`, `knowledge_grep`, `exec`) fired from its own `at` schedule about two minutes ahead (no forced run).

Base (`bb5c001bb6fc`):

```
[agent/embedded] memory audience unavailable: root session agent:main:cron:<job>:run:<run> has no durable chat type
```
```
knowledge_remember: "Knowledge access unavailable: the host granted this session no memory audience. The Gateway log entry "memory_audience_denied" for this session names the reason and its repair."
knowledge_grep: "Knowledge access unavailable: the host granted this session no memory audience. ..."
```

Head: no `memory audience unavailable` line in the Gateway log; the run's result:

```
knowledge_remember: inserted claim <claim-id>.
knowledge_grep: 1 hit — <claim-id>: "The owner's favorite tea is masala chai."
```

The claim was written under the store's `vault/private/` (owner-private).

Observed, not changed here: a session created only through `openclaw agent --session-key agent:main:main` from the CLI has no `chatType`, so a key-only job linked to such a row still gets no memory (Doctor already lists these under "no stored chat type"). Channel DMs and Control UI chats record `chatType: "direct"`.

Merge danger: two-way door. No schema, stored-row, config or protocol change; a revert restores the previous memory decision. Blast radius: memory audience of detached scheduled runs whose jobs have no `sourceConversation` but an owner/policy session key.

Co-authored-by: Ayaan Zaidi <[email protected]>
vyctorbrzezowski added a commit that referenced this pull request Nov 29, 2026
* feat(ui): offer Add to Home agent when Home sidebar is open (#207773)

* fix(ui): remove Open PR from the session menu (#207808)

* fix(ui): remove Open PR from the session menu

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(ui): remove Open PR from the session menu

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 19ab49eb-2fdb-4e2a-ba0e-3fcf8de38db9

* fix(ui): preserve shared session menu copy

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(workboard): let users delete an empty default board (#207909)

* test(gateway): isolate publication recovery memory pressure (#207993)

* fix: remove dismissed chat suggestions without waiting (#207792)

* fix: remove dismissed chat suggestions without waiting

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: remove dismissed chat suggestions without waiting

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: a7065126-58f4-41f4-ab35-887c77e05eac

* refactor: keep suggestion dismissal focus with the pane keyboard helpers

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: remove dismissed chat suggestions without waiting

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 362ae3c3-16c8-4016-8f59-dc477414e07a

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(ui): show a subtle placeholder while a new chat gets its title (#207809)

* fix(ui): show a subtle placeholder while a new chat gets its title

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(ui): show a subtle placeholder while a new chat gets its title

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 5a8d6d8e-7c91-4b07-9467-ff499cf2786a

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: keep skill highlights in sent chat messages (#207828)

* fix: keep skill highlights in sent chat messages

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: keep skill highlights in sent chat messages

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 303c108c-485c-4ee9-bcdc-b6845d507543

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* improve: keep Workboard editing and Save within reach on phones (#207839)

* improve: keep Workboard editing and Save within reach on phones

Co-authored-by: vyctorbrzezowski <[email protected]>

* improve: keep Workboard editing and Save within reach on phones

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 41fdebe7-35c4-435a-8128-eb9f12e2fabf

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(ui): highlight skills and mentions in queued messages (#207829)

* fix(ui): highlight skills and mentions in queued messages

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(ui): highlight skills and mentions in queued messages

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: d26fee27-de6c-4b5f-8264-da07de4df6f9

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: center a single tool row on the agent avatar in chat replies (#207748)

* fix(ui): even the gap below a lone tool row in chat

* fix(ui): center a lone tool row on the agent avatar

* improve(ui): show the project beside Cmd+K session settings (#203754)

Move project selection and its New worktree switch into the visible project field. Keep agent selection and Remember settings in their original menu.

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: stop warning about unsaved drafts when opening a chat (#203741)

* fix: stop warning about unsaved drafts when opening a chat

Keep failed background recovery reads distinct from failed edits in the composer and Side chat. Keep one access notice when browser storage is unavailable without consuming the warning for a later failed save.

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: stop warning about unsaved drafts when opening a chat

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 227e24ff-2a24-4a82-a325-e7787c443eed

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(logbook): clear obsolete errors when retrying actions (#199461)

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(ui): keep the sidebar session list collapsed (#207832)

* fix(ui): keep the flat session list collapsed

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(ui): keep the sidebar session list collapsed

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: d5d9e6c3-ba53-4dec-9efe-a5a9c5c29445

* fix(ui): page the sidebar only when it scrolls to the end

Co-authored-by: vyctorbrzezowski <[email protected]>

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: stop treating limited access as an Inbox alert (#207737)

* fix: stop treating limited access as an inbox alert

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: stop treating limited access as an Inbox alert

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: a014cab4-b01d-458b-aa67-ec83ad3a2a99

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: child session activity ring freezes during startup (#188147)

* fix: child session activity ring freezes during startup

Project accepted preparation as running without starting the execution clock. Reserve queued presentation for actual mailbox/global-lane waits and preserve recorded capacity waits.

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: child session activity ring freezes during startup

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 2bf26c5b-2410-44b2-9915-d2289a90f388

* fix: align Gateway consumers with active session startup

Expect active accepted chat preparation, record a real lane wait in metrics, and distinguish preparation from actual queued input in describe/list coverage.

Co-authored-by: vyctorbrzezowski <[email protected]>

* Publish openclaw/plaid-crayfish

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 29690b6c-a214-45c1-9591-fd19b1d51336

* test(gateway): cover child startup in the current session checks

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: remove hover tooltips from Workboard cards (#207928)

* improve: tighten Sessions board card typography (#207931)

* fix: keep Sessions board card hover neutral instead of column color (#207932)

* fix: keep wrapped Settings help links visibly focused on phones (#203819)

* fix(ui): keep wrapped device help links visibly focused

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: show the full focus outline on wrapped device help links

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 7b5d66ad-f165-8076-9dcf-5dd7cd64f0d9

* fix(ui): show wrapped settings help focus at the phone gutter

Co-authored-by: vyctorbrzezowski <[email protected]>

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: keep the selected Review file compact when the tree is open (#203825)

* fix: show the full filename in Review diff headings

Allow the heading to wrap the whole filename instead of reserving the line for its extension. Keep the compact file tree presentation unchanged.

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: show the full filename in Review diff headings

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: ba141dca-cfb0-85b2-a5bb-102d1536c092

* fix: identify the selected file in a narrow Review panel

Keep the destination filename visible above the diff and reserve room for its stem in the changed-files tree.

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: keep identifying filenames and diff actions on one row

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: keep short file extensions intact in Review headings

Co-authored-by: vyctorbrzezowski <[email protected]>

* test: verify renamed and short files in the compact Review tree

Co-authored-by: vyctorbrzezowski <[email protected]>

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: hide desktop Details when there is nothing to show (#205093)

* fix: hide desktop Details when there is nothing to show

* fix(ui): discover session details before mounting the panel

* fix: keep tagged silent replies out of chat (#207738)

* fix(subagents): warn when cancel cannot confirm the worker stopped (#208041)

* fix: align Control UI tooling and docs with task card removal (#207747)

* improve: give assistant chat bubbles a calmer neutral background (#203729)

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: show empty chat search results while a collaborator types (#208010)

Use the filtered transcript to show when a chat search has no matches and to restore the reader’s place. Keep the collaborator’s typing preview visible.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 4fb4672e-d1b4-419c-8551-3ab267f39de3

* test(openai): expect progress instructions in the GPT-Live handshake (#208006)

Expect the direct GPT-Live session.update frame to include the operator's instructions followed by the progress-claims instruction. Keep the full-frame equality check.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 0e4639f8-64cf-4b54-8c52-6d1dd823278c

* fix: keep project picker errors readable (#203763)

* fix(ui): keep project picker errors and retry inside the menu

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: keep project picker errors readable

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: e5cd3cf3-150f-4766-bab3-ca89f29252d1

* test: keep the project picker regression mergeable

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: keep long answer summaries readable in chat (#203779)

* fix: keep long answer summaries readable in chat

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: keep long answer summaries readable in chat

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 40161eb2-ab93-4ac4-810c-656cc6a8d664

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: check the refusal reason for revoked queued followups (#208025)

The Gateway intentionally reports a withheld failure for invalidated sign-in. Keep the model, executed-run, and queue assertions and distinguish this refusal from an unrelated error.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: fd6e1bc9-ac1b-4a0b-86c8-4d15ea9d65ac

* fix(qa): replay Claude compaction completion in the Telegram live lane (#208001)

Worked on by:
- @daniel-lxs

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: edeb5fcc-cfe8-4ad3-9b38-37bdb3073cd8

* refactor(ui): remove unused English catalog entries (#201419)

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: Vyctor H. Brzezowski <[email protected]>

* refactor(ui): remove dead Settings text (Labs, Updates, forms, devices, memory) (#201421)

* refactor(ui): remove unused Labs parallel-task copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove Labs parallel-task text no screen shows

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 3b47ea07-0bd0-8cab-9425-6c67975a8f24

* refactor(ui): remove unused Updates copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused settings form and appearance copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused device, desktop and systems copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused dream diary copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* Publish openclaw/quick-lobster-5

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 3512bcc3-a350-8bc4-8c43-92639564075b

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove dead New session, Sessions, Agents, Templates and OpenClaw ID text (#201422)

* refactor(ui): remove unused New session copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove New session text no screen shows

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 609418e2-3a64-8b1d-a39e-9376e4b8949f

* refactor(ui): remove unused Sessions copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused Templates copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused agent identity and file copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused OpenClaw ID copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* Publish openclaw/oceanic-claw-2

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: dcc9dcf1-1890-866a-b5d9-3dff693a5d98

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove dead model setup, Models and model picker text (#201424)

* refactor(ui): remove unused model setup copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove model setup text no screen shows

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 18ddea1b-160c-8672-a918-2a952c072c15

* refactor(ui): remove unused model provider list copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused add-provider and default model copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused model picker labels

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused model picker loading copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove dead model setup, Models and model picker text

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 6fac1775-a172-8071-8591-9561a51d33c3

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove dead agent tools, Skills and Usage text (#201429)

* refactor(ui): remove unused agent tool access copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove agent tool access text no screen shows

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 4211d89a-e4f4-80e4-9be2-de8848a06a63

* refactor(ui): remove unused Skills copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused Usage copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove dead agent tools, Skills and Usage text

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 33be6fec-530e-814d-9867-ce808e91d99e

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused English text from chat side panels (#201452)

* refactor(ui): remove unused side chat copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused subagent and process panel copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused session files and changes copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused English text from chat side panels

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 32359a08-da6f-86b4-81de-e0c5dbb4226b

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused English text from chat and pull request cards (#201454)

* refactor(ui): remove unused composer and message copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused chat status copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused pull request copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused English text from chat and pull request cards

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: cdb7136a-c0bc-888a-829e-af2403beb226

* test(ui): verify composer translations with a live menu label

Co-authored-by: vyctorbrzezowski <[email protected]>

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused English text from plugin settings and catalog pages (#201455)

* refactor(ui): remove unused plugin settings and access copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused plugin lifecycle and catalog search copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused plugin catalog filter and paging copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused plugin detail fact copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused English text from plugin settings and catalog pages

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: f24e2625-05eb-8d99-8e8a-e31549355657

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused English text from plugin tabs, lists and status labels (#201456)

* refactor(ui): remove unused plugin detail tab and install count copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused installed plugin list and category copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused plugin status and source copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused English text from plugin tabs, lists and status labels

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 57d467b8-c62d-825a-a303-31d561f0d69c

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* test(live): reject failed Moonshot completions (#207728)

* test(live): reject failed Moonshot completions

* test(live): use the current Moonshot model and thinking policy

* test(live): exercise the Moonshot provider thinking policy

* test(live): run the registered Moonshot stream hook

* test(live): load the Moonshot catalog through its public facade

* test(live): type the Moonshot catalog builder as a function

* test(gateway): isolate publication notice memory pressure (#207995)

* fix: test provider review continuations after device removal (#208022)

Check that the removed device disconnects while the already-admitted continuation sends only its acknowledged steer and clears the accepted review. Keep the viewer rejection at admission.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 7ff67804-adab-4c48-b5d8-f0b4334dff46

* improve: reduce memory used by concurrent agent runs (#208033)

* perf(agents): reduce heap held by concurrent runs

Reuse MCP input schema publications and Code Mode declarations through their bounded catalog owners. Resolve embedded runs with the selected-model registry view and hydrate sibling records on demand.

* fix(agents): preserve MCP refresh for deeply nested schemas

If the reuse comparison cannot serialize a changed wire schema, defer to the existing publisher and its depth handling.

* test(agents): update MCP recovery snapshot assertion

* fix: isolate the hook token reload check from plugin startup (#208040)

Keep the real Gateway, config reload, approval and child process. The token probe does not need plugins, whose startup can outlast its five-second child deadline.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: b6aeceb4-1e62-4a21-af66-41b77081ed09

* chore: unblock core lint by fixing oxlint errors in Workboard e2e tests (#208075)

Origin: #207839

## What Problem This Solves

`main` fails `check-lint-core-5`, so every open PR shows that lint shard red. #207839 added three oxlint errors in two Control UI e2e tests:

- `ui/src/e2e/workboard-locale.e2e.test.ts:93`: `curly`
- `ui/src/e2e/workboard-board-editor-mobile.e2e.test.ts:154`: `curly`
- `ui/src/e2e/workboard-board-editor-mobile.e2e.test.ts:178`: `unicorn/prefer-dom-node-text-content`

## User Impact

No product change. This is test-only. Contributors get a green core lint shard again.

## Why This Change Was Made

- Two single-line `if` statements now have braces.
- The mobile editor test reads the column row with Playwright `textContent()` instead of `innerText()`. The assertion keeps its meaning: it checks that the renamed column label "Finished" shows in the row. The label is in the always-rendered `.settings-row__title` span. `textContent` also includes the row's description, and the test does not change it. The new label can only be found if the rename worked.
- Lint rules and other files are not changed.

## Evidence

- On `main` (8d3188542dce), `node scripts/run-oxlint.mjs` on the 2 files: 3 errors (the ones shown above). With this change: `Found 0 warnings and 0 errors`. `oxfmt --check`: clean.
- `vitest --config test/vitest/vitest.ui-e2e.config.ts` on both files, run 2 times: `Test Files 2 passed (2)`, `Tests 4 passed (4)` each time.

Co-authored-by: Ayaan Zaidi <[email protected]>

* perf(gateway): skip display preparation during history sharing checks (#208062)

* chore: simplify Workboard session filter tests (#207853)

* chore: simplify Workboard session filter tests

* test: retain session visibility and reference reset checks

* test: check revoked board references on a cached read

* test: fix prompt-cache journey tool and scope expectations (#208055)

Check web_fetch membership in the latest deferred-tool list. Send chat with
writer scope in Tool Search opt-out journeys so direct and internal turns
can compare the full automations schema.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 62582bff-c96b-4a17-9051-3daa5fa19044

* fix: make the chat sidebar swipe reachable on Android (#208037)

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 6251590e-fd83-4a72-bf88-6000e34d9e6d

* improve(ios): avoid repeated Keychain reads when opening chat (#207667)

* perf(ios): keep Keychain reads out of chat identity

* improve(ios): avoid repeated Keychain reads when opening chat

OpenClaw-Publication: 4ebe6ce8-9b61-8209-be76-df43a417621d

* improve(ios): skip Talk PCM player setup until audio plays (#207668)

* perf(ios): defer PCM player initialization until playback

* improve(ios): skip Talk PCM player setup until audio plays

OpenClaw-Publication: 0fd39061-45a1-8858-970d-0b837bb5dac5

* fix: keep session writes working after a gateway restart (#208031)

Give a newly admitted schema its own validity cell when its markers change. Retain the existing cell when the markers match so unchanged borrowers stay valid.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 3c81c608-4a5c-4c8c-85b1-c3e5b827cd03

* fix: stop the live Tool Search probe from reporting false connection failures (#208034)

Scope the live probe’s session catalog to its fixture tools and discovery controls. Return service availability from the status tool and preserve the wire assertion if the runner throws.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 4b9ea82e-e287-494d-a59e-9523243f60ee

* improve: reduce sidebar work when other chats update (#207791)

* improve: reduce sidebar work when other chats update

Reuse the already reconciled primary result for an identical retained window with the same agent and archive filter. Keep independent windows on their existing reconciliation path.

Co-authored-by: vyctorbrzezowski <[email protected]>

* improve: reduce sidebar work when other chats update

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: f22b2da2-4071-8303-9ece-93ab4f3aacdf

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* improve: avoid rebuilding provider choices while typing a model API key (#207786)

* improve: avoid rebuilding provider choices while typing a model API key

Co-authored-by: vyctorbrzezowski <[email protected]>

* improve: avoid rebuilding provider choices while typing a model API key

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: f5e75abf-1583-83f1-a72a-a8023ceb4625

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* improve: avoid re-sorting displayed runs when paging automation history (#207795)

* improve: reduce repeated work when paging automation history

Consume ordered history pages without re-sorting retained runs at every loading and append render. Keep stable ordering for shifted offset boundaries and immediate offline sort changes. Add an opt-in native-page count workload.

Co-authored-by: vyctorbrzezowski <[email protected]>

* improve: avoid re-sorting displayed runs when paging automation history

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: e82048d2-da2c-8e54-a164-02a1db9a5532

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: verify retained child results in the Ultra live check (#208026)

Read the matched child’s retained result after delivery and verify its run ID before checking the handoff token.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: bbaa86d0-6a79-4155-b69e-2701a35c57bd

* fix(ui): open the selected agent’s chat while reconnecting (#202680)

* fix(ui): open the selected agent chat while reconnecting

* fix(ui): open the selected agent’s chat while reconnecting

OpenClaw-Publication: 722da459-2f0c-4a1a-ac47-0e1899d47f20

* fix: give the installed Codex progress-reply test a conversation to reply to (#208063)

Create the isolated session with internal delivery before starting the installed agent. The transient WebChat flags alone do not advertise a message tool.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: fdae7386-bdc9-4280-9e3e-a18ba8cea046

* fix: run the live trajectory export check against the built gateway (#208038)

Start a built Gateway for the live trajectory export test so the Codex plugin reads the configuration prepared by the Gateway. The test still requires an exact model reply, one-time export approval, and a bundle containing runtime and transcript events.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 055248a1-a1f2-441c-8237-58ff6cee3893

* fix: stop repair notices when their automation is removed (#208036)

Check the automation's ID and creation time before its repair notice continues. Deleting the automation stops the notice from resending its run history to the model. Ordinary edits let the notice finish.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 5d0644b7-f674-4578-ae3f-16f44b3b0e6d

* fix: restart launcher-managed Gateways after exit 78 (#207972)

## What Problem This Solves

A launcher-managed Gateway that exits 78 outside an update trial leaves the serving release down permanently.

## User Impact

The resident launcher now restarts that child with its existing crash backoff (1, 2, 5, 10, then 30 seconds). Trial configuration refusals still roll back. Direct-Gateway systemd services retain `RestartPreventExitStatus=78`. Launcher format 4, trial v2 and IPC bytes are unchanged. The existing launcher writer refreshes an installed file when its bytes differ, while preserving newer launcher formats.

## Why This Change Was Made

Delete the terminal non-trial exit branch rather than add another restart mechanism. Simplification retained the two-line deletion, one byte comparison in the existing writer, migrated lifecycle/replacement regressions and launcher-managed documentation. Production: -2 lines net; tests: +18 net; docs: +2.

## Evidence

- vitest-source, 600-second bounds: the migrated launcher test failed on unchanged main production code because the launcher exited before the first 1-second restart timer; the other 15 launcher tests passed.
- Immediately after the deletion, launcher and frozen-contract tests passed: 19 tests, including unchanged trial-78 rollback assertions and format-4 ready/stop exchange.
- Fake clock checks no child starts before each 1/2/5-second deadline and another child starts at each deadline.
- Focused Oxlint passed; formatter output matched the test file.
- Installed format-4 stale-content regression failed before the byte comparison: the old content remained. The replacement test also verifies a second identical write does not replace the file and newer launcher formats remain untouched.
- Rendering is deterministic: only static constants, flag arrays and source constants are interpolated; no timestamp, PID or install path enters the rendered bytes.
- Header-reader audit on main and shipped `v2026.12.1-beta.1`: `writeLauncher` previously replaced only older formats; `writeGitReleaseLauncher` preserves all formats >=2. A downgrade to the beta-era writer therefore still preserves an installed format-4 launcher as before. The frozen format-4 peer test remains unchanged.
- Prior-head [CI](https://github.com/openclaw/openclaw/actions/runs/46228136551) and [update-restart-auth package acceptance](https://github.com/openclaw/openclaw/actions/runs/46228140802) passed on `c5ad15b432742fc4b8b5455f7f4a512f2a291953`; byte-refresh repair requires fresh hosted evidence. No full local build was run per task scope.

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix: keep sandbox commands working when workspace scratch is not writable (#208005)

Use the container's private /tmp when the sandbox user cannot write the default workspace scratch directory. Keep explicit temp paths and workspace permissions intact.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 31357588-6850-4ea3-a68d-52e744874a24

* fix(gateway): invalidate session history when a transcript publication rejects (#208051)

## Problem

When a transcript publication rejects, Gateway clients that follow the session get no event. Examples: a synchronous projection read throws `SessionRowFactsPending` (the count-sequence fallback fixed by #208004), the history worker fails with a non-overload error (`readSessionMessageByIdAsync` rethrows it), or event-row preparation fails. The Gateway logs `Transcript update dispatch failed` (`src/gateway/server-runtime-subscriptions.ts`) and publishes nothing: no `session.message`, no `sessions.changed`. The open chat stays stale until something else refetches it.

Log signature, reproduced on main: `Transcript update dispatch failed` with `Session row facts require worker reconciliation` (seen in CI runs of `session-message-events.history-worker.test.ts`; root cause in #208004). Any other rejection in the handler loses events the same way.

## Fix

`createTranscriptUpdateBroadcastHandler` already runs every transcript publication in its per-session queue. When the publication rejects, the queue now emits the existing history invalidation: `sessions.changed` with `phase: "message"` and no `messageId`/`messageSeq`. It goes to the same audience as a normal publication (session-event and message subscribers, `canReceiveSessionEvent` authorization, private scope for retired unqualified owners). Then it rethrows, so the existing warning and the live-source fallback stay.

- No new protocol field, event or schema. The protocol docs (`docs/gateway/protocol/rpc-bootstrap-and-events.md`) already say "Refetch history on that invalidation". Clients refetch on it: Control UI `ui/src/pages/chat/chat-state-events.ts`, Apple `ChatViewModel+TransportEvents.swift`, Android `ChatController.kt`.
- If the invalidation itself throws, the rethrown `AggregateError` carries both errors, so the existing warning logs both.
- Accepted edges:
  - A pending assistant error keeps its existing deferral, so no early error row appears.
  - A legacy marker-only update has no session key and stays log-only.
  - A rejection after a `session.message` was sent causes one extra, harmless refetch.
- Out of scope: lifecycle and background-process row handlers. They publish row snapshots, and their resync would be a row invalidation, which is a different signal.

## Users

| PR | Users | Failure class | Evidence |
|---|---|---|---|
| this | Gateway clients following a session (Control UI, iOS/macOS, Android, SDK) | silent stale chat after a rejected transcript publication | `server-runtime-subscriptions.ts` catch logs only; new tests red on main |

One-shot CLI runs do not use this publisher, so they are not affected.

## Evidence

- `session-message-events.history-worker.test.ts` "invalidates selected-session history when a transcript publication rejects": the history worker read rejects with a generic error. The client receives `sessions.changed` (`phase: "message"`, no `messageSeq`), and `chat.history` returns the committed message. Red on main (120 s timeout, no event), green with the fix.
- `server-session-events.recovery.test.ts` "invalidates history and keeps the rejection when a transcript read fails": the handler still rejects with the original error (the caller's warning path) and broadcasts once. Red on main, green with the fix.
- Production +55/-9 (one shared audience helper replaces the inline loop); tests +64.

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix(workboard): open the board in app from dashboard widgets (#199922)

* fix: keep confirmed sends in the receiving chat's model history (#208049)

Supersedes #207992.

## Problem

An isolated automation turn (`gateway call agent` with its own session key, `channel: telegram`, `to: <dm>`, `deliver: false`) sends a Telegram DM with the `message` tool. The user sees the message, replies, and the DM's assistant has no record of it.

Cause: `commitConfirmedVisibleMessage` decided "the producer's own turn already wrote this" by comparing the producer session's stored `delivery.context` with the send address (`createProducerMatcher`), and returned a silent skip. The gateway `agent` request stores its `channel`/`to` routing hint on the isolated session even with `deliver: false`, so the hint matched the DM address and the DM history write was dropped.

## Fix

- Own-turn is decided only by conversation identity: canonical store key of the producer === canonical store key of the resolved destination. The address matcher and both call sites are removed.
- Every remaining not-recorded outcome carries a diagnostic (`skipped()` now requires one).
- The unused `skipDestinationHistory` opt-out is removed (`deliver-contracts.ts`, `message.ts`, `deliver-core.ts`, its test).
- `docs/refactor/conversation-transcript-ownership.md` describes own-turn by key only.

Production diff: 5 files, net negative.

## User impact

A message the user saw from an automation or another session now lands in the destination chat's model history. A same-chat turn's own final reply still gets no second row. No config, schema, protocol or migration change.

## Evidence

- Red on base, green here: `src/sessions/confirmed-visible-message.integration.test.ts` "records an isolated producer's send despite matching DM routing hints=true". The test that asserted the old "context" skip is deleted.
- No duplicate on the real dispatch path (`src/auto-reply/reply/dispatch-visible-history.integration.test.ts`): Telegram DM with `dmScope` `main` and `per-channel-peer`, Telegram forum topic, Discord channel, Control UI/webchat. Each resolves the same outbound route key as the inbound session, so no key-parity fix was needed.
- Affected consumer tests (30 files) passed locally.
- Real Telegram (Test Server, real model), base `a65ac074b3d6`: the isolated producer's DM arrived once; the DM transcript and the DM agent's next model request did not contain it, and the agent answered with an older reply.
- Real Telegram, head `ee6eed48a208` (same entry point): `gateway call agent` with `sessionKey: agent:main:bedtime-e2e`, `channel: telegram`, `deliver: false`; the agent sent "It's 10:15 pm, time for bed. The amber bookmark can wait until morning." once with the `message` tool. The DM session (`agent:main:main`) then had that text as one assistant row (no duplicate). The user asked "what did you just send me?" and the DM agent answered: "I just sent: “It's 10:15 pm, time for bed. The amber bookmark can wait until morning.”"
- Local ClawSweeper review on `ee6eed48a208`: patch correct, zero findings.
- CI: every check passed except `check-lint-core-5`, which fails on three lint errors in Workboard e2e files from #207839 that are on `main` and not in this diff (#208070; override comment on this PR).

## Not changed here (decision recorded)

Plugin-action settlement (`outbound-send-service.ts` `onHandled`): a base test showed a plugin action that sends through durable delivery and also returns a native receipt can write two destination rows (different `deliveryId`s). Deleting the `onHandled` writer would drop history for third-party handlers that send natively and return only a receipt. Routing those through delivery settlement is a new design, so it is a follow-up, not part of this cut.

## Follow-ups

- Exactly-once native receipt settlement that keeps receipt-only plugin handlers.
- Registry-first destination resolver; sessions not created by inbound must not claim chat addresses (removes the "ambiguous" skip).
- Store the not-recorded reason on the delivery queue row (schema change).
- Route direct channel notices through the owner: Telegram `bot-message.ts`, `dm-access.ts`, native command replies; Discord `native-command-reply.ts`; Signal/Matrix approval handlers.
- Inbound "accepted ⇒ in transcript" for queue drop/summarize paths; failed-delivery and overlap-dedupe history on the agent side.

## Merge risk

Revert restores the old skip. Rows already appended stay.

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix(qa): run the live log tail browser test again (#208020)

Point the live log tail scenario at the consolidated auto-follow browser test.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 34b4a470-dfdd-48fb-aaba-59aec526e812

* fix: check managed child delivery in the Codex live suite (#208011)

Check that the parent receives the UUID chosen by its managed child. Let the Docker live suite use the Gateway's delegation defaults.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 7f1bb837-8d14-46f3-82e5-8aa559e33b3e

* improve: speed up Doctor database repair tests (#208103)

Build the healthy migrated agent database once for the repair guard table. Give each case an independent file, registry, and maintenance lease so it still exercises the real defect, repair, and clean recheck.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: f5bae5e0-5d87-4d07-9178-2e4ab0ca2637

* fix(gateway): keep count-path session updates through store discovery (#208004)

## Problem

Scheduled CI kept failing `session-message-events.history-worker.test.ts` (count case, "after worker overload"): 5 of 15 scheduled runs, most recently run 46220607204. After #207862 the case waits the full 120 s test limit, so the event was missing, not late.

A traced CI sample (PR CI, Linux x64, Bun) showed the stop: after the transcript update, the count publication never reached `readSessionMessageCountAsync`, and a `chat.metadata.changed` from a session-store topology change arrived in the same window. A local repro then showed the cause:

```
Error: Session row facts require worker reconciliation
    at readSessionRowEntry (src/gateway/session-row-projection-materialize.ts:460)
    ...
    at selectSessionRowEntries (src/gateway/session-row-scope.ts:551)
```

`handleTranscriptUpdateBroadcast` (`src/gateway/server-session-events.ts`) assigns a cursor sequence to updates that arrive without `messageSeq`. To do that it prepared membership with its own loop and then called `projection.selectEntries()` synchronously. When store discovery runs inside that loop, the row's entry is still unread, so selection throws `SessionRowFactsPending`. That error means "re-enter through exact worker preparation". The handler did not handle it, so the publication failed and clients got neither `session.message` nor `sessions.changed`. The update was lost until the next refetch.

## Change

The count fallback reads its row through the session event publication rows (`sessionEventPublicationRows(projection).withReadyRows`, metadata only), the same owner `withPreparedEventRow` uses. It reaches `withPreparedExactRows`, which prepares membership and retries `SessionRowFactsPending`. The hand-written `prepareMembership` loop is removed.

Known edge, left as is: other throws before publication still reject the update. Only worker overload turns into a `sessions.changed` invalidation. That is a wider change and is not part of this fix.

## Who sees it

Gateway clients that follow a session (`sessions.messages.subscribe`, for example the Control UI) and receive transcript updates without `messageSeq` (`server-session-events.ts`, count fallback), while session-store topology changes (a store added, removed or rediscovered). One-shot CLI runs do not follow session events and do not see this.

## Evidence

- New test `delivers a count-path session update when the store topology changes`: emits a store topology change, then a transcript update without `messageSeq`. Red on base (120 s timeout, 3 of 3 runs), green with the fix (3 of 3, no memo).
- The CI shape (overload case plus store topology churn): 10 of 10 red on base, green with the fix.
- Existing history-worker overload cases and the session event consumer suites pass.
- What starts the store topology change during the CI run is inferred, not traced. The CI trace shows the publication stopping before the count read, with a `chat.metadata.changed` in the same window. The local repro with an explicit topology change gives the same signature and the stack above.

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix: keep Telegram login tests independent of startup speed (#208106)

Wait for the Telegram progress note before checking lane ownership. Release both fixture gates on assertion failure so a slow login cannot spill into the next test.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 177934d0-1fb5-4a06-beb2-10916a09ee47

* fix(release): identify jobs blocking child evidence sealing

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* fix(release): clarify pinned FRV recovery eligibility

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* fix(ci): add tagged reply control to the PR wrapper inventory (#208120)

* fix(android): keep the snooze deadline test independent of runner timing (#208097)

Advance the handset and Gateway clocks together during the post-save refresh. Check the exact deadline sent to the Gateway and the wake time returned to the handset.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 6fb940cc-e4ef-4c8f-94a9-060a736f8c11

* test(process): keep cancel parity off execa's force-kill race (#208126)

## Problem

Scheduled CI run 46234040123 (checks-node-compact-large-42, shard core-runtime-infra-process-hosted-2) failed `src/process/spawn-broker/execa.test.ts > broker command transports > matches buffered cancel results and errors`:

```
-   "isForcefullyTerminated": true,      (direct execa, the reference side)
+   "isForcefullyTerminated": false,     (spawn broker)
    "isCanceled": true, "signal": "SIGTERM"   (both sides)
```

Both sides agree that the command was canceled and that the child exited on SIGTERM. Only the reference side, which calls `execa` directly in the test process, said "forcefully terminated".

Cause: execa starts a `forceKillAfterDelay` timer when it sends SIGTERM (`execa/lib/terminate/kill.js` `killOnTimeout`). If the parent event loop stalls longer than the delay before it reaps the exited child, the timer fires first. `kill('SIGKILL')` then succeeds on the unreaped child and sets `isForcefullyTerminated`, even though the child already exited on SIGTERM. The fixture used a 50 ms delay for every case, so a loaded runner can hit this race.

Reproduced with direct execa 10.2.1, outside the broker: cancel a SIGTERM-honoring child with `forceKillAfterDelay: 50`, then block the event loop for 200 ms in a `setImmediate`. Result 3/3: `signal: "SIGTERM"`, `isCanceled: true`, `isForcefullyTerminated: true`. With no stall, `isForcefullyTerminated` is `false`.

## Change

Test-only. Children that honor SIGTERM get a 5 s force-kill delay, so the timer cannot win the race. These children exit at once, so the tests take no longer. The `forced cancel` case ignores SIGTERM and keeps its 50 ms delay, so it still proves forced termination matches across the broker and direct execa.

## Impact

No product change. Process cancellation results stay correct: in the failing run the broker reported a cancel as a cancel (`isCanceled: true`, `failed: true`). The mismatch was the reference side's timer race.

## Evidence

- CI failure: https://github.com/openclaw/openclaw/actions/runs/46234040123/job/141256229744
- No `src/process` change in the window 84ca43a1..758614e7.
- Before the change: 5/5 green locally with load average ~39 (the race needs a stall over 50 ms).
- After the change: `execa.test.ts` full file 5/5 green, 27 passed, 3 skipped.

Co-authored-by: Ayaan Zaidi <[email protected]>

* test(state): keep schema modules out of read-only agent database access (#185841)

* fix(state): avoid eager writer imports in agent database reads

* test(state): keep schema modules out of read-only agent database access

* chore(release): close out 2026.11.11 on main (#208114)

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* fix(outbound): record a plugin action's visible send once (#208130)

Follows #208049.

## Problem

A plugin `send` action can write the same visible message into the destination chat's model history twice.

Telegram's action handler sends through `sendDurableMessageBatch`. Durable delivery records the confirmed send (`deliver-core.ts` `recordConfirmedTranscript`, key `outbound-delivery:<queue id>:0`). The handler then returns a native receipt, and `outbound-send-service.ts` `onHandled` records it again (key `outbound-delivery:<deliveryIntentId ?? idempotencyKey ?? uuid>:0`). The two keys differ, so the destination gets two identical assistant rows. The model then sees one message the user saw once as two messages.

On real Telegram the second row appears when the destination resolves without ambiguity, for example when the producer session does not carry a `channel/to` hint for the DM. (In #208049's E2E the producer carried that hint, so the durable write was skipped as "multiple current destinations match" and only one row landed.)

## Fix

One plugin action is one send, recorded once.

- `executeSendAction` runs the plugin action inside `runPluginActionHistoryScope(…)`.
- `commitConfirmedVisibleMessage` (the history owner) marks the scope when it actually adds a row.
- The action's receipt commit (`onHandled`) skips when the scope is marked: the handler's core-delivery send already recorded the message.
- Core delivery keeps its own queue identity for the row, so restart recovery (which re-commits with the queue entry id) still finds the existing row.
- Receipt-only handlers (send natively, no core delivery) are unchanged: nothing marks the scope, and `onHandled` writes their one row.
- If the core-delivery commit is skipped (for example an ambiguous destination), the scope stays unmarked and `onHandled` still writes with the caller's route, as before.

Why a scope and not a new field: `ChannelMessageActionContext` has no delivery identity field, and each plugin forwards context fields to its runtime by hand (Telegram lists them in `channel-actions.ts`). Threading an id would be a new public Plugin SDK field that every third-party handler must forward. The scope reaches any handler that sends through core delivery, with no SDK change. No config, stored state, table or hook.

Review round 1 changed the mechanism: an earlier head replaced the core row's id with the action id, which broke dedupe on restart recovery (recovery commits under the queue entry id). This head keeps the queue id.

## User impact

A message sent through a plugin action (Telegram `message` tool sends, for example) appears once in the receiving chat's model history, exactly as delivered. No config, schema, protocol, stored-row or SDK change.

## Evidence

- Red on base, green here: `src/infra/outbound/outbound-send-service.integration.test.ts` "records a plugin action's durable send in destination history once" (base: two identical rows).
- Stays green: "records a receipt-only plugin action in destination history once".
- Consumer tests: 19 files passed locally (one `ocx test` set, vitest-source): the new test, `outbound-send-service{,.accepted-outcomes}.test.ts` (their module mocks now pass the scope through), `deliver.test.ts`, `deliver-confirmed-visible.test.ts`, `delivery-queue.transcript.test.ts`, `confirmed-visible-message.integration.test.ts`, `message-action-send{,.core,.media,.mirror-order,.validation}.test.ts`, subagent announce delivery/mirror tests, Telegram `action-runtime.test.ts` + `channel-actions.contract.test.ts`, Discord `actions/runtime.test.ts`, Slack `action-runtime.test.ts`, `test/qa-channel-message-tool-delivery.test.ts`.
- Real Telegram (Test Server, source Gateway) on head `c33cd7f46b40`: the DM user first got a reply ("READY"), so the DM session existed. Then `gateway call agent` ran with an isolated `sessionKey`, `deliver: false` and no `channel`/`to` hints. Its `message` tool sent one marker DM to the user. Results: the recorder saw 1 marker message, and the DM session (`agent:main:main`) had 1 assistant row for it. That row's key is the core-delivery queue id (`outbound-delivery:<uuid>:0`), so the handler's durable write recorded it and the receipt commit skipped. The Gateway logged no "multiple current destinations match" line, so the run took the path that wrote two rows before this fix. The model fixture was deterministic, so the tool call was predictable. Telegram transport and transcript were real.
- Local review: round 1 found the recovery-identity problem described above (fixed). Round 2 on `c33cd7f46b40`: patch correct, no findings.
- Rebased on main to pick up #208120: the base had #207738 without its PR-wrapper inventory fix, so `test/scripts/eager-import-closure.test.ts` was red.

## Follow-ups (out of scope)

- Registry-first destination resolver; remove the "ambiguous" skip.
- Store the not-recorded reason on the delivery queue row (schema change).
- Route direct channel notices through the history owner.
- Inbound "accepted ⇒ in transcript" guarantees.
- Failed-delivery history.

## Merge risk

Two-way door. Revert restores the duplicate row. No stored format change; the idempotency key format is the same, only which id fills it inside a plugin action. Blast radius: plugin-action sends that also go through core delivery (Telegram today).

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix: let a fallback model finish after Code Mode reads

Allow the configured fallback model to finish after a completed Code Mode cell when every host call has a successful read receipt and qualifies for direct retry. Shell writes, unfinished cells and plugin lookups without an audited replay classification still block fallback.

Closes #207895

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: d49db423-f997-43b6-b23c-4d0be08459c0

* fix: let older automations read their conversation's memory (#208143)

## What Problem This Solves

Automations created before OpenClaw recorded the creating conversation (every job without `sourceConversation`, i.e. created before #179062) name that conversation only by session key. Their scheduled runs get no memory at all: every `knowledge_*` or memory tool call fails with "the host granted this session no memory audience", and the Gateway logs `memory audience unavailable: root session agent:<agent>:cron:<job>:run:<run> has no durable chat type`. The same runs still hold owner-only tools such as `exec`. A production automation that reads and writes the owner's knowledge vault every week hit this on every run.

## User Impact

- A key-only detached automation (`isolated` / `current`) now reads its conversation's current memory, the same way a bound automation does:
  - created in the owner's direct chat: the owner's private memory;
  - created in a group or channel: only that conversation's memory, never owner-private.
- When the job recorded a requester (profile or channel sender), that requester's owner status is checked at each occurrence first; without one, the run's existing owner bit decides, as it already does for the run's tools.
- If the conversation row is gone, archived or cannot be read, the run proceeds exactly as before (no memory, no pause, no failure).
- Board, workspace, sandbox, event target and the run's tools are unchanged. `main` and `session:<key>` targets are unchanged.
- `automations bind` stays available for the exact-incarnation link but is no longer needed for memory. Docs (`cli/cron` "Binding older jobs", `automation/cron-jobs/payloads`) and Doctor's unbound note say so.

Accepted edge case: a key-only run whose agent sandbox mode is `non-main` or `all` now gets owner-private memory it did not have, when the job was created in the owner's direct chat. The owner created these jobs in their own DM, and the run already holds owner authority.

## Why This Change Was Made

`resolveScheduledPrincipal` classifies these jobs as `unbound-parent` and gives them legacy owner authority, but `buildScheduledExecutionContext` pointed their memory at the cron run row, which never has a chat type, so the memory resolver always denied. The fix stays in the existing owner:

- `admitScheduledOccurrence` (`src/cron/execution-context-admission.ts`): for an `unbound-parent` principal on a detached run, read the key-linked conversation row once. A failed read becomes "no row". No generation lease, workspace binding, sandbox or pause change. A recorded requester is admitted per occurrence through the existing `admitScheduledRequesterGrant`.
- `buildScheduledExecutionContext` (`src/cron/execution-context.ts`): with a live row, memory becomes `{ source: "parent", parent: <current sessionKey/sessionId/lifecycleRevision>, owner }`. Everything else for `unbound-parent` is unchanged.
- The memory resolver (`src/plugins/memory-audience.ts`) does not change: it already maps a direct root + owner to owner-private and direct/group/channel to that conversation's partition, for both the embedded and the CLI runtime.
- `scheduledParentKeyOf` now derives the key from `resolveScheduledPrincipal` itself, so Doctor's access review and the development replay read the same row the runtime does; the replay vector (`execution-context-projection.ts`) already labels the memory gain as intended, so it needed no edit.

Not changed: Doctor auto-bind or any stored-row write, jobs with no parent key, bound jobs with no recorded requester. On current `main`, bound jobs keep following their conversation after a reset (#205887), so no reset-degraded path exists to special-case.

## Evidence

Real-admission tests (red on the merge base `bb5c001bb6fc`, green on this head; 6 tests failed on base, all pass on head):

- `execution-context-memory-audience.test.ts` (real admission → registry → embedded and CLI resolvers): key-only owner-DM job → owner-private; key-only group job → that group's conversation only; key-only job with a revoked recorded requester → conversation only; key-only job whose conversation is gone → no audience, run admitted.
- `execution-context.test.ts`: key-only detached job gets parent memory and nothing else (board/workspace/sandbox stay the run's); archived, removed and in-session (`session:<key>`) cases keep run-session memory.
- `execution-context-admission.test.ts`: key-only read takes no generation lease; a failed read still admits the run with its own memory.
- `isolated-agent/run.bind-parent.test.ts` (real cron service + timer): the unbound job now reaches its conversation's memory, without a run-row receipt.

Local runs: the 27 test files that import the changed sources passed (`ocx test`, 6 shards). `pnpm check:changed`: typecheck, lint, guards all ok; the dead-export scan fails only on files this PR does not touch (`src/agents/command/types.ts`, `src/plugins/native-module-require.ts`, `ui/src/...`, `src/gateway/server-methods/update.test-harness.ts`), same as `main`.

End to end, scratch Gateway from source, `plugins.slots.memory: "knowledge"`, real model (`openai/gpt-5.5`). An owner Control UI direct chat was created by one real `chat.send` (row `chatType: "direct"`). A key-only isolated `agentTurn` job (owner key = that chat, no `sourceConversation`, no recorded requester, no tool policy, `toolsAllow` incl. `knowledge_remember`, `knowledge_grep`, `exec`) fired from its own `at` schedule about two minutes ahead (no forced run).

Base (`bb5c001bb6fc`):

```
[agent/embedded] memory audience unavailable: root session agent:main:cron:<job>:run:<run> has no durable chat type
```
```
knowledge_remember: "Knowledge access unavailable: the host granted this session no memory audience. The Gateway log entry "memory_audience_denied" for this session names the reason and its repair."
kn…
vyctorbrzezowski added a commit that referenced this pull request Nov 29, 2026
…mn (#207380)

* feat(ui): offer Add to Home agent when Home sidebar is open (#207773)

* fix(ui): remove Open PR from the session menu (#207808)

* fix(ui): remove Open PR from the session menu

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(ui): remove Open PR from the session menu

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 19ab49eb-2fdb-4e2a-ba0e-3fcf8de38db9

* fix(ui): preserve shared session menu copy

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(workboard): let users delete an empty default board (#207909)

* test(gateway): isolate publication recovery memory pressure (#207993)

* fix: remove dismissed chat suggestions without waiting (#207792)

* fix: remove dismissed chat suggestions without waiting

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: remove dismissed chat suggestions without waiting

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: a7065126-58f4-41f4-ab35-887c77e05eac

* refactor: keep suggestion dismissal focus with the pane keyboard helpers

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: remove dismissed chat suggestions without waiting

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 362ae3c3-16c8-4016-8f59-dc477414e07a

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(ui): show a subtle placeholder while a new chat gets its title (#207809)

* fix(ui): show a subtle placeholder while a new chat gets its title

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(ui): show a subtle placeholder while a new chat gets its title

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 5a8d6d8e-7c91-4b07-9467-ff499cf2786a

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: keep skill highlights in sent chat messages (#207828)

* fix: keep skill highlights in sent chat messages

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: keep skill highlights in sent chat messages

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 303c108c-485c-4ee9-bcdc-b6845d507543

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* improve: keep Workboard editing and Save within reach on phones (#207839)

* improve: keep Workboard editing and Save within reach on phones

Co-authored-by: vyctorbrzezowski <[email protected]>

* improve: keep Workboard editing and Save within reach on phones

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 41fdebe7-35c4-435a-8128-eb9f12e2fabf

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(ui): highlight skills and mentions in queued messages (#207829)

* fix(ui): highlight skills and mentions in queued messages

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(ui): highlight skills and mentions in queued messages

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: d26fee27-de6c-4b5f-8264-da07de4df6f9

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: center a single tool row on the agent avatar in chat replies (#207748)

* fix(ui): even the gap below a lone tool row in chat

* fix(ui): center a lone tool row on the agent avatar

* improve(ui): show the project beside Cmd+K session settings (#203754)

Move project selection and its New worktree switch into the visible project field. Keep agent selection and Remember settings in their original menu.

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: stop warning about unsaved drafts when opening a chat (#203741)

* fix: stop warning about unsaved drafts when opening a chat

Keep failed background recovery reads distinct from failed edits in the composer and Side chat. Keep one access notice when browser storage is unavailable without consuming the warning for a later failed save.

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: stop warning about unsaved drafts when opening a chat

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 227e24ff-2a24-4a82-a325-e7787c443eed

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(logbook): clear obsolete errors when retrying actions (#199461)

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(ui): keep the sidebar session list collapsed (#207832)

* fix(ui): keep the flat session list collapsed

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix(ui): keep the sidebar session list collapsed

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: d5d9e6c3-ba53-4dec-9efe-a5a9c5c29445

* fix(ui): page the sidebar only when it scrolls to the end

Co-authored-by: vyctorbrzezowski <[email protected]>

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: stop treating limited access as an Inbox alert (#207737)

* fix: stop treating limited access as an inbox alert

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: stop treating limited access as an Inbox alert

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: a014cab4-b01d-458b-aa67-ec83ad3a2a99

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: child session activity ring freezes during startup (#188147)

* fix: child session activity ring freezes during startup

Project accepted preparation as running without starting the execution clock. Reserve queued presentation for actual mailbox/global-lane waits and preserve recorded capacity waits.

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: child session activity ring freezes during startup

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 2bf26c5b-2410-44b2-9915-d2289a90f388

* fix: align Gateway consumers with active session startup

Expect active accepted chat preparation, record a real lane wait in metrics, and distinguish preparation from actual queued input in describe/list coverage.

Co-authored-by: vyctorbrzezowski <[email protected]>

* Publish openclaw/plaid-crayfish

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 29690b6c-a214-45c1-9591-fd19b1d51336

* test(gateway): cover child startup in the current session checks

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: remove hover tooltips from Workboard cards (#207928)

* improve: tighten Sessions board card typography (#207931)

* fix: keep Sessions board card hover neutral instead of column color (#207932)

* fix: keep wrapped Settings help links visibly focused on phones (#203819)

* fix(ui): keep wrapped device help links visibly focused

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: show the full focus outline on wrapped device help links

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 7b5d66ad-f165-8076-9dcf-5dd7cd64f0d9

* fix(ui): show wrapped settings help focus at the phone gutter

Co-authored-by: vyctorbrzezowski <[email protected]>

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: keep the selected Review file compact when the tree is open (#203825)

* fix: show the full filename in Review diff headings

Allow the heading to wrap the whole filename instead of reserving the line for its extension. Keep the compact file tree presentation unchanged.

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: show the full filename in Review diff headings

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: ba141dca-cfb0-85b2-a5bb-102d1536c092

* fix: identify the selected file in a narrow Review panel

Keep the destination filename visible above the diff and reserve room for its stem in the changed-files tree.

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: keep identifying filenames and diff actions on one row

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: keep short file extensions intact in Review headings

Co-authored-by: vyctorbrzezowski <[email protected]>

* test: verify renamed and short files in the compact Review tree

Co-authored-by: vyctorbrzezowski <[email protected]>

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: hide desktop Details when there is nothing to show (#205093)

* fix: hide desktop Details when there is nothing to show

* fix(ui): discover session details before mounting the panel

* fix: keep tagged silent replies out of chat (#207738)

* fix(subagents): warn when cancel cannot confirm the worker stopped (#208041)

* fix: align Control UI tooling and docs with task card removal (#207747)

* improve: give assistant chat bubbles a calmer neutral background (#203729)

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: show empty chat search results while a collaborator types (#208010)

Use the filtered transcript to show when a chat search has no matches and to restore the reader’s place. Keep the collaborator’s typing preview visible.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 4fb4672e-d1b4-419c-8551-3ab267f39de3

* test(openai): expect progress instructions in the GPT-Live handshake (#208006)

Expect the direct GPT-Live session.update frame to include the operator's instructions followed by the progress-claims instruction. Keep the full-frame equality check.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 0e4639f8-64cf-4b54-8c52-6d1dd823278c

* fix: keep project picker errors readable (#203763)

* fix(ui): keep project picker errors and retry inside the menu

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: keep project picker errors readable

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: e5cd3cf3-150f-4766-bab3-ca89f29252d1

* test: keep the project picker regression mergeable

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: keep long answer summaries readable in chat (#203779)

* fix: keep long answer summaries readable in chat

Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: keep long answer summaries readable in chat

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 40161eb2-ab93-4ac4-810c-656cc6a8d664

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: check the refusal reason for revoked queued followups (#208025)

The Gateway intentionally reports a withheld failure for invalidated sign-in. Keep the model, executed-run, and queue assertions and distinguish this refusal from an unrelated error.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: fd6e1bc9-ac1b-4a0b-86c8-4d15ea9d65ac

* fix(qa): replay Claude compaction completion in the Telegram live lane (#208001)

Worked on by:
- @daniel-lxs

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: edeb5fcc-cfe8-4ad3-9b38-37bdb3073cd8

* refactor(ui): remove unused English catalog entries (#201419)

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: Vyctor H. Brzezowski <[email protected]>

* refactor(ui): remove dead Settings text (Labs, Updates, forms, devices, memory) (#201421)

* refactor(ui): remove unused Labs parallel-task copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove Labs parallel-task text no screen shows

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 3b47ea07-0bd0-8cab-9425-6c67975a8f24

* refactor(ui): remove unused Updates copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused settings form and appearance copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused device, desktop and systems copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused dream diary copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* Publish openclaw/quick-lobster-5

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 3512bcc3-a350-8bc4-8c43-92639564075b

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove dead New session, Sessions, Agents, Templates and OpenClaw ID text (#201422)

* refactor(ui): remove unused New session copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove New session text no screen shows

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 609418e2-3a64-8b1d-a39e-9376e4b8949f

* refactor(ui): remove unused Sessions copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused Templates copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused agent identity and file copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused OpenClaw ID copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* Publish openclaw/oceanic-claw-2

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: dcc9dcf1-1890-866a-b5d9-3dff693a5d98

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove dead model setup, Models and model picker text (#201424)

* refactor(ui): remove unused model setup copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove model setup text no screen shows

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 18ddea1b-160c-8672-a918-2a952c072c15

* refactor(ui): remove unused model provider list copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused add-provider and default model copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused model picker labels

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused model picker loading copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove dead model setup, Models and model picker text

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 6fac1775-a172-8071-8591-9561a51d33c3

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove dead agent tools, Skills and Usage text (#201429)

* refactor(ui): remove unused agent tool access copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove agent tool access text no screen shows

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 4211d89a-e4f4-80e4-9be2-de8848a06a63

* refactor(ui): remove unused Skills copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused Usage copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove dead agent tools, Skills and Usage text

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 33be6fec-530e-814d-9867-ce808e91d99e

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused English text from chat side panels (#201452)

* refactor(ui): remove unused side chat copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused subagent and process panel copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused session files and changes copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused English text from chat side panels

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 32359a08-da6f-86b4-81de-e0c5dbb4226b

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused English text from chat and pull request cards (#201454)

* refactor(ui): remove unused composer and message copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused chat status copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused pull request copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused English text from chat and pull request cards

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: cdb7136a-c0bc-888a-829e-af2403beb226

* test(ui): verify composer translations with a live menu label

Co-authored-by: vyctorbrzezowski <[email protected]>

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused English text from plugin settings and catalog pages (#201455)

* refactor(ui): remove unused plugin settings and access copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused plugin lifecycle and catalog search copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused plugin catalog filter and paging copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused plugin detail fact copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused English text from plugin settings and catalog pages

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: f24e2625-05eb-8d99-8e8a-e31549355657

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused English text from plugin tabs, lists and status labels (#201456)

* refactor(ui): remove unused plugin detail tab and install count copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused installed plugin list and category copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused plugin status and source copy

Co-authored-by: vyctorbrzezowski <[email protected]>

* refactor(ui): remove unused English text from plugin tabs, lists and status labels

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: 57d467b8-c62d-825a-a303-31d561f0d69c

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* test(live): reject failed Moonshot completions (#207728)

* test(live): reject failed Moonshot completions

* test(live): use the current Moonshot model and thinking policy

* test(live): exercise the Moonshot provider thinking policy

* test(live): run the registered Moonshot stream hook

* test(live): load the Moonshot catalog through its public facade

* test(live): type the Moonshot catalog builder as a function

* test(gateway): isolate publication notice memory pressure (#207995)

* fix: test provider review continuations after device removal (#208022)

Check that the removed device disconnects while the already-admitted continuation sends only its acknowledged steer and clears the accepted review. Keep the viewer rejection at admission.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 7ff67804-adab-4c48-b5d8-f0b4334dff46

* improve: reduce memory used by concurrent agent runs (#208033)

* perf(agents): reduce heap held by concurrent runs

Reuse MCP input schema publications and Code Mode declarations through their bounded catalog owners. Resolve embedded runs with the selected-model registry view and hydrate sibling records on demand.

* fix(agents): preserve MCP refresh for deeply nested schemas

If the reuse comparison cannot serialize a changed wire schema, defer to the existing publisher and its depth handling.

* test(agents): update MCP recovery snapshot assertion

* fix: isolate the hook token reload check from plugin startup (#208040)

Keep the real Gateway, config reload, approval and child process. The token probe does not need plugins, whose startup can outlast its five-second child deadline.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: b6aeceb4-1e62-4a21-af66-41b77081ed09

* chore: unblock core lint by fixing oxlint errors in Workboard e2e tests (#208075)

Origin: #207839

## What Problem This Solves

`main` fails `check-lint-core-5`, so every open PR shows that lint shard red. #207839 added three oxlint errors in two Control UI e2e tests:

- `ui/src/e2e/workboard-locale.e2e.test.ts:93`: `curly`
- `ui/src/e2e/workboard-board-editor-mobile.e2e.test.ts:154`: `curly`
- `ui/src/e2e/workboard-board-editor-mobile.e2e.test.ts:178`: `unicorn/prefer-dom-node-text-content`

## User Impact

No product change. This is test-only. Contributors get a green core lint shard again.

## Why This Change Was Made

- Two single-line `if` statements now have braces.
- The mobile editor test reads the column row with Playwright `textContent()` instead of `innerText()`. The assertion keeps its meaning: it checks that the renamed column label "Finished" shows in the row. The label is in the always-rendered `.settings-row__title` span. `textContent` also includes the row's description, and the test does not change it. The new label can only be found if the rename worked.
- Lint rules and other files are not changed.

## Evidence

- On `main` (8d3188542dce), `node scripts/run-oxlint.mjs` on the 2 files: 3 errors (the ones shown above). With this change: `Found 0 warnings and 0 errors`. `oxfmt --check`: clean.
- `vitest --config test/vitest/vitest.ui-e2e.config.ts` on both files, run 2 times: `Test Files 2 passed (2)`, `Tests 4 passed (4)` each time.

Co-authored-by: Ayaan Zaidi <[email protected]>

* perf(gateway): skip display preparation during history sharing checks (#208062)

* chore: simplify Workboard session filter tests (#207853)

* chore: simplify Workboard session filter tests

* test: retain session visibility and reference reset checks

* test: check revoked board references on a cached read

* test: fix prompt-cache journey tool and scope expectations (#208055)

Check web_fetch membership in the latest deferred-tool list. Send chat with
writer scope in Tool Search opt-out journeys so direct and internal turns
can compare the full automations schema.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 62582bff-c96b-4a17-9051-3daa5fa19044

* fix: make the chat sidebar swipe reachable on Android (#208037)

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 6251590e-fd83-4a72-bf88-6000e34d9e6d

* improve(ios): avoid repeated Keychain reads when opening chat (#207667)

* perf(ios): keep Keychain reads out of chat identity

* improve(ios): avoid repeated Keychain reads when opening chat

OpenClaw-Publication: 4ebe6ce8-9b61-8209-be76-df43a417621d

* improve(ios): skip Talk PCM player setup until audio plays (#207668)

* perf(ios): defer PCM player initialization until playback

* improve(ios): skip Talk PCM player setup until audio plays

OpenClaw-Publication: 0fd39061-45a1-8858-970d-0b837bb5dac5

* fix: keep session writes working after a gateway restart (#208031)

Give a newly admitted schema its own validity cell when its markers change. Retain the existing cell when the markers match so unchanged borrowers stay valid.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 3c81c608-4a5c-4c8c-85b1-c3e5b827cd03

* fix: stop the live Tool Search probe from reporting false connection failures (#208034)

Scope the live probe’s session catalog to its fixture tools and discovery controls. Return service availability from the status tool and preserve the wire assertion if the runner throws.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 4b9ea82e-e287-494d-a59e-9523243f60ee

* improve: reduce sidebar work when other chats update (#207791)

* improve: reduce sidebar work when other chats update

Reuse the already reconciled primary result for an identical retained window with the same agent and archive filter. Keep independent windows on their existing reconciliation path.

Co-authored-by: vyctorbrzezowski <[email protected]>

* improve: reduce sidebar work when other chats update

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: f22b2da2-4071-8303-9ece-93ab4f3aacdf

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* improve: avoid rebuilding provider choices while typing a model API key (#207786)

* improve: avoid rebuilding provider choices while typing a model API key

Co-authored-by: vyctorbrzezowski <[email protected]>

* improve: avoid rebuilding provider choices while typing a model API key

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: f5e75abf-1583-83f1-a72a-a8023ceb4625

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* improve: avoid re-sorting displayed runs when paging automation history (#207795)

* improve: reduce repeated work when paging automation history

Consume ordered history pages without re-sorting retained runs at every loading and append render. Keep stable ordering for shifted offset boundaries and immediate offline sort changes. Add an opt-in native-page count workload.

Co-authored-by: vyctorbrzezowski <[email protected]>

* improve: avoid re-sorting displayed runs when paging automation history

Worked on by:
- @vyctorbrzezowski

Co-authored-by: vyctorbrzezowski <[email protected]>
OpenClaw-Publication: e82048d2-da2c-8e54-a164-02a1db9a5532

---------

Co-authored-by: roboclaw-bot <[email protected]>
Co-authored-by: vyctorbrzezowski <[email protected]>

* fix: verify retained child results in the Ultra live check (#208026)

Read the matched child’s retained result after delivery and verify its run ID before checking the handoff token.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: bbaa86d0-6a79-4155-b69e-2701a35c57bd

* fix(ui): open the selected agent’s chat while reconnecting (#202680)

* fix(ui): open the selected agent chat while reconnecting

* fix(ui): open the selected agent’s chat while reconnecting

OpenClaw-Publication: 722da459-2f0c-4a1a-ac47-0e1899d47f20

* fix: give the installed Codex progress-reply test a conversation to reply to (#208063)

Create the isolated session with internal delivery before starting the installed agent. The transient WebChat flags alone do not advertise a message tool.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: fdae7386-bdc9-4280-9e3e-a18ba8cea046

* fix: run the live trajectory export check against the built gateway (#208038)

Start a built Gateway for the live trajectory export test so the Codex plugin reads the configuration prepared by the Gateway. The test still requires an exact model reply, one-time export approval, and a bundle containing runtime and transcript events.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 055248a1-a1f2-441c-8237-58ff6cee3893

* fix: stop repair notices when their automation is removed (#208036)

Check the automation's ID and creation time before its repair notice continues. Deleting the automation stops the notice from resending its run history to the model. Ordinary edits let the notice finish.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 5d0644b7-f674-4578-ae3f-16f44b3b0e6d

* fix: restart launcher-managed Gateways after exit 78 (#207972)

## What Problem This Solves

A launcher-managed Gateway that exits 78 outside an update trial leaves the serving release down permanently.

## User Impact

The resident launcher now restarts that child with its existing crash backoff (1, 2, 5, 10, then 30 seconds). Trial configuration refusals still roll back. Direct-Gateway systemd services retain `RestartPreventExitStatus=78`. Launcher format 4, trial v2 and IPC bytes are unchanged. The existing launcher writer refreshes an installed file when its bytes differ, while preserving newer launcher formats.

## Why This Change Was Made

Delete the terminal non-trial exit branch rather than add another restart mechanism. Simplification retained the two-line deletion, one byte comparison in the existing writer, migrated lifecycle/replacement regressions and launcher-managed documentation. Production: -2 lines net; tests: +18 net; docs: +2.

## Evidence

- vitest-source, 600-second bounds: the migrated launcher test failed on unchanged main production code because the launcher exited before the first 1-second restart timer; the other 15 launcher tests passed.
- Immediately after the deletion, launcher and frozen-contract tests passed: 19 tests, including unchanged trial-78 rollback assertions and format-4 ready/stop exchange.
- Fake clock checks no child starts before each 1/2/5-second deadline and another child starts at each deadline.
- Focused Oxlint passed; formatter output matched the test file.
- Installed format-4 stale-content regression failed before the byte comparison: the old content remained. The replacement test also verifies a second identical write does not replace the file and newer launcher formats remain untouched.
- Rendering is deterministic: only static constants, flag arrays and source constants are interpolated; no timestamp, PID or install path enters the rendered bytes.
- Header-reader audit on main and shipped `v2026.12.1-beta.1`: `writeLauncher` previously replaced only older formats; `writeGitReleaseLauncher` preserves all formats >=2. A downgrade to the beta-era writer therefore still preserves an installed format-4 launcher as before. The frozen format-4 peer test remains unchanged.
- Prior-head [CI](https://github.com/openclaw/openclaw/actions/runs/46228136551) and [update-restart-auth package acceptance](https://github.com/openclaw/openclaw/actions/runs/46228140802) passed on `c5ad15b432742fc4b8b5455f7f4a512f2a291953`; byte-refresh repair requires fresh hosted evidence. No full local build was run per task scope.

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix: keep sandbox commands working when workspace scratch is not writable (#208005)

Use the container's private /tmp when the sandbox user cannot write the default workspace scratch directory. Keep explicit temp paths and workspace permissions intact.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 31357588-6850-4ea3-a68d-52e744874a24

* fix(gateway): invalidate session history when a transcript publication rejects (#208051)

## Problem

When a transcript publication rejects, Gateway clients that follow the session get no event. Examples: a synchronous projection read throws `SessionRowFactsPending` (the count-sequence fallback fixed by #208004), the history worker fails with a non-overload error (`readSessionMessageByIdAsync` rethrows it), or event-row preparation fails. The Gateway logs `Transcript update dispatch failed` (`src/gateway/server-runtime-subscriptions.ts`) and publishes nothing: no `session.message`, no `sessions.changed`. The open chat stays stale until something else refetches it.

Log signature, reproduced on main: `Transcript update dispatch failed` with `Session row facts require worker reconciliation` (seen in CI runs of `session-message-events.history-worker.test.ts`; root cause in #208004). Any other rejection in the handler loses events the same way.

## Fix

`createTranscriptUpdateBroadcastHandler` already runs every transcript publication in its per-session queue. When the publication rejects, the queue now emits the existing history invalidation: `sessions.changed` with `phase: "message"` and no `messageId`/`messageSeq`. It goes to the same audience as a normal publication (session-event and message subscribers, `canReceiveSessionEvent` authorization, private scope for retired unqualified owners). Then it rethrows, so the existing warning and the live-source fallback stay.

- No new protocol field, event or schema. The protocol docs (`docs/gateway/protocol/rpc-bootstrap-and-events.md`) already say "Refetch history on that invalidation". Clients refetch on it: Control UI `ui/src/pages/chat/chat-state-events.ts`, Apple `ChatViewModel+TransportEvents.swift`, Android `ChatController.kt`.
- If the invalidation itself throws, the rethrown `AggregateError` carries both errors, so the existing warning logs both.
- Accepted edges:
  - A pending assistant error keeps its existing deferral, so no early error row appears.
  - A legacy marker-only update has no session key and stays log-only.
  - A rejection after a `session.message` was sent causes one extra, harmless refetch.
- Out of scope: lifecycle and background-process row handlers. They publish row snapshots, and their resync would be a row invalidation, which is a different signal.

## Users

| PR | Users | Failure class | Evidence |
|---|---|---|---|
| this | Gateway clients following a session (Control UI, iOS/macOS, Android, SDK) | silent stale chat after a rejected transcript publication | `server-runtime-subscriptions.ts` catch logs only; new tests red on main |

One-shot CLI runs do not use this publisher, so they are not affected.

## Evidence

- `session-message-events.history-worker.test.ts` "invalidates selected-session history when a transcript publication rejects": the history worker read rejects with a generic error. The client receives `sessions.changed` (`phase: "message"`, no `messageSeq`), and `chat.history` returns the committed message. Red on main (120 s timeout, no event), green with the fix.
- `server-session-events.recovery.test.ts` "invalidates history and keeps the rejection when a transcript read fails": the handler still rejects with the original error (the caller's warning path) and broadcasts once. Red on main, green with the fix.
- Production +55/-9 (one shared audience helper replaces the inline loop); tests +64.

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix(workboard): open the board in app from dashboard widgets (#199922)

* fix: keep confirmed sends in the receiving chat's model history (#208049)

Supersedes #207992.

## Problem

An isolated automation turn (`gateway call agent` with its own session key, `channel: telegram`, `to: <dm>`, `deliver: false`) sends a Telegram DM with the `message` tool. The user sees the message, replies, and the DM's assistant has no record of it.

Cause: `commitConfirmedVisibleMessage` decided "the producer's own turn already wrote this" by comparing the producer session's stored `delivery.context` with the send address (`createProducerMatcher`), and returned a silent skip. The gateway `agent` request stores its `channel`/`to` routing hint on the isolated session even with `deliver: false`, so the hint matched the DM address and the DM history write was dropped.

## Fix

- Own-turn is decided only by conversation identity: canonical store key of the producer === canonical store key of the resolved destination. The address matcher and both call sites are removed.
- Every remaining not-recorded outcome carries a diagnostic (`skipped()` now requires one).
- The unused `skipDestinationHistory` opt-out is removed (`deliver-contracts.ts`, `message.ts`, `deliver-core.ts`, its test).
- `docs/refactor/conversation-transcript-ownership.md` describes own-turn by key only.

Production diff: 5 files, net negative.

## User impact

A message the user saw from an automation or another session now lands in the destination chat's model history. A same-chat turn's own final reply still gets no second row. No config, schema, protocol or migration change.

## Evidence

- Red on base, green here: `src/sessions/confirmed-visible-message.integration.test.ts` "records an isolated producer's send despite matching DM routing hints=true". The test that asserted the old "context" skip is deleted.
- No duplicate on the real dispatch path (`src/auto-reply/reply/dispatch-visible-history.integration.test.ts`): Telegram DM with `dmScope` `main` and `per-channel-peer`, Telegram forum topic, Discord channel, Control UI/webchat. Each resolves the same outbound route key as the inbound session, so no key-parity fix was needed.
- Affected consumer tests (30 files) passed locally.
- Real Telegram (Test Server, real model), base `a65ac074b3d6`: the isolated producer's DM arrived once; the DM transcript and the DM agent's next model request did not contain it, and the agent answered with an older reply.
- Real Telegram, head `ee6eed48a208` (same entry point): `gateway call agent` with `sessionKey: agent:main:bedtime-e2e`, `channel: telegram`, `deliver: false`; the agent sent "It's 10:15 pm, time for bed. The amber bookmark can wait until morning." once with the `message` tool. The DM session (`agent:main:main`) then had that text as one assistant row (no duplicate). The user asked "what did you just send me?" and the DM agent answered: "I just sent: “It's 10:15 pm, time for bed. The amber bookmark can wait until morning.”"
- Local ClawSweeper review on `ee6eed48a208`: patch correct, zero findings.
- CI: every check passed except `check-lint-core-5`, which fails on three lint errors in Workboard e2e files from #207839 that are on `main` and not in this diff (#208070; override comment on this PR).

## Not changed here (decision recorded)

Plugin-action settlement (`outbound-send-service.ts` `onHandled`): a base test showed a plugin action that sends through durable delivery and also returns a native receipt can write two destination rows (different `deliveryId`s). Deleting the `onHandled` writer would drop history for third-party handlers that send natively and return only a receipt. Routing those through delivery settlement is a new design, so it is a follow-up, not part of this cut.

## Follow-ups

- Exactly-once native receipt settlement that keeps receipt-only plugin handlers.
- Registry-first destination resolver; sessions not created by inbound must not claim chat addresses (removes the "ambiguous" skip).
- Store the not-recorded reason on the delivery queue row (schema change).
- Route direct channel notices through the owner: Telegram `bot-message.ts`, `dm-access.ts`, native command replies; Discord `native-command-reply.ts`; Signal/Matrix approval handlers.
- Inbound "accepted ⇒ in transcript" for queue drop/summarize paths; failed-delivery and overlap-dedupe history on the agent side.

## Merge risk

Revert restores the old skip. Rows already appended stay.

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix(qa): run the live log tail browser test again (#208020)

Point the live log tail scenario at the consolidated auto-follow browser test.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 34b4a470-dfdd-48fb-aaba-59aec526e812

* fix: check managed child delivery in the Codex live suite (#208011)

Check that the parent receives the UUID chosen by its managed child. Let the Docker live suite use the Gateway's delegation defaults.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 7f1bb837-8d14-46f3-82e5-8aa559e33b3e

* improve: speed up Doctor database repair tests (#208103)

Build the healthy migrated agent database once for the repair guard table. Give each case an independent file, registry, and maintenance lease so it still exercises the real defect, repair, and clean recheck.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: f5bae5e0-5d87-4d07-9178-2e4ab0ca2637

* fix(gateway): keep count-path session updates through store discovery (#208004)

## Problem

Scheduled CI kept failing `session-message-events.history-worker.test.ts` (count case, "after worker overload"): 5 of 15 scheduled runs, most recently run 46220607204. After #207862 the case waits the full 120 s test limit, so the event was missing, not late.

A traced CI sample (PR CI, Linux x64, Bun) showed the stop: after the transcript update, the count publication never reached `readSessionMessageCountAsync`, and a `chat.metadata.changed` from a session-store topology change arrived in the same window. A local repro then showed the cause:

```
Error: Session row facts require worker reconciliation
    at readSessionRowEntry (src/gateway/session-row-projection-materialize.ts:460)
    ...
    at selectSessionRowEntries (src/gateway/session-row-scope.ts:551)
```

`handleTranscriptUpdateBroadcast` (`src/gateway/server-session-events.ts`) assigns a cursor sequence to updates that arrive without `messageSeq`. To do that it prepared membership with its own loop and then called `projection.selectEntries()` synchronously. When store discovery runs inside that loop, the row's entry is still unread, so selection throws `SessionRowFactsPending`. That error means "re-enter through exact worker preparation". The handler did not handle it, so the publication failed and clients got neither `session.message` nor `sessions.changed`. The update was lost until the next refetch.

## Change

The count fallback reads its row through the session event publication rows (`sessionEventPublicationRows(projection).withReadyRows`, metadata only), the same owner `withPreparedEventRow` uses. It reaches `withPreparedExactRows`, which prepares membership and retries `SessionRowFactsPending`. The hand-written `prepareMembership` loop is removed.

Known edge, left as is: other throws before publication still reject the update. Only worker overload turns into a `sessions.changed` invalidation. That is a wider change and is not part of this fix.

## Who sees it

Gateway clients that follow a session (`sessions.messages.subscribe`, for example the Control UI) and receive transcript updates without `messageSeq` (`server-session-events.ts`, count fallback), while session-store topology changes (a store added, removed or rediscovered). One-shot CLI runs do not follow session events and do not see this.

## Evidence

- New test `delivers a count-path session update when the store topology changes`: emits a store topology change, then a transcript update without `messageSeq`. Red on base (120 s timeout, 3 of 3 runs), green with the fix (3 of 3, no memo).
- The CI shape (overload case plus store topology churn): 10 of 10 red on base, green with the fix.
- Existing history-worker overload cases and the session event consumer suites pass.
- What starts the store topology change during the CI run is inferred, not traced. The CI trace shows the publication stopping before the count read, with a `chat.metadata.changed` in the same window. The local repro with an explicit topology change gives the same signature and the stack above.

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix: keep Telegram login tests independent of startup speed (#208106)

Wait for the Telegram progress note before checking lane ownership. Release both fixture gates on assertion failure so a slow login cannot spill into the next test.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 177934d0-1fb5-4a06-beb2-10916a09ee47

* fix(release): identify jobs blocking child evidence sealing

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* fix(release): clarify pinned FRV recovery eligibility

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* fix(ci): add tagged reply control to the PR wrapper inventory (#208120)

* fix(android): keep the snooze deadline test independent of runner timing (#208097)

Advance the handset and Gateway clocks together during the post-save refresh. Check the exact deadline sent to the Gateway and the wake time returned to the handset.

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: 6fb940cc-e4ef-4c8f-94a9-060a736f8c11

* test(process): keep cancel parity off execa's force-kill race (#208126)

## Problem

Scheduled CI run 46234040123 (checks-node-compact-large-42, shard core-runtime-infra-process-hosted-2) failed `src/process/spawn-broker/execa.test.ts > broker command transports > matches buffered cancel results and errors`:

```
-   "isForcefullyTerminated": true,      (direct execa, the reference side)
+   "isForcefullyTerminated": false,     (spawn broker)
    "isCanceled": true, "signal": "SIGTERM"   (both sides)
```

Both sides agree that the command was canceled and that the child exited on SIGTERM. Only the reference side, which calls `execa` directly in the test process, said "forcefully terminated".

Cause: execa starts a `forceKillAfterDelay` timer when it sends SIGTERM (`execa/lib/terminate/kill.js` `killOnTimeout`). If the parent event loop stalls longer than the delay before it reaps the exited child, the timer fires first. `kill('SIGKILL')` then succeeds on the unreaped child and sets `isForcefullyTerminated`, even though the child already exited on SIGTERM. The fixture used a 50 ms delay for every case, so a loaded runner can hit this race.

Reproduced with direct execa 10.2.1, outside the broker: cancel a SIGTERM-honoring child with `forceKillAfterDelay: 50`, then block the event loop for 200 ms in a `setImmediate`. Result 3/3: `signal: "SIGTERM"`, `isCanceled: true`, `isForcefullyTerminated: true`. With no stall, `isForcefullyTerminated` is `false`.

## Change

Test-only. Children that honor SIGTERM get a 5 s force-kill delay, so the timer cannot win the race. These children exit at once, so the tests take no longer. The `forced cancel` case ignores SIGTERM and keeps its 50 ms delay, so it still proves forced termination matches across the broker and direct execa.

## Impact

No product change. Process cancellation results stay correct: in the failing run the broker reported a cancel as a cancel (`isCanceled: true`, `failed: true`). The mismatch was the reference side's timer race.

## Evidence

- CI failure: https://github.com/openclaw/openclaw/actions/runs/46234040123/job/141256229744
- No `src/process` change in the window 84ca43a1..758614e7.
- Before the change: 5/5 green locally with load average ~39 (the race needs a stall over 50 ms).
- After the change: `execa.test.ts` full file 5/5 green, 27 passed, 3 skipped.

Co-authored-by: Ayaan Zaidi <[email protected]>

* test(state): keep schema modules out of read-only agent database access (#185841)

* fix(state): avoid eager writer imports in agent database reads

* test(state): keep schema modules out of read-only agent database access

* chore(release): close out 2026.11.11 on main (#208114)

Co-authored-by: RomneyDa <[email protected]>
Co-authored-by: vincentkoc <[email protected]>

* fix(outbound): record a plugin action's visible send once (#208130)

Follows #208049.

## Problem

A plugin `send` action can write the same visible message into the destination chat's model history twice.

Telegram's action handler sends through `sendDurableMessageBatch`. Durable delivery records the confirmed send (`deliver-core.ts` `recordConfirmedTranscript`, key `outbound-delivery:<queue id>:0`). The handler then returns a native receipt, and `outbound-send-service.ts` `onHandled` records it again (key `outbound-delivery:<deliveryIntentId ?? idempotencyKey ?? uuid>:0`). The two keys differ, so the destination gets two identical assistant rows. The model then sees one message the user saw once as two messages.

On real Telegram the second row appears when the destination resolves without ambiguity, for example when the producer session does not carry a `channel/to` hint for the DM. (In #208049's E2E the producer carried that hint, so the durable write was skipped as "multiple current destinations match" and only one row landed.)

## Fix

One plugin action is one send, recorded once.

- `executeSendAction` runs the plugin action inside `runPluginActionHistoryScope(…)`.
- `commitConfirmedVisibleMessage` (the history owner) marks the scope when it actually adds a row.
- The action's receipt commit (`onHandled`) skips when the scope is marked: the handler's core-delivery send already recorded the message.
- Core delivery keeps its own queue identity for the row, so restart recovery (which re-commits with the queue entry id) still finds the existing row.
- Receipt-only handlers (send natively, no core delivery) are unchanged: nothing marks the scope, and `onHandled` writes their one row.
- If the core-delivery commit is skipped (for example an ambiguous destination), the scope stays unmarked and `onHandled` still writes with the caller's route, as before.

Why a scope and not a new field: `ChannelMessageActionContext` has no delivery identity field, and each plugin forwards context fields to its runtime by hand (Telegram lists them in `channel-actions.ts`). Threading an id would be a new public Plugin SDK field that every third-party handler must forward. The scope reaches any handler that sends through core delivery, with no SDK change. No config, stored state, table or hook.

Review round 1 changed the mechanism: an earlier head replaced the core row's id with the action id, which broke dedupe on restart recovery (recovery commits under the queue entry id). This head keeps the queue id.

## User impact

A message sent through a plugin action (Telegram `message` tool sends, for example) appears once in the receiving chat's model history, exactly as delivered. No config, schema, protocol, stored-row or SDK change.

## Evidence

- Red on base, green here: `src/infra/outbound/outbound-send-service.integration.test.ts` "records a plugin action's durable send in destination history once" (base: two identical rows).
- Stays green: "records a receipt-only plugin action in destination history once".
- Consumer tests: 19 files passed locally (one `ocx test` set, vitest-source): the new test, `outbound-send-service{,.accepted-outcomes}.test.ts` (their module mocks now pass the scope through), `deliver.test.ts`, `deliver-confirmed-visible.test.ts`, `delivery-queue.transcript.test.ts`, `confirmed-visible-message.integration.test.ts`, `message-action-send{,.core,.media,.mirror-order,.validation}.test.ts`, subagent announce delivery/mirror tests, Telegram `action-runtime.test.ts` + `channel-actions.contract.test.ts`, Discord `actions/runtime.test.ts`, Slack `action-runtime.test.ts`, `test/qa-channel-message-tool-delivery.test.ts`.
- Real Telegram (Test Server, source Gateway) on head `c33cd7f46b40`: the DM user first got a reply ("READY"), so the DM session existed. Then `gateway call agent` ran with an isolated `sessionKey`, `deliver: false` and no `channel`/`to` hints. Its `message` tool sent one marker DM to the user. Results: the recorder saw 1 marker message, and the DM session (`agent:main:main`) had 1 assistant row for it. That row's key is the core-delivery queue id (`outbound-delivery:<uuid>:0`), so the handler's durable write recorded it and the receipt commit skipped. The Gateway logged no "multiple current destinations match" line, so the run took the path that wrote two rows before this fix. The model fixture was deterministic, so the tool call was predictable. Telegram transport and transcript were real.
- Local review: round 1 found the recovery-identity problem described above (fixed). Round 2 on `c33cd7f46b40`: patch correct, no findings.
- Rebased on main to pick up #208120: the base had #207738 without its PR-wrapper inventory fix, so `test/scripts/eager-import-closure.test.ts` was red.

## Follow-ups (out of scope)

- Registry-first destination resolver; remove the "ambiguous" skip.
- Store the not-recorded reason on the delivery queue row (schema change).
- Route direct channel notices through the history owner.
- Inbound "accepted ⇒ in transcript" guarantees.
- Failed-delivery history.

## Merge risk

Two-way door. Revert restores the duplicate row. No stored format change; the idempotency key format is the same, only which id fills it inside a plugin action. Blast radius: plugin-action sends that also go through core delivery (Telegram today).

Co-authored-by: Ayaan Zaidi <[email protected]>

* fix: let a fallback model finish after Code Mode reads

Allow the configured fallback model to finish after a completed Code Mode cell when every host call has a successful read receipt and qualifies for direct retry. Shell writes, unfinished cells and plugin lookups without an audited replay classification still block fallback.

Closes #207895

Co-authored-by: daniel-lxs <[email protected]>
OpenClaw-Publication: d49db423-f997-43b6-b23c-4d0be08459c0

* fix: let older automations read their conversation's memory (#208143)

## What Problem This Solves

Automations created before OpenClaw recorded the creating conversation (every job without `sourceConversation`, i.e. created before #179062) name that conversation only by session key. Their scheduled runs get no memory at all: every `knowledge_*` or memory tool call fails with "the host granted this session no memory audience", and the Gateway logs `memory audience unavailable: root session agent:<agent>:cron:<job>:run:<run> has no durable chat type`. The same runs still hold owner-only tools such as `exec`. A production automation that reads and writes the owner's knowledge vault every week hit this on every run.

## User Impact

- A key-only detached automation (`isolated` / `current`) now reads its conversation's current memory, the same way a bound automation does:
  - created in the owner's direct chat: the owner's private memory;
  - created in a group or channel: only that conversation's memory, never owner-private.
- When the job recorded a requester (profile or channel sender), that requester's owner status is checked at each occurrence first; without one, the run's existing owner bit decides, as it already does for the run's tools.
- If the conversation row is gone, archived or cannot be read, the run proceeds exactly as before (no memory, no pause, no failure).
- Board, workspace, sandbox, event target and the run's tools are unchanged. `main` and `session:<key>` targets are unchanged.
- `automations bind` stays available for the exact-incarnation link but is no longer needed for memory. Docs (`cli/cron` "Binding older jobs", `automation/cron-jobs/payloads`) and Doctor's unbound note say so.

Accepted edge case: a key-only run whose agent sandbox mode is `non-main` or `all` now gets owner-private memory it did not have, when the job was created in the owner's direct chat. The owner created these jobs in their own DM, and the run already holds owner authority.

## Why This Change Was Made

`resolveScheduledPrincipal` classifies these jobs as `unbound-parent` and gives them legacy owner authority, but `buildScheduledExecutionContext` pointed their memory at the cron run row, which never has a chat type, so the memory resolver always denied. The fix stays in the existing owner:

- `admitScheduledOccurrence` (`src/cron/execution-context-admission.ts`): for an `unbound-parent` principal on a detached run, read the key-linked conversation row once. A failed read becomes "no row". No generation lease, workspace binding, sandbox or pause change. A recorded requester is admitted per occurrence through the existing `admitScheduledRequesterGrant`.
- `buildScheduledExecutionContext` (`src/cron/execution-context.ts`): with a live row, memory becomes `{ source: "parent", parent: <current sessionKey/sessionId/lifecycleRevision>, owner }`. Everything else for `unbound-parent` is unchanged.
- The memory resolver (`src/plugins/memory-audience.ts`) does not change: it already maps a direct root + owner to owner-private and direct/group/channel to that conversation's partition, for both the embedded and the CLI runtime.
- `scheduledParentKeyOf` now derives the key from `resolveScheduledPrincipal` itself, so Doctor's access review and the development replay read the same row the runtime does; the replay vector (`execution-context-projection.ts`) already labels the memory gain as intended, so it needed no edit.

Not changed: Doctor auto-bind or any stored-row write, jobs with no parent key, bound jobs with no recorded requester. On current `main`, bound jobs keep following their conversation after a reset (#205887), so no reset-degraded path exists to special-case.

## Evidence

Real-admission tests (red on the merge base `bb5c001bb6fc`, green on this head; 6 tests failed on base, all pass on head):

- `execution-context-memory-audience.test.ts` (real admission → registry → embedded and CLI resolvers): key-only owner-DM job → owner-private; key-only group job → that group's conversation only; key-only job with a revoked recorded requester → conversation only; key-only job whose conversation is gone → no audience, run admitted.
- `execution-context.test.ts`: key-only detached job gets parent memory and nothing else (board/workspace/sandbox stay the run's); archived, removed and in-session (`session:<key>`) cases keep run-session memory.
- `execution-context-admission.test.ts`: key-only read takes no generation lease; a failed read still admits the run with its own memory.
- `isolated-agent/run.bind-parent.test.ts` (real cron service + timer): the unbound job now reaches its conversation's memory, without a run-row receipt.

Local runs: the 27 test files that import the changed sources passed (`ocx test`, 6 shards). `pnpm check:changed`: typecheck, lint, guards all ok; the dead-export scan fails only on files this PR does not touch (`src/agents/command/types.ts`, `src/plugins/native-module-require.ts`, `ui/src/...`, `src/gateway/server-methods/update.test-harness.ts`), same as `main`.

End to end, scratch Gateway from source, `plugins.slots.memory: "knowledge"`, real model (`openai/gpt-5.5`). An owner Control UI direct chat was created by one real `chat.send` (row `chatType: "direct"`). A key-only isolated `agentTurn` job (owner key = that chat, no `sourceConversation`, no recorded requester, no tool policy, `toolsAllow` incl. `knowledge_remember`, `knowledge_grep`, `exec`) fired from its own `at` schedule about two minutes ahead (no forced run).

Base (`bb5c001bb6fc`):

```
[agent/embedded] memory audience unavailable: root session agent:main:cron:<job>:run:<run> has no durable chat type
```
```
knowledge_remember: "Knowledge access unavailable: the host granted this session no memory audience. The Gateway log entry "memory_audience_denied" for this session names the reas…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. size: L status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant