Skip to content

Commit ff4b779

Browse files
committed
Merge remote-tracking branch 'origin/main' into agent/fix-memory-dreaming-startup-reconcile-recovery
2 parents 3fea8d2 + 4f6fc38 commit ff4b779

197 files changed

Lines changed: 9858 additions & 1927 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/workflows/docs-external-links.yml‎

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,21 @@ jobs:
2222
with:
2323
persist-credentials: false
2424

25+
- name: Setup Node.js and pnpm
26+
uses: ./.github/actions/setup-node-env
27+
with:
28+
install-bun: "false"
29+
install-deps: "false"
30+
31+
- name: Install link audit dependencies
32+
run: pnpm install --filter . --frozen-lockfile --ignore-scripts
33+
34+
- name: Prepare MDX link audit input
35+
run: >-
36+
node scripts/docs-link-audit.mjs
37+
--prepare-external-links
38+
.artifacts/docs-external-links/mdx
39+
2540
- name: Audit external links
2641
uses: lycheeverse/lychee-action@e7477775783ea5526144ba13e8db5eec57747ce8 # v2.9.0
2742
with:
@@ -45,11 +60,45 @@ jobs:
4560
'./docs/**/*.md'
4661
'./docs/**/*.mdx'
4762
'./docs/docs.json'
63+
'./.artifacts/docs-external-links/mdx/**/*.md'
64+
'./.artifacts/docs-external-links/mdx/**/*.mdx'
4865
fail: false
4966
failIfEmpty: true
5067
format: markdown
5168
output: .artifacts/docs-external-links/report.md
5269

70+
# The main pass follows redirects. This pass stops at the first response
71+
# so permanent moves remain visible without flagging temporary redirects.
72+
- name: Report permanent redirects
73+
if: always()
74+
continue-on-error: true
75+
run: >-
76+
lychee
77+
--no-progress
78+
--base-url https://docs.openclaw.ai
79+
--exclude-all-private
80+
--accept '100..=300,302..=307,309..=599'
81+
--accept-timeouts
82+
--max-retries 2
83+
--retry-wait-time 2
84+
--timeout 20
85+
--max-redirects 0
86+
--scheme http
87+
--scheme https
88+
--exclude '^https://docs\.openclaw\.ai/'
89+
--exclude '^https://github\.com/openclaw/maintainers/'
90+
--exclude '^https://(claude\.ai|help\.openai\.com|openai\.com|platform\.openai\.com|support\.discord\.com|www\.npmjs\.com|www\.raspberrypi\.com)/'
91+
--format markdown
92+
--output .artifacts/docs-external-links/permanent-redirects.md
93+
'./README.md'
94+
'./CONTRIBUTING.md'
95+
'./SECURITY.md'
96+
'./docs/**/*.md'
97+
'./docs/**/*.mdx'
98+
'./docs/docs.json'
99+
'./.artifacts/docs-external-links/mdx/**/*.md'
100+
'./.artifacts/docs-external-links/mdx/**/*.mdx'
101+
53102
- name: Upload audit report
54103
if: always()
55104
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7

‎.github/workflows/openclaw-live-and-e2e-checks-reusable.yml‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2000,7 +2000,11 @@ jobs:
20002000
if: steps.plan.outputs.needs_package == '1' && inputs.package_artifact_id != ''
20012001
env:
20022002
CI: "true"
2003-
run: pnpm --dir .release-harness install --frozen-lockfile --prefer-offline --ignore-scripts
2003+
# Corepack resolves packageManager from the process cwd before pnpm can
2004+
# process --dir. Keep this in the trusted harness so a frozen candidate
2005+
# pin cannot select a different pnpm binary for its harness install.
2006+
working-directory: .release-harness
2007+
run: pnpm install --frozen-lockfile --prefer-offline --ignore-scripts
20042008

20052009
- name: Validate OpenClaw package artifact identity
20062010
id: input_package_artifact

