Skip to content

feat(openclaw-plugin): compress oversized tool results during context assembly#1014

Open
yjjheizhu wants to merge 1 commit intovolcengine:mainfrom
yjjheizhu:feat/openclaw-tool-context-compression
Open

feat(openclaw-plugin): compress oversized tool results during context assembly#1014
yjjheizhu wants to merge 1 commit intovolcengine:mainfrom
yjjheizhu:feat/openclaw-tool-context-compression

Conversation

@yjjheizhu
Copy link

Summary

  • compress oversized toolResult messages during OpenClaw context-engine assemble()
  • keep session transcripts unchanged while shrinking the prompt actually sent to the model
  • add plugin config and UI/schema support for tool-context compression tuning

What changed

  • add tool-result compression helpers in examples/openclaw-plugin/context-engine.ts
  • wire compression into assemble() before returning context messages
  • add config fields in config.ts
  • add matching uiHints and configSchema fields in openclaw.plugin.json

Default behavior

  • enabled for oversized results from exec, process, web_fetch, and browser
  • keeps key error/warn lines and essential metadata
  • leaves read disabled by default to avoid hiding useful file content
  • does not rewrite transcript history; only affects assembled context

Notes

  • this PR intentionally does not include our separate local-startup improvements, to keep scope focused on context compression
  • our local validation showed large prompt-size savings after compression during assemble()

@CLAassistant
Copy link

CLAassistant commented Mar 26, 2026

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

Failed to generate code suggestions for PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants