Commit Graph
41 Commits
Author SHA1 Message Date
agent 2d5aa9cd3d fix(plugins): ship Experience skill in plugin packages (#3946)
* fix(plugins): ship experience memory skill

* fix(openclaw): drop unpublished selector aliases
2026-08-12 11:18:22 +08:00
agent 00f3738edb feat(usage): emit resource-scoped experience usage records (#3921)
* feat(usage): expand experience tracking and log schema

* fix(usage): preserve experience count event names

* refactor(agent-evolution): use generic OpenViking tools

* fix(usage): capture generic OpenViking tool events

* feat(skills): guide cross-agent experience retrieval

* fix(usage): address generic tool migration review
2026-08-11 22:20:18 +08:00
Zayn JarvisandClaude Fable 5 03bd469417 fix(openclaw-plugin): drop SecretRef exec resolver from packaged plugin (#3849)
Marketplace install scanners (ArkClaw) block plugins whose shipped code
contains child_process. Keep env/file SecretRef sources; configuring
{source:"exec"} now fails with a clear error pointing at env/file.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-06 18:50:38 +08:00
agent 61c42e3bb0 feat(openclaw): add experience memory tools (#3827) 2026-08-06 15:52:31 +08:00
Ziyang Guo abc387955d feat(openclaw-plugin): SecretRef support for config.apiKey (#3522) (#3618)
Issue #3522 — the OpenClaw plugin's `config.apiKey` only accepted a plain
string, resolved through local `${ENV_VAR}` interpolation. `INSTALL*.md`
documented this as a known limitation: users who store their other OpenClaw
provider credentials (LLM, TTS, MCP servers) through the standard
`{source, id[, provider]}` SecretRef mechanism (env / file mount /
exec-backed vault such as 1Password, Vault, gopass) had to keep the
OpenViking key as cleartext inside `openclaw.json`.

### config.ts — `string | OpenVikingSecretRef` widening

* Add `OpenVikingSecretRef = "env"|"file"|"exec"` discriminated union type,
  matching the shape OpenClaw core uses for its own credential fields
  (`env` + `file` implemented in-plugin, `exec` forwarded to `child_process`
  so providers like `@transmitt0r/openclaw-plugin-onepassword` can manage
  the OpenViking key without SDK coupling).
* Add `resolveSecret()` resolver with explicit, actionable errors:
  - env: unset var = throw, no silent empty fallback
  - file: `~` expanded, UTF-8 read, whitespace trimmed; unreadable file
    rethrows with the OpenViking field name prefixed so config misconfigs
    surface with a clear label and path
  - exec: lazy `require("node:child_process").execFileSync(provider,[id])`,
    stdout trimmed, 15s timeout; errors prefixed with provider + id
  - unknown source / missing id / missing exec provider = explicit throw
* `memoryOpenVikingConfigSchema.parse()` widens `rawApiKey` to
  `string | OpenVikingSecretRef`, then passes it through
  `resolveSecret(rawApiKey, "config.apiKey")` *before* the existing
  `resolveEnvVars` pass. Plain strings transparently fall through
  `resolveSecret` unchanged, so `${ENV_VAR}` interpolation is preserved
  100% backward-compatibly.
* `OPENVIKING_API_KEY` env fallback is unchanged and triggers only when the
  `apiKey` config key is absent — a user who deliberately sets `apiKey: ""`
  still gets "" (explicitly unauthenticated), not the env fallback.
* `uiHints.apiKey.help` documents the SecretRef shape and recommends it.

### openclaw.plugin.json — widening schema + UI hints

* `configSchema.properties.apiKey` becomes `oneOf: [string, env ref, file ref, exec ref]`.
  Each object variant has a `title`, `additionalProperties: false`,
  `required`, and explicit description per field, so OpenClaw's config UI
  can render them individually instead of showing a generic JSON object blob.
* `uiHints.apiKey.help` matches the new config.ts wording.

### INSTALL.md / INSTALL-ZH.md — SecretRef usage tables

Replace the old "plaintext / chmod 0600" caveat bullet with a 3-row table
(env / file / exec) showing example JSON + notes (Kubernetes secretKeyRef
mount for `file`, 1Password `op://` URL convention for `exec`). The
backward-compat string path is retained at the end of the new bullet so
existing deployments that haven't migrated yet still get the old permission
advice — no surprise behaviour for upgrading users.

### tests/ut/config.test.ts — SecretRef regression suite (10 new cases)

Under a new `describe("… SecretRef (#3522)")`:

1. Backward compat: `${OV_KEY}` interpolation still resolves.
2. env source — happy path with a fresh env var.
3. env source — unset var throws, no silent fallback.
4. file source — real `mkdtemp`-created file, trimmed whitespace. Cleanup
   in `afterEach`.
5. file source — missing-path error message contains readable label + path.
6. exec source — `vi.spyOn(child_process.execFileSync)` asserts provider +
   args, stdout trimmed.
7. exec source — missing `provider` field errors.
8. Schema validation — unknown `source` and missing `id` each throw with
   error messages that name the problem.
9. Env fallback boundary — explicit `apiKey: ""` is NOT overridden by
   OPENVIKING_API_KEY, but `apiKey` absent IS (backward-compat behaviour
   contract pinned with a test so future refactors can't regress).

Covers every branch inside `resolveSecret()`, plus the backward-compat
contracts issue #3522 called out.
2026-07-30 16:21:06 +08:00
Hao Zhe 3b2571b36e feat(openclaw): add catalog icon (#3362) 2026-07-20 14:55:30 +08:00
Hao Zhe ebe7fa2a7d fix(plugins): align OpenCode and OpenClaw contracts (#3232) 2026-07-17 17:06:27 +08:00
Carateffee 1a11b1ba3d fix(openclaw-plugin): support config headers (#3044) 2026-07-07 13:42:55 +08:00
LinQiang391andLinQiang391 7fa34c9520 fix(session): make failed archives skippable and tune OpenClaw auto-commit (#2775)
Treat failed session archives as terminal skipped state so later commits can continue, and replace OpenClaw's fixed auto-commit token threshold with a context-window ratio while tolerating the deprecated config key.

Co-authored-by: LinQiang391 <linqiang391@users.noreply.github.com>
2026-06-23 12:00:29 +08:00
Qin Haojie 794ee3ee41 fix(openclaw): default peer role to assistant (#2626) 2026-06-15 21:54:55 +08:00
Mingjian Que 47c88843d0 docs(openclaw): refresh OpenViking operator guidance (#2591)
* docs(openclaw): refresh OpenViking operator guidance

* fix(openclaw): include recall trace in install manifest

* docs(openclaw): restore reference docs from 2386

* docs(openclaw): clarify session history archive lookup

* docs(openclaw): align restored docs with current plugin

* docs(openclaw): restore full context database skill

* docs(openclaw): restore install guidance from 2386
2026-06-13 11:39:29 +08:00
Mingjian Que 564c7624b8 feat(openclaw): configure recall target types (#2590)
* feat(openclaw): configure recall target types

* fix(openclaw): align recall session target uri

* fix(openclaw): remove session semantic recall target
2026-06-13 11:22:08 +08:00
Mingjian Que d497b05aee feat(openclaw): wire recall trace runtime (#2589)
* feat(openclaw): wire recall trace runtime

* feat(openclaw): expose recall trace gateway routes

* feat(openclaw): align archive recall trace details

* test(openclaw): cover auto recall trace recording

* fix(openclaw): avoid duplicate memory recall search
2026-06-13 11:05:33 +08:00
Mingjian Que e2ca85d8ec feat(openclaw): add recall trace core (#2587) 2026-06-13 10:28:20 +08:00
Mingjian Que 61203e84b2 feat(openclaw): gate agent-visible tools (#2566) 2026-06-12 14:48:21 +08:00
marchpureandhaoxingjun 2dbee8e33d add OpenViking read tools to OpenClaw plugin (#2551)
* add ov_list tool to openclaw plugin

* declare ov_list in OpenClaw plugin manifest

* add OpenViking read tools to OpenClaw plugin

---------

Co-authored-by: haoxingjun <haoxingjun@bytedance.com>
2026-06-11 23:51:47 +08:00
Mingjian Que 790daaf885 feat(openclaw): inject agent experience memories (#2281) 2026-06-10 10:43:41 +08:00
Mingjian Que e5c8208dcb Make OpenClaw auto-recall timeout configurable (#2448) 2026-06-05 14:05:54 +08:00
Qin Haojie ff258768c2 feat(memory): 引入 User/Peer 记忆隔离模型 (#2236)
* feat(memory): introduce user and peer memory isolation

Unify agent-scoped memory behavior into user-owned memory spaces, add peer_id compatibility for session and retrieval paths, and wire memory_policy through session commit flows.

* feat(memory): align session identity around peer IDs

* feat(search): pass peer id through retrieval

* refactor(memory): remove agent identity from integrations

* fix(memory): isolate peer identity from self extraction

* fix(tau2): provision benchmark user configs

* fix(auth): allow admin keys to access data APIs

* fix(openclaw): enable peer memory policy for peer roles

* fix(openclaw): resolve sender for peer recall

* refactor(session): simplify memory extraction routing

* refactor(ov-cli): reduce formatting-only diff

* refactor(message): remove unused message helpers

* refactor(retrieval): simplify peer target resolution

* refactor(namespace): remove deprecated agent namespace policy

* fix(agent): propagate peer id through integrations

* fix(auth): align integration clients with api-key mode
2026-06-05 10:55:48 +08:00
AutoCoder 1d631cd38d Rename search tool to ov_search to avoid conflict with existing OpenClaw tool name (#2235) 2026-05-26 11:58:15 +08:00
HaotianChen616 f39b030926 feat: externalize oversized session tool results (#2058)
Squashed commits:

- 28e175c8 feat: externalize oversized session tool results
- 73d6461d feat: coalesce OpenClaw tool results by turn
- 3bf4a0c2 fix: apply tool result config and filtered listing
- a5bc0582 [bugfix] extractNewTurnMessages会错误过滤掉没有text block的assistant toolCall,用[toolCall: toolName]占位符确保消息传入
- 1d76827b style: format tool result compression changes
- 495b5623 fix: preserve textless toolUse turns
- 399f2dc3 feat: expose tool result access tools
- 43b48dd7 fix: honor min preview chars for source reads
- 6eaaf54f fix: split aggregated tool result messages
- f8ad98c3 fix: hydrate tool outputs for extraction
- f9031458 fix: improve tool descriptions for tool result access tools
- ae3bcd33 fix: hydrate source-read tool outputs
- 8976f8ce test: add tool result compression bench cases
2026-05-21 14:36:10 +08:00
Mingjian QueandGPT-5.5 0073ce7e05 fix(openclaw): split OpenViking import tools (#1946)
Replace the ambiguous OpenClaw ov_import surface with explicit add_resource and add_skill tools and slash commands.

Guide media attachment imports through the existing OpenViking temp-upload and resource import APIs instead of invented upload endpoints.

Update docs, plugin manifest, and unit coverage for the split import commands.

Co-authored-by: GPT-5.5 <noreply@openai.com>
2026-05-10 15:51:32 +08:00
LinQiang391andLinQiang391 72a3cd29f0 feat(openclaw-plugin): support OpenClaw install and ClawHub release flow (#1904)
Squashes OpenClaw plugin install compatibility, setup helper source-build support, built dist output, and ClawHub release workflow updates into one publish commit.

Co-authored-by: LinQiang391 <linqiang391@users.noreply.github.com>
2026-05-08 17:38:04 +08:00
a5649a4d20 chore(agent-tools): converge MCP tool names (#1851)
* chore(agent-tools): converge MCP tool names

Rename model-visible explicit memory tools without adding a new agent HTTP API or changing existing CLI behavior.

Keep OV server /mcp store renamed to remember while preserving its existing session write and commit implementation.

Rename Codex MCP openviking_store to remember and keep its original session create/message/commit/cleanup flow; leave OpenClaw memory_store and ov add-memory unchanged.

Co-authored-by: GPT-5.5 <noreply@openai.com>

* refactor(agent-tools): align MCP and search tool names

Apply the search-tool alignment patch across Codex MCP, OpenClaw, OV MCP docs, and focused tests.

Co-authored-by: wlff123 <wulf234@163.com>

Co-authored-by: GPT-5.5 <noreply@openai.com>

---------

Co-authored-by: GPT-5.5 <noreply@openai.com>
2026-05-08 10:50:20 +08:00
Mingjian Que 3ebbb5baaa fix(openclaw): support capability contracts on 5.2 (#1866)
OpenClaw 5.2 gates non-bundled plugin capabilities from the manifest before relying on runtime registration. The previous OpenViking manifest only identified the plugin as kind=context-engine, so 5.2 could classify it as non-capability, emit diagnostics for agent tools registered without contracts.tools, and leave real gateway/agent runs falling back from the openviking context engine even when inspect loaded it manually.

Declare startup/capability activation and the tool contract list so the plugin is loaded as a plain capability plugin and its registered tools match manifest contracts. Register the ov_archive_expand factory tool with an explicit name so it can be matched to contracts.tools.

Drop the agent_end hook registration because 5.2 blocks that typed hook for non-bundled plugins without conversation access, and this plugin already records agent routing through session_start/session_end.

Harden the memory-chain e2e to find only the current run's OpenViking session, assert the unique marker is persisted, and exit non-zero on assertion failures.
2026-05-06 16:50:53 +08:00
Eurakaxunandwlff123 51342319b4 Introduce Working Memory v2: 7-section session memory, anti-bloat guards, sliding-window tokens, and OpenClaw integration (#1782)
* feat(wm): WM v2 core - 7-section structure, pending_tokens, anti-bloat guard

Server-side implementation of Working Memory v2:

- 7-section structured WM format with section integrity guards

- pending_tokens sliding window for live session tracking (O(1) read)

- Anti-bloat Key Facts guard (dedup, capping, consolidation sentinel)

- Regex recovery fallback for malformed LLM WM output

- commitKeepRecentCount: keep recent messages live after commit

- WM v2 prompt templates (ov_wm_v2.yaml, ov_wm_v2_update.yaml)

- CommitRequest model with keep_recent_count parameter

* fix(wm): address 4 code review findings

- Replace hardcoded debug log path with configurable workspace path

- Add _rebuild_pending_tokens() after _update_message_in_jsonl()

- Detect WM v2 format via _is_wm_v2 to route legacy sessions to creation path

- Pass latest_archive_overview to creation template for legacy-aware bootstrapping

* test(wm): add unit tests for WM v2 guards, growth, and merge guardrails

- 62 tests for section guards, regex recovery, pending_tokens, merge logic

- 6 tests for anti-bloat growth behavior (dedup, capping, consolidation)

- 3 tests for dynamic reminders, key facts consolidation, and URL pruning guard

* feat(plugin): WM v2 plugin integration + ov_archive_search tool

- Add ov_archive_search tool for keyword-grep across session archives

- Add grepSessionArchives() client method for /api/v1/search/grep endpoint

- Rewrite system prompt to describe WM v2 structured sections

- Simplify archive index assembly (remove preAbstracts/budget processing)

- Add keepRecentCount to commitSession calls (afterTurn=cfg, compact=0)

- Add commitKeepRecentCount to plugin config schema

* fix(wm): post-feature refinements for WM v2

- Replace _wm_debug file logging with logger.debug
- Defensive clamps for pending_tokens / keep_recent_count
- Include tool/context parts in WM generation formatting
- Limit Open Issues anti-drift restore to one round (allow stale resolution)
- Resolve commitSession merge conflict in plugin
- Edge case tests + plugin tests update

* fix(wm): restore Phase 2 request tracking, archive_uri, and agentId

* docs(wm): add WM v2 design overview

---------

Co-authored-by: wlff123 <wlff123@users.noreply.github.com>
2026-05-02 22:09:59 +08:00
AutoCoder 4d6f5b65bd fix(openclaw): route auto recall through assemble (#1835) 2026-05-01 16:39:32 +08:00
bot-of-qin-ctxandqin-ctx 9c08d716ca fix(openclaw): treat agent_prefix as prefix only (#1809)
* fix(openclaw): treat agent_prefix as prefix only

* fix(openclaw): treat agent_prefix as prefix only

---------

Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
2026-04-29 22:42:56 +08:00
Qin Haojie 08dcfc10ac fix(openclaw-plugin): stop synthesizing tenant headers (#1789) 2026-04-29 11:49:37 +08:00
LinQiang391 dac750e144 refactor(openclaw-plugin): remove local mode and rename agentId to agent_prefix (#1783)
Made-with: Cursor
2026-04-28 22:42:49 +08:00
Eurakaxun 16c0bfe76f fix(openclaw-plugin): use character budget for auto recall (#1740) 2026-04-28 18:57:25 +08:00
r266-tech 670a69c550 docs(openclaw-plugin): sync recall placeholder defaults to 5000/8000 (#1638)
PR #1617 (merged 2026-04-22 by qin-ctx) raised DEFAULT_RECALL_MAX_CONTENT_CHARS
from 500 to 5000 and DEFAULT_RECALL_TOKEN_BUDGET from 2000 to 8000 (validated on
locomo-small: 65.7% -> 88.6% accuracy). openclaw.plugin.json UI hints still
showed the old values, so users opening the plugin config panel see "500" and
"2000" as suggested defaults while the effective runtime value is now 5000/8000.

Refs: #1617
2026-04-25 17:45:55 +08:00
x__dotandjohnny ef2513c3e7 feat(openclaw-plugin): align auth, namespace, and role id handling (#1606)
* feat(plugin): multi-tenant identity, agent scope mode, and resource recall

Made-with: Cursor

* fix(openclaw-plugin): avoid default tenant fallback

* feat(openclaw-plugin): add server auth mode handling

* feat(openclaw-plugin): add server auth mode and canonical namespace config

* feat(openclaw-plugin): propagate sender role id in session writes

* test(openclaw-plugin): add multi-tenant coverage and Chinese report

* docs(openclaw-plugin): update Chinese multi-tenant docs

* fix(openclaw-plugin): align default namespace policy and shared role id logic

* test(auth): drop unintended test_auth changes from plugin PR

* fix(openclaw-plugin): preserve tenant headers for api key root flows

---------

Co-authored-by: johnny <1667704220@qq.com>
2026-04-21 16:02:06 +08:00
LinQiang391 09bb76cf61 feat: add ClawHub publishing, setup wizard, and OPENCLAW_STATE_DIR support (#1587)
Made-with: Cursor
2026-04-21 11:27:46 +08:00
AutoCoder 98b47904ee Remove ingestReplyAssist feature and all related config, logic, and tests (#1564)
Made-with: Cursor
2026-04-18 14:02:16 +08:00
Mingjian QueandGPT-5.4 7bcdb85647 feat(openclaw-plugin): add bypass session patterns (#1194)
Co-authored-by: GPT-5.4 <noreply@openai.com>
2026-04-03 10:30:18 +08:00
Mingjian QueandGPT-5.4 27f61889bf feat(openclaw-plugin): add session-pattern guard for ingest reply assist (#1136)
Co-authored-by: GPT-5.4 <noreply@openai.com>
2026-03-31 22:27:07 +08:00
LinQiang391 df632107f5 feat(openclaw-plugin): align agent routing and reduce default log noise; fix(system/status): align resolved user id (#1054) 2026-03-28 19:32:50 +08:00
6d26e7a4fa refactor(openclaw-plugin): Unified session APIs and refactored the OpenClaw context pipeline for more consistent behavior, better maintainability, and stronger test coverage. (#1040)
* feat(openclaw-plugin): unify context assembly and compaction workflows

Co-authored-by: wlff123 <wulf234@163.com>
Co-authored-by: Eurekaxun <eurekaxun@163.com>
Co-authored-by: lin-qiang123 <1667704220@qq.com>
Co-authored-by: jcp0578 <jcp0578@gmail.com>

* feat(openviking-server): unify session context and commit APIs

Authored-by: Qin Haojie <qinhaojie.exe@bytedance.com>

* set default value of DEFAULT_EMIT_STANDARD_DIAGNOSTICS to false

---------

Co-authored-by: Eurekaxun <eurekaxun@163.com>
Co-authored-by: lin-qiang123 <1667704220@qq.com>
Co-authored-by: jcp0578 <jcp0578@gmail.com>
Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
2026-03-28 10:41:03 +08:00
3b5b9a42c0 feat(openclaw-plugin):context engine refactor design & enforce token budget and reduce context bloat (#891)
* fix(openclaw-plugin): enforce token budget and reduce context bloat (#730) (#796)

* test(openclaw-plugin): add vitest test infrastructure for #730

* fix(openclaw-plugin): raise recallScoreThreshold default from 0.01 to 0.15 (#730)

* fix(openclaw-plugin): narrow isLeafLikeMemory boost to level-2 only (#730)

* fix(openclaw-plugin): prefer abstract over full content fetch in memory injection (#730)

* feat(openclaw-plugin): add recallMaxContentChars and recallPreferAbstract config (#730)

* feat(openclaw-plugin): enforce tokenBudget in injection with decrement loop (#730)

* fix(openclaw-plugin): update recallScoreThreshold placeholder to match new default (#730)

* fix(openclaw-plugin): deduplicate content resolution and document budget behavior (#730)

Extract resolveMemoryContent() helper to eliminate duplicate content-resolution
logic between buildMemoryLines and buildMemoryLinesWithBudget. Add JSDoc and
inline comment documenting intentional first-line budget overshoot (spec §6.2).
Tighten test assertion from <=120 to <=106 tokens.

* fix(openclaw-plugin): use truthy fallback for empty abstract strings (#730)

Change nullish coalescing (??) to truthy fallback (||) in
resolveMemoryContent() so empty-string abstracts fall back to item.uri
instead of producing empty content lines.

* docs: add openclaw context engine refactor design

Co-authored-by: Mijamind <mijamind@163.com>
Co-authored-by: GPT-5.4 <noreply@openai.com>

* add afterTurn refactor in design_doc

* add afterTurn compact in design_doc

---------

Co-authored-by: chethanuk <chethanuk@outlook.com>
Co-authored-by: GPT-5.4 <noreply@openai.com>
Co-authored-by: wlff123 <wulf234@163.com>
Co-authored-by: xuwengui <huangxun375@gmail.com>
2026-03-23 15:40:15 +08:00
Mingjian QueandGPT-5.4 f93d10523b feat(openclaw-plugin 2.0): from memory plugin to context engine (#662)
* feat(openclaw-context-plugin): migrate OpenViking memory plugin to context engine

1. Rename the OpenClaw plugin from memory-openviking to openclaw-context-plugin and switch its kind from memory to context-engine.
2. Keep auto-recall and ingest-reply-assist on before_prompt_build to preserve the existing prompt injection behavior.
3. Move the canonical auto-capture flow from the old agent_end-style lifecycle to ContextEngine afterTurn.
4. Delegate compact handling to the legacy compact engine when it is available, so existing compaction behavior can still be reused.
5. Preserve the OpenViking tools and local process management while updating setup helpers, installers, docs, and OpenClaw config paths to plugins.slots.contextEngine.

Co-authored-by: GPT-5.4 <noreply@openai.com>

* refactor(openclaw-context-plugin): rename plugin id to context-openviking

- rename the runtime plugin id, package name, install destination, and OpenClaw config keys from openclaw-context-plugin to context-openviking
- keep the source directory at examples/openclaw-context-plugin unchanged while updating docs, installers, and setup helpers to use the new runtime name
- remove unused sys imports from the demo scripts so ruff check stays green

---------

Co-authored-by: GPT-5.4 <noreply@openai.com>
2026-03-18 21:10:20 +08:00