‎docs/cli/memory.md‎

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
summary: "CLI reference for `openclaw memory` (status/index/search/promote/promote-explain/rem-harness/rem-backfill)"
2+
summary: "CLI reference for `openclaw memory` (status/index/search/promote/promote-explain/rem-harness/rem-backfill/session-backfill)"
33
read_when:
44
- You want to index or search semantic memory
55
- You're debugging memory availability or indexing
@@ -139,6 +139,50 @@ openclaw memory rem-backfill --rollback [--rollback-short-term] [--json]
139139
- `--rollback-short-term`: remove previously staged grounded short-term
140140
candidates.
141141

142+
## `memory session-backfill`
143+
144+
Distill retained session history through the same provenance and short-term
145+
staging pipeline used by dreaming. The default is a read-only preview, ordered
146+
from the oldest unprocessed day to the newest.
147+
148+
```bash
149+
openclaw memory session-backfill --agent <id> [--from YYYY-MM-DD] [--to YYYY-MM-DD] \
150+
[--limit-days <n>] [--archive-files <path...>] [--rem | --apply] [--json]
151+
openclaw memory session-backfill --agent <id> --rollback [--json]
152+
```
153+
154+
| Flag | Default | Effect |
155+
| --------------------------- | ------------ | ------------------------------------------------------------------------------------------------------------- |
156+
| `--from YYYY-MM-DD` | | Include messages on or after this day in the dreaming timezone. |
157+
| `--to YYYY-MM-DD` | | Include messages on or before this day in the dreaming timezone. |
158+
| `--limit-days <n>` | `92` | Process at most this many hash-untracked days, oldest first. |
159+
| `--archive-files <path...>` | | Also inspect foreign transcript files as untrusted input; embedded owner metadata is not accepted. |
160+
| `--rem` | | Write deterministic grounded per-day previews to `DREAMS.md` only. |
161+
| `--apply` | preview only | Stage trusted candidates and write reversible `DREAMS.md` diary blocks. |
162+
| `--rollback` | | Remove all grounded backfill candidates and shared backfill diary blocks, including `rem-backfill` artifacts. |
163+
| `--json` | | Print machine-readable per-day counts and top candidates. |
164+
165+
The command reads the selected agent's canonical session store, including
166+
retained SQLite transcript identities from session rotation. It uses the same
167+
tracked message hashes and per-run caps as live session ingestion, so repeated
168+
`--apply` runs skip already ingested messages. Owner and agent lines from the
169+
canonical store are eligible; tool output, web or non-owner input, and turns
170+
without trustworthy owner provenance are excluded. Foreign archive files have
171+
no authenticated owner-provenance contract, so their embedded ownership fields
172+
remain untrusted and cannot be staged.
173+
174+
`--apply` writes only the session corpus under `memory/.dreams/`, short-term
175+
staging state, and reversible diary entries in `DREAMS.md`. It never writes
176+
`MEMORY.md` or `USER.md`; durable promotion remains a separate `memory promote`
177+
or dreaming decision. `--rem` and `--apply` are mutually exclusive.
178+
179+
Backfill rollback is intentionally shared with `memory rem-backfill`: both
180+
commands use the same grounded-only staging class and diary markers. Run
181+
`session-backfill --rollback` only when you intend to clear both commands'
182+
grounded backfill artifacts from that workspace. Rollback preserves transcript
183+
ingestion cursors and tracked message hashes, so removed messages are not
184+
automatically re-ingested.
185+
142186
## Dreaming
143187

144188
Dreaming is the background memory consolidation system with three cooperative

