Commit Graph
31 Commits
Author SHA1 Message Date
t0saki 33043cb1b8 feat(plugins): expose session commit trace IDs (#3977)
Preserve result.trace_id across plugin HTTP wrappers, include it in commit success and failure logs, and surface it in user-visible commit confirmations where supported.
2026-08-13 23:29:41 +08:00
huangruitengandhuangruiteng 092ec1db6d fix(openclaw): send peer_id for session messages (#3115)
Co-authored-by: huangruiteng <huangruiteng@bytedance.com>
2026-07-10 15:06:40 +08:00
Carateffee 1a11b1ba3d fix(openclaw-plugin): support config headers (#3044) 2026-07-07 13:42:55 +08:00
Qin Haojie fba6450abe fix(session): mark no-op commits as skipped (#2931) 2026-07-01 21:13:24 +08:00
Mingjian Que d9e40b0974 refactor(openclaw): add setup and routing modules (#2654)
* refactor(openclaw): add setup and routing modules

* docs(openclaw): align docs and healthcheck with peer routing

* refactor(openclaw): wire modular runtime into core

* fix(openclaw): package plugin runtime directory
2026-06-17 10:26:23 +08:00
Qin HaojieandMijamind719 8353976bc8 feat(plugins): use actor peer scope (#2595)
* feat(plugins): use actor peer scope

* docs(openclaw): clarify actor peer recall scope

---------

Co-authored-by: Mijamind719 <mijamind@163.com>
2026-06-14 10:15:27 +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
Qin Haojie e06671b351 feat(session): 将 session 存储到 user 命名空间 (#2556)
* feat(session): store sessions in user namespace

* fix(session): tolerate legacy commit body fields
2026-06-11 14:33:00 +08:00
Qin Haojie a6fc0424bc fix(session): apply memory type policy whitelist (#2530)
* fix(session): apply memory type policy whitelist

Restore top-level memory_types filtering for session memory extraction and validate it against enabled registry schemas. Ensure initialization and peer-aware smoke coverage honor the whitelist.

* fix(session): scope session skills to execution memory policy

* refactor(session): remove per-commit memory policy
2026-06-10 14:54:24 +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
MaojiaSheng 57b2e2a00e fix(openclaw-plugin): authenticate auto-recall health precheck (#2384)
Reuse the OpenViking client for auto-recall prechecks so remote /health probes carry the same auth and tenant headers as normal requests, preventing false recall skips behind authenticated gateways.
2026-06-02 16:07:38 +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
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
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
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
chenjwandClaude Opus 4.6 c430b97493 Fix/openclaw addmsg (#1391)
* fix(ragfs): localfs write should respect WriteFlag to truncate file

The localfs write implementation was ignoring the WriteFlag parameter and
not truncating the file when WriteFlag::Create or WriteFlag::Truncate was
specified. This caused files to be appended instead of overwritten when
writing empty content.

Root cause: The _flags parameter was declared but never used. When opening
an existing file, .truncate(true) was not called.

Fix: Use OpenOptions::new().truncate(should_truncate) based on the flags.

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

* fix(session): clear messages.jsonl after commit and improve memory extraction

- Add workaround to delete messages.jsonl before writing to work around
  RAGFS localfs not truncating files (now fixed in ragfs)
- Add _get_latest_archive_last_msg_time to filter messages for memory
  extraction by timestamp
- Fix memory extraction to only process new messages after last archive

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

* update

* fix(openclaw): add HEARTBEAT filtering in sanitizeUserTextForCapture

过滤 HEARTBEAT 健康检查消息,避免 HEARTBEAT.md 和 HEARTBEAT_OK
进入 session 存档。

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

* revert: restore logger.warn instead of warnOrInfo

Reverting to use logger.warn directly. The warnOrInfo wrapper was
unnecessary as logger always has warn method.

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

* chore(session): remove RAGFS truncate workaround

The ragfs localfs write now respects WriteFlag to truncate files,
so the workaround to delete messages.jsonl before writing is no
longer needed.

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

* refactor(openclaw): unify addSessionMessage with parts API

- Remove old addSessionMessage (string content)
- Keep addSessionMessage but accept parts array
- Update index.ts and context-engine.ts to use new format
- Update tests to check parts structure

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

* fix(openclaw): use optional chaining for logger.warn

TypeScript strict mode requires handling possibly undefined warn method.

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

* feat(openclaw): log trace_id from commit results

Add trace_id to CommitSessionResult type and log it for all
commitSession calls (afterTurn, commitOVSession, compact).

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

* fix(openclaw): add tool_input to tool parts

- Add toolInput field to ExtractedMessage type
- Extract tool_input from msg.toolInput in extractNewTurnMessages
- Pass tool_input when constructing tool parts for addSessionMessage

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

* fix(openclaw): lookup toolInput from preceding toolUse messages

When extracting toolResult messages, look up the corresponding toolInput
from the preceding assistant messages' toolUse blocks using toolCallId/
toolUseId as the key.

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

* fix(openclaw): add more field name variations for toolInput/toolCallId

Support additional field names: arguments, toolInput, tool_call_id

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

* fix(openclaw): lookup toolInput from preceding toolCall messages

- Scan all messages to find toolCall/toolUse/tool_call blocks
- Extract tool input from arguments/input/toolInput fields
- Match toolResult with toolCall using toolCallId/toolUseId

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

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-14 14:03:04 +08:00
yeyitechandyeyitech 054c998971 fix(openclaw-plugin): extend phase2 commit wait timeout (#1415)
Co-authored-by: yeyitech <yeyitech@users.noreply.github.com>
2026-04-14 11:43:26 +08:00
x__dot 23f0775ab5 feat(openclaw-plugin): add unified ov_import and ov_search (#1369) 2026-04-12 22:16:22 +08:00
AutoCoder ed78b5feff add create time in add_message (#1288) 2026-04-08 10:12:37 +08:00
Qin Haojie c0b0be4f4c fix(session): align async commit API docs and examples (#1188)
Update docs, tests, and example integrations to reflect accepted + task_id
session commits with task polling for completed results.

Also fix the local PR-Agent model provider prefix in .pr_agent.toml.
2026-04-02 21:09:01 +08:00
Qin Haojie 0502a9903d fix(session): fold latest archive into abstract list (#1104)
Return the latest archive through pre_archive_abstracts and drop the
separate latest_archive_id field so session context consumers only need
one archive index path.
2026-03-31 15:06:21 +08:00
bot-of-qin-ctx 303cf40955 Revert "feat(examples): mark recalled memories as used (#1079)" (#1090)
This reverts commit 7122c3c7f7.
2026-03-30 16:49:46 +08:00
Brian Le 7122c3c7f7 feat(examples): mark recalled memories as used (#1079) 2026-03-30 11:24:57 +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
Qin Haojie d8858afad6 Revert "feat(openclaw-plugin): add archive-aware context assembly and async s…" (#953)
This reverts commit 08b278da81.
2026-03-25 11:35:20 +08:00
08b278da81 feat(openclaw-plugin): add archive-aware context assembly and async session commit (#938)
* feat(session): make commit two-phase with async memory extraction

Session commit now returns immediately after archiving messages (Phase 1).
Summary generation and memory extraction (Phase 2) run in the background
via asyncio.create_task(), returning a task_id for polling progress.

- Add get_task() API across all client layers for querying background task status
- get_session() auto-creates session if it does not exist
- Remove wait parameter and telemetry from commit endpoint
- Add .done completion marker to archive directories
- Update docs (EN/ZH) and tests for new two-phase flow

* feat(session): add .meta.json persistence and auto_create control for get_session

SessionService.get() now defaults to auto_create=False, raising NotFoundError
for missing sessions. A new SessionMeta dataclass tracks created_at, updated_at,
message_count, commit_count, memories_extracted (by category), last_commit_at,
and cumulative llm_token_usage. Meta is persisted to .meta.json and updated on
add_message, commit Phase 1 (message clear), and commit Phase 2 completion
(token usage, memory counts via bind_telemetry). All client layers
(local/async/sync/HTTP) and API docs updated accordingly.

* fix: remove session vectorize

* support commit for openclaw-plugin

Made-with: Cursor

* feat(openclaw-plugin): archive-aware context assembler with lazy-read optimization

- Implement get_context_for_assemble with token-budget-aware archive trimming
- Write .meta.json during commit for pre-stored token counts
- Lazy-read archives from newest to oldest, skip old archives when budget exhausted
- Backward-compatible: fall back to reading overview for old archives without .meta.json
- Pass agentId through getContextForAssemble in client.ts
- Use sessionKey from OpenClaw in assemble to match afterTurn session resolution
- Emit non-error toolResult for pending/running tools instead of synthetic error
- Log warning and mark stats on ls(history) failure instead of silent swallow

* refactor(openclaw-plugin): unify OV session identity to sessionId

Made-with: Cursor

* feat(openclaw-plugin): add memory chain integration test script

Made-with: Cursor

* add test and desc of openclaw-plugin

* change commit to async

---------

Co-authored-by: qin-ctx <qinhaojie.exe@bytedance.com>
Co-authored-by: wlff123 <wulf234@163.com>
Co-authored-by: Eurekaxun <eurekaxun@163.com>
Co-authored-by: lin-qiang123 <1667704220@qq.com>
2026-03-24 23:40:32 +08:00
Qin HaojieClaude Opus 4.6AutoCoder
2c598e88c5 feat(session): async commit, session metadata, and archive continuity threading (#900)
* feat(session): make commit two-phase with async memory extraction

Session commit now returns immediately after archiving messages (Phase 1).
Summary generation and memory extraction (Phase 2) run in the background
via asyncio.create_task(), returning a task_id for polling progress.

- Add get_task() API across all client layers for querying background task status
- get_session() auto-creates session if it does not exist
- Remove wait parameter and telemetry from commit endpoint
- Add .done completion marker to archive directories
- Update docs (EN/ZH) and tests for new two-phase flow

* feat(session): add .meta.json persistence and auto_create control for get_session

SessionService.get() now defaults to auto_create=False, raising NotFoundError
for missing sessions. A new SessionMeta dataclass tracks created_at, updated_at,
message_count, commit_count, memories_extracted (by category), last_commit_at,
and cumulative llm_token_usage. Meta is persisted to .meta.json and updated on
add_message, commit Phase 1 (message clear), and commit Phase 2 completion
(token usage, memory counts via bind_telemetry). All client layers
(local/async/sync/HTTP) and API docs updated accordingly.

* fix: remove session vectorize

* support commit for openclaw-plugin (#902)

Made-with: Cursor

* fix: reuse latest archive overview in session context

Thread the latest completed archive overview into archive summary generation and memory extraction, and simplify search context assembly to current messages plus the latest archive overview.

Co-Authored-By: Claude Opus 4.6

* refactor: session overview

---------

Co-authored-by: AutoCoder <wulf234@163.com>
2026-03-24 22:30:16 +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