Commit Graph

993 Commits

Author SHA1 Message Date
qingminlong de27d8306e fix(memory): keep QMD file hints after stale docid misses (issue #113041) (#113515)
* fix(memory): keep qmd file hints after docid misses

* fix(memory): 不要将 hint-only 的 QMD 文档位置缓存到 docid 缓存中

当本地 docid 索引查询无结果时,使用 QMD 文件提示回退来解析文档位置。
但之前的代码将 hint-only 的结果也缓存到了 docPathCache 中,这导致
索引恢复后依然使用旧的回退位置。

修改:
1. qmd-document-resolver.ts: 分离索引查询结果和 hint 回退结果,
   只缓存来自索引查询的 pickDocLocation 结果。
2. qmd-manager.test.ts: 添加索引恢复回归测试,验证索引为空时
   使用 hint 回退,索引恢复后使用索引中的记录而不是缓存的回退位置。

Co-Authored-By: Claude <noreply@anthropic.com>

* test(memory): expect qmd hint provenance

* chore(memory): clarify QMD hint cache behavior

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Patrick Erichsen <patrick.a.erichsen@gmail.com>
2026-08-05 19:56:03 -07:00
Vincent Koc e41c574793 improve(gateway): defer inactive plugin runtime imports (#119733)
* perf(gateway): defer Talk relay cleanup imports

Punchcard-Session: coral-workshop-workshop-3f

* perf(acpx): defer Pi session catalog runtime

Punchcard-Session: coral-workshop-workshop-3f

* perf(google-meet): defer meeting runtime imports

Punchcard-Session: coral-workshop-workshop-3f

* improve(memory-core): defer scoped runtime access

Punchcard-Session: coral-workshop-workshop-3f

* perf(google-meet): defer SDK action helpers

Punchcard-Session: coral-workshop-workshop-3f
2026-08-06 07:38:24 +08:00
Vincent Koc 5eb7eddce6 fix(memory): keep post-ready RPCs responsive (#119710)
Punchcard-Session: coral-workshop-workshop-3f
2026-08-06 03:35:32 +08:00
Vincent Koc 824d170680 fix(memory): keep gateway RPCs responsive during startup (#119676)
* fix(memory): defer startup manager warmup

* test(plugins): register memory stop hook contract
2026-08-06 02:07:57 +08:00
Peter Steinberger 6269be70c5 refactor(memory): consolidate sync and dreaming helpers (#119633)
* refactor(memory): consolidate sync and dreaming helpers

* test(memory): track descriptor-backed promotion writes
2026-08-05 08:41:35 -07:00
Peter Steinberger 60a8ec821c refactor(plugins): reuse canonical error coercion (#119451) 2026-08-04 21:05:45 -07:00
Vincent Koc cbde3c1945 perf(memory): defer session backfill runtime (#119372)
Punchcard-Session: coral-workshop-workshop-3f
2026-08-05 08:16:20 +08:00
Vincent Koc 96ae5fad79 test(qa): add memory redaction boundary coverage (#118916) 2026-08-04 04:46:10 +08:00
Peter Steinberger 616b0c9408 fix(memory): prevent embedding fallback credential cross-provider leaks (#118759)
* fix(memory): isolate embedding fallback provider credentials

* test(memory): preserve real embedding fallback owner in index fixtures
2026-08-03 10:30:38 -07:00
Manik 0a01099530 fix(memory): honor keyed agents in standalone operations (#118310)
Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
2026-08-03 11:18:39 -05:00
Peter Steinberger f5cb0f2f76 test(memory): isolate index suite plugin discovery (#118641) 2026-08-03 04:36:03 -07:00
Peter Steinberger 6d8c1ed30d fix(voice-call): prevent unrelated session recall in fast context (#118498)
* fix(talk): authorize fast session context

* test(plugins): preserve memory runtime mock types

* fix(plugins): preserve memory authorizer binding

* fix(memory): forward search authorization in lazy runtime

* test(memory): verify lazy authorizer host binding

* docs(plugins): define memory search authorization contract
2026-08-03 03:38:02 -07:00
Peter Steinberger cbd4b8dec8 fix(memory): keep wiki search inside protected recall visibility (#118265)
* fix(memory): unify wiki session authorization

* build: expose memory core boundary declarations
2026-08-02 18:22:17 -07:00
Vincent Koc d73dfaef16 fix: handle qmd watcher errors (#118171)
Co-authored-by: IWhatsskill <284122573+IWhatsskill@users.noreply.github.com>
2026-08-03 04:23:03 +08:00
synth 6d2ff9ef38 fix(memory): permanent legacy sidecar migration warning for empty placeholder OpenClaw creates (#114661)
* fix(memory-core): fail closed on non-ENOENT companion stat errors

Only treat ENOENT as 'sidecar is absent'. Other fs errors (EACCES, EIO,
ELOOP, EMFILE) now return null (fail-closed) instead of silently treating
the sidecar as zero-byte, preventing legacy data from being dropped on
transient or permission failures.

* fix(memory): silence self-inflicted legacy sidecar migration warning

OpenClaw can leave a zero-byte placeholder at the legacy memory sidecar
path (~/.openclaw/memory/<agentId>.sqlite) while the live memory index
is the per-agent SQLite database. The legacy-index migration check found
the empty file, attached it, saw no legacy schema, and warned on every
CLI invocation and gateway start, with no way for users to clear it.

Treat a demonstrably empty sidecar (zero-byte main file and no WAL or
journal content) as nothing to import: remove it quietly as a migration
change instead of emitting a permanent warning. Sidecars that contain
any bytes still go through the existing import and warning paths, so a
real legacy index or a genuinely unrecognized database is unaffected.

Closes #114626

* fix(memory-core): fail closed on non-ENOENT companion stat errors

Only treat ENOENT as 'sidecar is absent'. Other fs errors (EACCES, EIO,
ELOOP, EMFILE) now return null (fail-closed) instead of silently treating
the sidecar as zero-byte, preventing legacy data from being dropped on
transient or permission failures.

* test(memory-core): add ELOOP and EACCES companion stat regression coverage

Regression tests for the fail-closed fix: when a WAL/SHM/journal
companion's fs.stat fails with ELOOP (self-referential symlink) or
EACCES (permission denied), the migration must NOT remove the main
legacy sidecar file. Only ENOENT means genuinely absent.

Addresses Whatsskill Codex review P1 finding on openclaw/openclaw#114661.

* ci: retrigger after transient runner failures
2026-08-02 07:51:20 -07:00
Peter Steinberger 92c7400a54 perf(cli): finish cold read paths (#117957)
* perf(cli): finish cold read paths

* test(cli): satisfy cold path lint gates

* test(cli): fix cold path fixture typing
2026-08-02 03:59:24 -07:00
Peter Steinberger f5c985d92c fix(memory): remove interrupted Dreaming sessions after Gateway restart (#117885)
* fix(memory): clean interrupted Dreaming sessions after Gateway restart

* test(sessions): preserve historical timestamps in lifecycle fixtures

* test(plugins): remove duplicate registry handle mock from main

* style(sessions): format lifecycle conformance assertion
2026-08-02 01:17:31 -07:00
Peter Steinberger 9a433136c4 test(memory-core): consolidate dreaming fixtures (#117804) 2026-08-01 21:37:46 -07:00
Peter Steinberger 7d1d721d62 fix(memory): qualify stale memory search results (#117706)
* fix(memory): qualify stale search results

* fix(memory): satisfy staleness checks

* fix(memory): normalize absent staleness
2026-08-01 17:40:14 -07:00
Peter Steinberger 35e4563fa8 refactor(memory): deduplicate memory search test fixtures (#117691) 2026-08-01 16:52:50 -07:00
Peter Steinberger 165c968f95 fix(memory): recover restored session freshness (#117548) 2026-08-01 12:39:24 -07:00
Vincent Koc 6dcb95a947 test(memory): isolate mocked embedding providers 2026-08-02 01:18:43 +08:00
Peter Steinberger 568ea29d2e refactor(plugins): inherit shared package boundary settings (#117474) 2026-08-01 09:11:09 -07:00
Peter Steinberger e4d1b7e0d3 refactor(plugins): move plugin contributions into the registry bundle (#117372)
* refactor(plugins): move plugin contributions into the registry bundle

* fix(plugins): guard embedding owner union and drop unused test-util imports

* fix(plugins): break registry facade import cycles

* fix(plugins): remove obsolete registry snapshot seams

* test(gateway): preserve plugin runtime mock exports

* test(auto-reply): install builder registry in diagnostics fixture

* test(plugins): activate registry-backed capability fixtures
2026-08-01 06:57:01 -07:00
Peter Steinberger 597699401a refactor(memory): use sqlite transcript identities (#117334) 2026-08-01 04:38:40 -07:00
Peter Steinberger f216d3cc86 refactor(memory): unify session ingestion (#117293) 2026-08-01 02:12:50 -07:00
Peter Steinberger 04f9a204fd fix(memory): reuse targeted session corpus snapshot (#117247) 2026-08-01 00:53:14 -07:00
Peter Steinberger ea1d6cc35e refactor(memory): unify embedding provider adaptation (#117094) 2026-07-31 16:30:22 -07:00
chelsealong fc545773cc fix(memory): suggest reindex, not --fix, for a missing qmd index (#116958)
`memory status` always appended "Fix: openclaw memory status --fix"
when any audit issue was present, even when none of the issues were
actually repaired by --fix. A missing qmd index file (qmd-index-missing)
is marked fixable: false, so running the suggested --fix left the
issue unresolved. Gate the --fix hint on at least one fixable issue,
and suggest `openclaw memory index --agent <id>` (which builds a fresh
index) when the qmd index file is missing.
2026-07-31 15:14:59 -07:00
Vincent Koc 007fdb1f7c test(extensions): remove duplicate coverage (#116643) 2026-07-31 11:59:12 +08:00
pash-openai e52354ea13 fix(build): pin typebox to a published release (#116333) 2026-07-30 09:58:51 +00:00
WhatsSkiLL e5cee36b46 fix(memory): retry failed queued session targets (#115923)
* fix(memory): retain failed queued sync targets

* fix(memory): drain retained targets on idle sync

* test(memory): prove idle queued sync recovery

* fix(memory): preserve queued sync ownership

* fix(memory): avoid queued sync self-deadlock

* fix(memory): stop queued recovery during close

* fix(memory): clear retained sync state on close

* test(memory): prove live queued rejection transition

* fix(memory): enforce sync repro invariants

* test(memory): bound archive recovery proof

* test(memory): seed archive proof transcript

* test(memory): exercise archived transcript recovery

* chore(knip): register memory sync repro

* fix(memory): reject blank queries before settings

* style(memory): satisfy queue recovery lint

* test(memory): align doctor migration expectations

* test(memory): insert explicit provenance fixture

---------

Co-authored-by: IWhatsskill <284122573+IWhatsskill@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-30 02:47:59 -07:00
Yuval Dinodia d952566385 fix(memory-core): MEMORY.md compaction deletes user notes written under a promotion-style heading (#116180)
* fix(memory-core): stop MEMORY.md compaction from deleting marker-free user sections

Budget compaction decided that a MEMORY.md section belonged to OpenClaw purely
from its heading text, so a user-authored section under a heading that looks
generated, such as "## Promoted From Short-Term Memory (2026-04-10)", was
eligible for deletion once the file plus the new promotion exceeded
memoryFileMaxChars. The rewrite succeeded silently and the atomic replace made
the loss durable.

A matching heading is now provisional: the block is classified as a promotion
only when it structurally contains at least one
"<!-- openclaw-memory-promotion:... -->" marker, which buildPromotionSection
emits for every promoted candidate. Marker-free sections are preserved.
Generated sections, including the multi-project shape whose markers sit under
"### Global" and "### Project:" subsections, are still dropped oldest-first, so
the size bound from #73691 is unchanged.

Extends #116057, which made only subsection handling marker-aware and left the
top-level heading classifier trusting presentation text.

* fix(memory-core): preserve mixed promotion blocks

Validate the complete marker-and-entry grammar before treating a promotion-shaped block as writer-owned. Preserve marker-only and mixed blocks so unheaded operator notes cannot be deleted during budget compaction.

Co-authored-by: yetval <yetvald@gmail.com>

* test(memory-core): allow cold citation startup

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-07-30 16:24:32 +08:00
Yuval Dinodia 772235cc55 fix(memory-core): stop MEMORY.md compaction from deleting user headings (#116057)
* fix(memory-core): stop MEMORY.md compaction from deleting user headings

parseMemoryBlocks segmented MEMORY.md only on "## ", so a user heading of
any other level did not close the promotion section above it. The section
ran on to the next "## " heading or EOF, and dropping it to fit the budget
deleted the user text it had swallowed, with no backup and no diagnostic.

Close the current block on any ATX heading, keeping the generator's own
"### Global" and "### Project: <key>" subheadings inside the promotion
body so multi-project sections stay droppable whole.

* fix(memory-core): identify generated promotion subsections by their entry marker

The first exception treated every "### Global" and "### Project: <key>"
heading under a promotion block as dreaming-owned, so a user who wrote one
of those headings themselves still lost it to compaction, which is the same
data-loss class this change set out to fix.

A generated subsection always leads with an openclaw-memory-promotion entry
marker comment, so require that marker as the next non-blank line before
treating the heading as part of the promotion body. User headings that
collide with the generated names now terminate the block and survive.

* fix(memory-core): recognize tab-delimited and empty ATX headings

The heading detector required a literal ASCII space after the opening #
sequence. CommonMark also allows a tab or end of line, so a user note
starting with a tab-delimited heading stayed inside the promotion block
above it and was deleted when compaction dropped that block.

Accept a space, a tab, or end of line after the # sequence. The generated
subsection pattern stays space-only because that is what buildPromotionSection
emits, so a tab-delimited heading is user-authored and is preserved.

* fix(memory-core): preserve Setext headings during compaction

Setext headings were still absorbed into the generated promotion block above them, so dropping that block could silently delete durable user notes. Move the heading paragraph into a preserved block when its underline is encountered, while keeping marker-backed generated content compactable.

* fix(memory-core): preserve indented ATX headings

---------

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-07-30 09:13:57 +08:00
EricKwan e00ef16ee7 fix(xai): follow OAuth default model automatically (#115617)
* fix(xai): default OAuth login to Grok 4.5

* fix(xai): follow OAuth default model automatically

* fix(xai): send OAuth proxy request headers

* fix(xai): avoid provider API shadowing

* fix(qa): restore current main validation gates

---------

Co-authored-by: echeung <echeung@agentsonly.com>
Co-authored-by: fuller-stack-dev <263060202+fuller-stack-dev@users.noreply.github.com>
2026-07-29 23:05:29 +00:00
Peter Steinberger 7380875375 fix(memory): keep degraded status actionable (#116074)
* fix(memory): diagnose degraded auth owners

* fix(memory): use shared sqlite opener
2026-07-29 16:58:57 -04:00
Vincent Koc 83aca8a59c fix(memory): return early for blank searches (#116034) 2026-07-30 02:48:50 +08:00
Jason (Json) cf927f7b1b fix(memory): keep rollbacks compatible after recall metadata upgrade (#116003)
* fix(memory): keep agent database rollbacks compatible

* fix(memory): satisfy rollback migration guards
2026-07-29 11:19:22 -06:00
Peter Steinberger 841bfcdcb8 fix(memory): make legacy session backfill rollback re-applicable (#116004)
* fix(memory): reset legacy backfill cursors on rollback

* fix(memory): track complete backfill rewind baselines
2026-07-29 13:08:25 -04:00
Peter Steinberger 6dc13c63b6 fix(memory-core): adopt legacy dreaming jobs (#115986) 2026-07-29 12:26:43 -04:00
Peter Steinberger 5bfc65d7f4 refactor: remove 3,543 lines of redundant runtime and tests (#115961)
* refactor: remove 3,543 lines of redundant runtime and tests

* refactor: ratchet production environment variable budget
2026-07-29 11:43:41 -04:00
Peter Steinberger 53815217e9 fix(memory): session backfill drains and rolls back reversibly (#115926)
* fix(memory): complete reversible session backfill

* refactor(memory): split backfill lifecycle helpers

* fix(memory): break backfill lifecycle import cycle

* fix(memory): keep lifecycle contract exports minimal
2026-07-29 10:48:16 -04:00
Peter Steinberger 1f9dd150e8 fix(memory-core): harden dreaming lifecycle (#115925)
* fix(memory-core): harden dreaming lifecycle

* fix(memory-core): keep sweep result internal
2026-07-29 10:06:27 -04:00
Vincent Koc dcd3c5b202 fix(test): restore isolated memory manager tests (#115880) 2026-07-29 20:24:14 +08:00
Peter Steinberger a2ead0a929 fix(memory): recover divergent dreaming journals (#115855)
* fix(memory): recover divergent dreaming journals

Co-authored-by: brokemac79 <martin_cleary@yahoo.co.uk>

* chore: drop changelog edit (release generation owns it)

---------

Co-authored-by: brokemac79 <martin_cleary@yahoo.co.uk>
2026-07-29 07:32:26 -04:00
loong 7bdd1f646b fix(memory-host-sdk): resolve stable execPath for worker fork to survive Homebrew Node upgrades (#99318)
* fix(memory): survive Homebrew Node upgrades

Co-authored-by: 袁龙辉0668001277 <yuan.longhui@xydigit.com>

* test(whatsapp): isolate last-route coverage

* fix(deepinfra): preserve offline model compatibility

* test(memory): isolate migration cleanup lifecycle

* test: stabilize aggregate extension gates

* ci: retrigger pull request workflow

* test: preserve inherited Node options

* test(cli): tolerate cold hosted startup

---------

Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-07-29 06:49:02 -04:00
Peter Steinberger 20668eed03 fix(memory): quarantine writes from tainted agent turns (#115818)
* feat(memory): taint writes after network tools

* fix(memory): keep provenance mutations recoverable

* fix(memory): roll back failed provenance writes

* fix(memory): serialize provenance mutations

* docs(memory): explain flush provenance boundary

* refactor(memory): share provenance mutation wrapper

* docs(memory): clarify flush provenance fallback

* fix(memory): canonicalize provenance paths
2026-07-29 06:02:06 -04:00
Vincent Koc 47c1921d5d fix(ui): stabilize memory engine selection (#115750) 2026-07-29 11:37:39 +02:00
Hannes Rudolph 6dc55fa65e fix(plugins): recover user turns with scoped reply hooks (#114836)
Allow before_agent_reply plugins to declare host-enforced trigger eligibility so scheduled-only hooks do not block interrupted user-turn recovery. Keep omitted and malformed scopes fail-closed, scope both memory-core maintenance hooks, and cover three runner reload cycles through the public registration contract.

Refs: #111442

Source: #114836

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
2026-07-29 17:22:16 +08:00
Peter Steinberger 4232126bba chore: update dependencies across workspace (#115677)
* chore(deps): update dependencies

* fix(deps): restore CI compatibility
2026-07-29 05:16:42 -04:00