‎docs/concepts/dreaming.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,25 @@ There is also a grounded historical backfill lane for review and recovery work:
112112
- `memory rem-backfill --path ...` writes reversible grounded diary entries into `DREAMS.md`.
113113
- `memory rem-backfill --path ... --stage-short-term` stages grounded durable candidates into the same short-term evidence store the normal deep phase uses.
114114
- `memory rem-backfill --rollback` and `--rollback-short-term` remove those staged backfill artifacts without touching ordinary diary entries or live short-term recall.
115+
- `memory session-backfill --agent <id>` previews trusted candidates from the agent's retained session history, oldest unprocessed day first.
116+
- `memory session-backfill --agent <id> --apply` stages those candidates through the normal short-term store and writes reversible diary blocks without changing `MEMORY.md` or `USER.md`.
117+
- `memory session-backfill --agent <id> --rem` writes a deterministic grounded preview per day to `DREAMS.md` without staging candidates or calling a model.
118+
- `memory session-backfill --agent <id> --rollback` clears the shared grounded backfill candidates and diary blocks, including artifacts created by `rem-backfill`.
115119

116120
</Accordion>
117121
</AccordionGroup>
118122

123+
Session backfill uses canonical retained transcript identities, including
124+
sessions preserved across rotation. Messages are bucketed in the configured
125+
dreaming timezone and share live ingestion's tracked message hashes and signal
126+
caps, so bounded reruns continue forward without re-ingesting prior messages.
127+
Rollback removes generated artifacts but retains those ingestion checkpoints.
128+
Foreign files supplied with `--archive-files` are treated conservatively. Their
129+
embedded ownership fields are caller-controlled and therefore remain untrusted;
130+
without an authenticated provenance contract, they cannot enter short-term
131+
staging. Tool output, web content, and non-owner turns are excluded from the
132+
canonical session path as well.
133+
119134
The Control UI exposes the same diary backfill/reset flow on the agent's Memory tab (Agents page) so you can inspect results in the dream scene before deciding whether grounded candidates deserve promotion. A distinct grounded Scene lane shows which staged short-term entries came from historical replay, which promoted items were grounded-led, and lets you clear only grounded-only staged entries without touching live short-term state.
120135

121136
## Deep ranking signals

‎docs/docs_map.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,6 +1757,7 @@ Do not edit it by hand; run `pnpm docs:map:gen`.
17571757
- H2: memory promote-explain
17581758
- H2: memory rem-harness
17591759
- H2: memory rem-backfill
1760+
- H2: memory session-backfill
17601761
- H2: Dreaming
17611762
- H2: SecretRef gateway dependency
17621763
- H2: Related

‎docs/providers/mistral.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ OpenClaw defaults Mistral realtime STT to `pcm_mulaw` at 8 kHz so Voice Call can
147147

