50 Commits

Author SHA1 Message Date
Peter Steinberger
538605ff44 [codex] Extract filesystem safety primitives (#77918)
* refactor: extract filesystem safety primitives

* refactor: use fs-safe for file access helpers

* refactor: reuse fs-safe for media reads

* refactor: use fs-safe for image reads

* refactor: reuse fs-safe in qqbot media opener

* refactor: reuse fs-safe for local media checks

* refactor: consume cleaner fs-safe api

* refactor: align fs-safe json option names

* fix: preserve fs-safe migration contracts

* refactor: use fs-safe primitive subpaths

* refactor: use grouped fs-safe subpaths

* refactor: align fs-safe api usage

* refactor: adapt private state store api

* chore: refresh proof gate

* refactor: follow fs-safe json api split

* refactor: follow reduced fs-safe surface

* build: default fs-safe python helper off

* fix: preserve fs-safe plugin sdk aliases

* refactor: consolidate fs-safe usage

* refactor: unify fs-safe store usage

* refactor: trim fs-safe temp workspace usage

* refactor: hide low-level fs-safe primitives

* build: use published fs-safe package

* fix: preserve outbound recovery durability after rebase

* chore: refresh pr checks
2026-05-06 02:15:17 +01:00
Peter Steinberger
093b2b9b5f test: speed extension and contract scenarios 2026-05-06 00:54:06 +01:00
hcl
d0cae0d950 fix(active-memory): skip sub-agent gracefully when no memory tools registered (#77506) (#77515)
* fix(active-memory): skip sub-agent gracefully when no memory tools registered (#77506)

When memory-core and memory-lancedb are both absent, the embedded
memory sub-agent would throw 'No callable tools remain after resolving
explicit tool allowlist', which propagated as a noisy warning through
the before_prompt_build hook. Catch this specific error in
runActiveMemorySubAgent and return an empty NONE result so the
gateway log stays clean and the sub-agent run is skipped without
disrupting the parent session.

* fix(active-memory): skip missing memory-tool subagent runs

* fix(active-memory): match inherited missing memory tool errors

* fix(active-memory): preserve policy-filtered memory errors

---------

Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
2026-05-04 16:47:38 -05:00
Vincent Koc
59b5058cdb fix(active-memory): stabilize timeout partial recovery 2026-05-04 13:56:12 -07:00
Syu
f2efe33afc Fix Active Memory memory-only recall latency (#75200)
Summary:
- The PR adds a bounded latest-message search-query section to Active Memory recall prompts, regression coverage for metadata stripping, a changelog entry, and pending-final-delivery session slot reservations.
- Reproducibility: yes. for a source-level reproduction path: an eligible interactive turn reaches Active Memo ... om current releases, but I did not run a live gateway/provider reproduction under the read-only constraint.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fix(plugins): reserve final delivery session slots

Validation:
- ClawSweeper review passed for head 24bf408e75.
- Required merge gates passed before the squash merge.

Prepared head SHA: 24bf408e75
Review: https://github.com/openclaw/openclaw/pull/75200#issuecomment-4354978044

Co-authored-by: SYU8384 <zhuqimo@gmail.com>
2026-05-04 20:05:15 +00:00
hcl
dff437a1cb fix(active-memory): skip colon-containing session-store channels to prevent crash with QQ c2c agent IDs (#77402)
Summary:
- The PR filters colon-containing store-derived Active Memory channel values before embedded recall resolution, adds a QQ c2c regression test, and records the user-facing changelog entry.
- Reproducibility: yes. Source inspection on current main shows a stored colon-containing `lastChannel` or `ch ... come the strong embedded recall channel, and the downstream bundled-plugin directory validator rejects `:`.

Automerge notes:
- PR branch already contained follow-up commit before automerge: fixup! fix(active-memory): add changelog contributor credit (clawswee…
- PR branch already contained follow-up commit before automerge: fix(active-memory): skip colon-containing session-store channels

Validation:
- ClawSweeper review passed for head 4bf00dd6ac.
- Required merge gates passed before the squash merge.

Prepared head SHA: 4bf00dd6ac
Review: https://github.com/openclaw/openclaw/pull/77402#issuecomment-4372618783

Co-authored-by: HCL <chenglunhu@gmail.com>
Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
2026-05-04 18:37:05 +00:00
hcl
081f873162 fix(active-memory): skip scoped topic channelId for embedded recall run in Telegram forum topics (#76704) (openclaw#76719)
Verified:
- pnpm install --frozen-lockfile
- pnpm test extensions/active-memory/index.test.ts
- pnpm exec oxfmt --check --threads=1 extensions/active-memory/index.ts extensions/active-memory/index.test.ts CHANGELOG.md
- git diff --check origin/main..HEAD

Co-authored-by: hclsys <7755017+hclsys@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
2026-05-03 10:19:32 -05:00
Peter Steinberger
9e56cfcc35 perf(gateway): cache startup metadata probes 2026-05-03 16:07:06 +01:00
volcano303
1d657b9d5f fix(active-memory): preserve setup grace for embedded recall
Apply setupGraceTimeoutMs to the embedded recall runner as well as the outer Active Memory watchdog.

Co-authored-by: volcano303 <75143900+volcano303@users.noreply.github.com>
2026-05-03 12:41:19 +01:00
clawsweeper[bot]
ae82a39150 fix(active-memory): fast-fail stalled recall paths (#76183)
Summary:
- This PR adds Active Memory transcript polling to fast-fail terminal zero-hit or unavailable recall tool results, filters timeout boilerplate, extends focused regressions, and adds a changelog fix entry.
- Reproducibility: yes. The PR includes focused regressions that reproduce terminal zero-hit search, unavailab ... rch, non-empty `details.results` with `debug.hits: 0`, memory_get misses, and timeout boilerplate behavior.

ClawSweeper fixups:
- Included follow-up commit: fix(active-memory): fast-fail stalled recall paths
- Included follow-up commit: fix(clawsweeper): address review for automerge-openclaw-openclaw-7576…
- Included follow-up commit: fix(clawsweeper): reconcile automerge-openclaw-openclaw-75761 with ma…
- Ran the ClawSweeper repair loop before final review.

Validation:
- ClawSweeper review passed for head e5ea3f1a7a.
- Required merge gates passed before the squash merge.

Prepared head SHA: e5ea3f1a7a
Review: https://github.com/openclaw/openclaw/pull/76183#issuecomment-4364369591

Co-authored-by: clawsweeper <274271284+clawsweeper[bot]@users.noreply.github.com>
Co-authored-by: codexGW <9350182+codexGW@users.noreply.github.com>
2026-05-02 22:23:02 +00:00
Peter Steinberger
59449d7f19 fix(active-memory): make setup grace explicit 2026-05-02 07:27:01 +01:00
Vyctor Huggo Przozwski
eabab1f64f fix(active-memory): expose memory tools to recall runs (#74592)
Fix Active Memory recall runs so plugin tool allowlists from composed Memory Core agents flow into embedded tool execution, restoring callable memory plugin tools during recall.\n\nCo-authored-by: vyctorbrzezowski <vyctorbrzezowski@users.noreply.github.com>
2026-05-01 05:48:59 +01:00
jeffrey701
c894dbf0ae fix(active-memory): clarify modelFallbackPolicy deprecation warning text
Closes #74587. AI-assisted, fully tested.

The previous deprecation warning ("set config.modelFallback explicitly
if you want a fallback model") read naturally as runtime failover —
model A errors → switch to model B. The actual semantics in
`getModelRef` are different: `modelFallback` is the **last candidate
in the chain-resolution walk**, consulted only when `config.model`,
the current run's model, AND the agent's configured default have all
resolved to nothing. There is no error-recovery / retry-with-different-model
path.

The mismatch wastes real debug time. The issue filer reports ~1 hour of
cycles before reading source revealed the gap; users without source
access can debug for much longer assuming runtime failover exists.

## Fix

Rewrite the warning string to:

1. State the deprecation (preserved).
2. Describe `modelFallback`'s actual semantics — chain-resolution
   last-resort, gated on the three earlier candidates resolving to
   nothing.
3. Explicitly disclaim the wrong mental model — "it is NOT a runtime
   failover that substitutes a different model when the resolved model
   errors out" — so a quick read can't lead the operator astray.

No behavior change, only operator-facing copy. Surrounding code paths
(`getModelRef`, `hasDeprecatedModelFallbackPolicy`, the warn caller in
`register()`) are untouched.

## Tests

`extensions/active-memory/index.test.ts` extends the existing
deprecation-warning assertion to pin both the positive copy
(`chain-resolution`, `last-resort`) and the negative disclaimer
(`NOT a runtime failover`), so a future "let's reword this" change
that reintroduces the failover-implying language fails the test
instead of silently regressing.

`pnpm test extensions/active-memory/index.test.ts` — 94 passed.
`pnpm exec oxfmt --check` — clean. `pnpm exec oxlint` — 0 warnings,
0 errors.

## AI-assisted PR

- [x] Mark as AI-assisted (Claude). Lightly tested via the targeted
  Vitest extension shard; not exercised against a live Ollama / AM
  rollout because the change is a log-string update, not behavior.
- [x] Confirm I understand what the code does: yes — `getModelRef`
  walks four candidates (`config.model`, `currentRunModel`,
  `configuredDefaultModel`, `config.modelFallback`) and returns the
  first non-null parse; `modelFallback` is purely a default-when-empty
  selector, not a runtime failover.
2026-04-30 05:17:27 +01:00
Logan Ye
89cd2b6362 feat(active-memory): add timeout circuit breaker to skip recall after consecutive failures (#74054) (#74158) 2026-04-29 07:18:43 -04:00
Vincent Koc
df9d26eb43 fix(active-memory): narrow prompt hook timeout 2026-04-28 19:00:14 -07:00
Harry Xie
891c7d9f1c fix(active-memory): align recall timeout with hook runner
Fixes #72606.
2026-04-28 10:15:01 -05:00
Tak Hoffman
f256eeba43 fix(active-memory): use bundled recall tool
Fixes #73502.

Active Memory now allows its hidden recall sub-agent to use both bundled memory tool contracts: memory_recall for memory-lancedb and memory_search/memory_get for memory-core. The prompt prefers memory_recall when available and falls back to the legacy tool pair when that is the active backend surface.

Also updates Active Memory docs, QA mock fixtures, and debug parsing compatibility for the two recall paths.
2026-04-28 09:03:47 -05:00
Joseph Krug
16906780fd feat(active-memory): return partial transcript on timeout (openclaw#73219)
Verified:
- pnpm test extensions/active-memory/index.test.ts
- pnpm exec oxfmt --check --threads=1 extensions/active-memory/index.ts extensions/active-memory/index.test.ts CHANGELOG.md
- git diff --check

Co-authored-by: joeykrug <5925937+joeykrug@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
2026-04-28 08:44:46 -05:00
Lidang Jiang
6d539db011 fix: support explicit active-memory chat types (openclaw#66285)
Verified:
- pnpm install --frozen-lockfile
- pnpm test extensions/active-memory/config.test.ts extensions/active-memory/index.test.ts
- pnpm exec oxfmt --check --threads=1 CHANGELOG.md extensions/active-memory/index.ts extensions/active-memory/index.test.ts extensions/active-memory/config.test.ts extensions/active-memory/openclaw.plugin.json
- git diff --check

Co-authored-by: Lidang-Jiang <119769478+Lidang-Jiang@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
2026-04-28 08:43:06 -05:00
quengh
373e7fc242 feat(active-memory): add allowedChatIds/deniedChatIds per-conversation filters (openclaw#67977)
Verified:
- pnpm install --frozen-lockfile
- git diff --check
- pnpm exec oxfmt --check --threads=1 extensions/active-memory/index.ts extensions/active-memory/index.test.ts docs/concepts/active-memory.md CHANGELOG.md
- OPENCLAW_TEST_HEAVY_CHECK_LOCK_HELD=1 OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=.vitest-cache-pr67977 pnpm test extensions/active-memory/index.test.ts extensions/active-memory/config.test.ts
- gh pr checks 67977 --repo openclaw/openclaw --required

Co-authored-by: quengh <3940773+quengh@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
2026-04-28 08:37:55 -05:00
SimbaKingjoe
bdb75bd8c7 fix(active-memory): skip payload-less memory_search toolResults in tr… (openclaw#68773)
Verified:
- pnpm install --frozen-lockfile
- pnpm test extensions/active-memory/index.test.ts
- pnpm exec oxfmt --check --threads=1 extensions/active-memory/index.ts extensions/active-memory/index.test.ts CHANGELOG.md
- git diff --check origin/main..HEAD
- gh pr checks 68773 --repo openclaw/openclaw --required

Co-authored-by: SimbaKingjoe <126222269+SimbaKingjoe@users.noreply.github.com>
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
2026-04-28 08:20:13 -05:00
Peter Steinberger
f3191b7962 fix(agents): abort stalled Anthropic SSE reads 2026-04-28 09:00:37 +01:00
Peter Steinberger
4336a7f3a9 refactor(plugin-sdk): narrow config runtime imports 2026-04-27 14:58:32 +01:00
Peter Steinberger
7f3f108521 refactor(config): migrate plugin config access 2026-04-27 12:35:58 +01:00
Yao
fbefbf05bd fix(active-memory): enforce timeoutMs as hard deadline via Promise.race (#71687)
Wrap runRecallSubagent() with Promise.race so maybeResolveActiveRecall
returns a timeout result at the configured timeoutMs even when the
embedded run has not cooperatively checked the abort signal. Late
subagent rejections are caught silently to prevent unhandled promise
errors.

Fixes #71629
2026-04-25 17:10:34 -04:00
Peter Steinberger
4c0e9a4b2e fix(plugins): honor inferred agent model defaults 2026-04-25 19:40:32 +01:00
Ayaan Zaidi
bdba4fa1bf fix: isolate active memory auth health (#71539)
* fix(agents): scope helper auth failures

* fix(active-memory): isolate recall auth health

* fix: isolate active memory auth health (#71539)

* fix: avoid auth policy import cycle (#71539)
2026-04-25 16:50:38 +05:30
Peter Steinberger
d068cb960d fix: stabilize qa lab memory and thinking scenarios 2026-04-25 07:50:04 +01:00
Peter Steinberger
b34ece705f fix: retire idle bundled MCP runtimes 2026-04-25 07:49:12 +01:00
Vincent Koc
d686e6f876 fix(hooks): avoid stale active-memory startup fallback 2026-04-22 16:10:01 -07:00
Vincent Koc
db5895fd2a refactor(hooks): centralize live plugin config lookup 2026-04-22 13:38:38 -07:00
Vincent Koc
dd47b56243 fix(hooks): refresh active memory config at runtime 2026-04-22 12:55:12 -07:00
Peter Steinberger
6ce17db11a fix: gate max thinking by model support 2026-04-21 07:02:43 +01:00
Magicray1217
3f90d92667 fix(active-memory): gracefully degrade on timeout instead of failing entire reply. Fixes #66849 2026-04-21 03:20:25 +01:00
Peter Steinberger
beff874340 perf(test): trim active memory and qa lab hotspots 2026-04-20 15:04:38 +01:00
Bartok
866d1eef0a fix(active-memory): raise timeoutMs ceiling from 60s to 120s
The normalizePluginConfig clamp hard-coded a 60_000 ms ceiling for
config.timeoutMs, silently reducing any configured value above 60
seconds down to 60 000 ms at runtime. This made it impossible for
operators to set longer recall budgets even though the docs
(docs/pi.md) showed 120_000 as a valid example.

Raise the ceiling to 120_000 ms so values between 60 001 and 120 000
are honored. Values above 120 000 are still clamped to prevent
unbounded blocking.

Adds two regression tests:
  - 90 000 ms is passed through unchanged
  - 200 000 ms is clamped to 120 000 ms

Fixes #68410.
2026-04-18 20:31:41 +01:00
Peter Steinberger
af954a81d1 perf: optimize bundled extension tests 2026-04-17 16:05:09 +01:00
Tak Hoffman
f94d6778b1 fix(active-memory): Move active memory recall into the hidden prompt prefix (#66144)
* move active memory into prompt prefix

* document active memory prompt prefix

* strip active memory prefixes from recall history

* harden active memory prompt prefix handling

* hide active memory prefix in leading history views

* strip hidden memory blocks after prompt merges

* preserve user turns in memory recall cleanup
2026-04-13 16:05:43 -05:00
Peter Steinberger
9dbbee8a02 fix(test): align trace directive type stubs 2026-04-13 00:20:52 +01:00
Peter Steinberger
c8347e70da fix: align trace directive types 2026-04-12 11:30:44 -07:00
Tak Hoffman
c37e49f275 Add /trace toggle and fix Active Memory diagnostics 2026-04-12 13:20:22 -05:00
Tak Hoffman
847739d82c Fix dreaming replay, repair polluted artifacts, and gate wiki tabs (#65138)
* fix(active-memory): preserve parent channel context for recall runs

* fix(active-memory): keep recall runs on the resolved channel

* fix(active-memory): prefer resolved recall channel over wrapper hints

* fix(active-memory): trust explicit recall channel hints

* fix(active-memory): rank recall channel fallbacks by trust

* Fix dreaming replay and recovery flows

* fix: prevent dreaming event loss and diary write races

* chore: add changelog entry for memory fixes

* fix: harden dreaming repair and diary writes

* fix: harden dreaming artifact archive naming
2026-04-12 00:25:11 -05:00
Tak Hoffman
9d126dc645 Fix active-memory recall runs when mx-claw is enabled (#65049)
* fix(active-memory): preserve parent channel context for recall runs

* fix(active-memory): keep recall runs on the resolved channel

* fix(active-memory): prefer resolved recall channel over wrapper hints

* fix(active-memory): trust explicit recall channel hints

* fix(active-memory): rank recall channel fallbacks by trust
2026-04-11 21:08:57 -05:00
Tak Hoffman
885209ed03 feat: default active memory QMD recall to search (#65068)
* feat(active-memory): default QMD recall to search

* feat(active-memory): surface search debug telemetry

* fix(active-memory): avoid forking qmd managers
2026-04-11 20:56:21 -05:00
Tak Hoffman
52bf19c45e fix(active-memory): remove built-in fallback model (#65047)
* fix(active-memory): remove built-in fallback model

* fix(active-memory): tighten fallback cleanup
2026-04-11 20:24:07 -05:00
Tak Hoffman
5d0b5388fa Fix active-memory config schema fallback mismatch (#65048)
* fix(active-memory): remove built-in fallback model

* fix active-memory config schema fallback fields

* fix failover decision external abort typing
2026-04-11 20:19:42 -05:00
Peter Steinberger
3e80bd33e4 refactor: simplify extension conversions 2026-04-11 01:37:23 +01:00
Peter Steinberger
0ebeee8b0d chore: enable consistent-return 2026-04-10 20:56:43 +01:00
Altay
8cf02e7c47 fix(ci): clear check-additional follow-up regressions (#63934)
* fix(ci): route messaging temp files through openclaw tmp dir

* fix(ci): clear qa-lab follow-up guardrails

* fix(ci): own-check ACP fallback resolvers

* fix(ci): preserve memory-core write error causes

* fix(ci): narrow qa-channel boundary alias

* fix(test): type memory-core dreaming api stubs
2026-04-09 23:47:59 +01:00
Tak Hoffman
b83726d13e Feat: Add Active Memory recall plugin (#63286)
* Refine plugin debug plumbing

* Tighten plugin debug handling

* Reduce active memory overhead

* Abort active memory sidecar on timeout

* Rename active memory blocking subagent wording

* Fix active memory cache and recall selection

* Preserve active memory session scope

* Sanitize recalled context before retrieval

* Add active memory changelog entry

* Harden active memory debug and transcript handling

* Add active memory policy config

* Raise active memory timeout default

* Keep usage footer on primary reply

* Clear stale active memory status lines

* Match legacy active memory status prefixes

* Preserve numeric active memory bullets

* Reuse canonical session keys for active memory

* Let active memory subagent decide relevance

* Refine active memory plugin summary flow

* Fix active memory main-session DM detection

* Trim active memory summaries at word boundaries

* Add active memory prompt styles

* Fix active memory stale status cleanup

* Rename active memory subagent wording

* Add active memory prompt and thinking overrides

* Remove active memory legacy status compat

* Resolve active memory session id status

* Add active memory session toggle

* Add active memory global toggle

* Fix active memory toggle state handling

* Harden active memory transcript persistence

* Fix active memory chat type gating

* Scope active memory transcripts by agent

* Show plugin debug before replies
2026-04-09 11:27:37 -05:00