Skip to content

fix(openclaw-plugin): use plugin-sdk exports for compaction delegation (fixes #833) openclaw ≥ v2026.3.22#1000

Merged
Mijamind719 merged 2 commits intovolcengine:mainfrom
jcp0578:feat/session-context-api
Mar 27, 2026
Merged

fix(openclaw-plugin): use plugin-sdk exports for compaction delegation (fixes #833) openclaw ≥ v2026.3.22#1000
Mijamind719 merged 2 commits intovolcengine:mainfrom
jcp0578:feat/session-context-api

Conversation

@jcp0578
Copy link
Copy Markdown
Contributor

@jcp0578 jcp0578 commented Mar 26, 2026

变更说明

继续委托 OpenClaw context engine 中的 compact 逻辑,不过从旧的内部模块路径切换为 OpenClaw 当前公开导出的 plugin-sdk 入口。

原来尝试导入的是:

  • openclaw/context-engine/legacy
  • openclaw/dist/context-engine/legacy.js

现在改为:

  • openclaw/plugin-sdk/core
  • openclaw/plugin-sdk

版本兼容说明

仅支持openclaw ≥ v2026.3.22,后续正式接管compact后可实现全版本支持

相关ISSUE

Fixes #833

主要修改

  • 将 compact 委托入口切换到 plugin-sdk 导出
  • 将辅助函数 tryLegacyCompact 重命名为 tryDelegatedCompact
  • 更新 compact 相关日志和 reason:
    • legacy_compact_* -> delegate_compact_*
  • 优化 delegate 不可用时的原因提示文案

修改原因

原来的实现依赖 OpenClaw 的内部模块路径,在当前运行时下可能因为 package exports 限制导致导入失败。
改为使用 plugin-sdk 的公开导出,可以减少对内部实现路径的依赖,兼容当前 OpenClaw 版本。

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Mar 26, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link
Copy Markdown

Failed to generate code suggestions for PR

@jcp0578
Copy link
Copy Markdown
Contributor Author

jcp0578 commented Mar 26, 2026

Fixes #833

@jcp0578 jcp0578 changed the title Feat/session context api - compact改用OpenClaw公开的plugin-sdk接口 fix(openclaw-plugin): use plugin-sdk exports for compaction delegation Mar 26, 2026
@jcp0578 jcp0578 changed the title fix(openclaw-plugin): use plugin-sdk exports for compaction delegation [WIP]fix(openclaw-plugin): use plugin-sdk exports for compaction delegation (fixes #833) Mar 26, 2026
@jcp0578 jcp0578 changed the title [WIP]fix(openclaw-plugin): use plugin-sdk exports for compaction delegation (fixes #833) fix(openclaw-plugin): use plugin-sdk exports for compaction delegation (fixes #833) Mar 27, 2026
@Mijamind719 Mijamind719 changed the title fix(openclaw-plugin): use plugin-sdk exports for compaction delegation (fixes #833) fix(openclaw-plugin): use plugin-sdk exports for compaction delegation (fixes #833) openclaw ≥ v2026.3.22 Mar 27, 2026
@Mijamind719 Mijamind719 merged commit f5dd276 into volcengine:main Mar 27, 2026
2 checks passed
@github-project-automation github-project-automation bot moved this from Backlog to Done in OpenViking project Mar 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Question]: 安装启用openviking以后 传统的/compact命令就无法使用了吗?那我想要压缩上下文怎么办?

3 participants