148148
<AccordionGroup>
149149
<Accordion title="Adjustable reasoning">
150-
`mistral/mistral-small-latest`, `mistral/mistral-small-2603`, and `mistral/mistral-medium-3-5` support [adjustable reasoning](https://docs.mistral.ai/studio-api/conversations/reasoning/adjustable) on the Chat Completions API via `reasoning_effort` (`none` minimizes extra thinking in the output; `high` surfaces full thinking traces before the final answer).
150+
`mistral/mistral-small-latest`, `mistral/mistral-small-2603`, and `mistral/mistral-medium-3-5` support [adjustable reasoning](https://docs.mistral.ai/studio-api/conversations/reasoning) on the Chat Completions API via `reasoning_effort` (`none` minimizes extra thinking in the output; `high` surfaces full thinking traces before the final answer).
151151

152152
OpenClaw maps the session **thinking** level to Mistral's API:
153153

‎docs/tools/browser.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,11 @@ The agent gets **one tool** for browser automation:
922922
How it maps:
923923

924924
- `browser snapshot` returns a stable UI tree (AI or ARIA).
925+
- `browser navigate` also returns the loaded page's snapshot inline (efficient
926+
interactive tier, so the payload stays compact and bounded), so the agent
927+
does not need a follow-up snapshot call. Batch `act` results that report a
928+
cross-document navigation include the same fresh page state. Navigations
929+
that resolve to a download skip it.
925930
- `browser act` uses the snapshot `ref` IDs to click/type/drag/select.
926931
- `browser screenshot` captures pixels (full page, element, or labeled refs).
927932
- `browser doctor` checks Gateway, plugin, profile, browser, and tab readiness.

‎docs/tools/code-mode.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ Bundled provider catalogs currently flag these models as `"preferred"`:
300300
| anthropic | `claude-fable-5`, `claude-opus-5`, `claude-sonnet-5`, `claude-mythos-5`, `claude-opus-4-8`, `claude-haiku-4-5` |
301301
| deepseek | `deepseek-v4-pro`, `deepseek-v4-flash` |
302302
| google | `gemini-3-flash-preview`, `gemini-3.1-pro-preview`, `gemini-3.1-flash-lite`, `gemini-3.5-flash`, `gemini-3.5-flash-lite`, `gemini-3.6-flash` |
303+
| kimi | `k3`, `k3-256k` |
303304
| minimax | `MiniMax-M3` |
304305
| moonshot | `kimi-k3` |
305306
| openai | `gpt-5.6`, `gpt-5.6-sol`, `gpt-5.6-terra`, `gpt-5.6-luna`, `gpt-5.5`, `gpt-5.5-pro` |

‎extensions/browser/skills/browser-automation/SKILL.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ Use this skill when you need the `browser` tool for anything beyond a single pag
3434
- Use `labels=true` on snapshot or screenshot when visual position matters. On Playwright-backed profiles, the response includes an `annotations` array (`{ref, number, role, name?, box}`) with each ref's bounding box in the captured image's coordinate space, so you can reason about position without re-snapshotting; screenshot labels can also combine with `fullPage=true` (CLI: `--full-page`) to label the whole document, or `ref` / `element` to clip to one element. `profile="user"` and other existing-session (chrome-mcp) profiles render an overlay into page screenshots but do not attach `annotations` or use the Playwright full-page/ref/element projection helper, so read positions from the labeled image itself on those profiles. The raw-CDP fallback (no Playwright) does not support labeled screenshots at all and returns a 501, so only request `labels` when Playwright is available.
3535
4. Act narrowly:
3636
- Prefer `action="act"` with a ref from the latest snapshot.
37-
- After navigation, modal changes, or form submission, snapshot again before the next action.
37+
- `navigate` returns the loaded page's compact snapshot inline, and batch `act` results that report a cross-document navigation include fresh page state; use those refs directly instead of a follow-up snapshot call.
38+
- After a single act that triggers navigation, and after modal changes or form submissions, snapshot again before the next action.
3839
- Avoid blind waits. Wait for visible UI state when possible.
3940
5. Report real blockers:
4041
- If the page needs login, permission, captcha, 2FA, camera/microphone approval, or another manual step, stop and tell the user exactly what is needed.

‎extensions/browser/src/browser-extract.ts‎

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
readStringValue,
1111
wrapExternalContent,
1212
} from "./browser-tool.runtime.js";
13+
import type { BrowserProxyRequest } from "./browser-tool.snapshot.js";
1314
import {
1415
BROWSER_EXTRACT_MAX_CHARS,
1516
BROWSER_EXTRACT_TRUNCATION_MARKER,
@@ -49,15 +50,6 @@ type BrowserExtractDeps = BrowserExtractCompletionDeps & {
4950
browserPageContent: typeof browserPageContent;
5051
};
5152

52-
type BrowserProxyRequest = (opts: {
53-
method: string;
54-
path: string;
55-
body?: unknown;
56-
timeoutMs?: number;
57-
profile?: string;
58-
signal?: AbortSignal;
59-
}) => Promise<unknown>;
60-
6153
export function resolveBrowserExtractTimeoutMs(input: Record<string, unknown>): number {
6254
const requested = readPositiveIntegerParam(input, "timeoutMs", {
6355
message: "timeoutMs must be a positive integer.",

0 commit comments

Comments
 (0)