Skip to content

fix(openclaw): wire recallEventsDecayProtection into auto-recall - #6875

Open
ydflow wants to merge 1 commit into
volcengine:mainfrom
ydflow:fix/openclaw-recall-events-decay-protection
Open

ydflow wants to merge 1 commit into
volcengine:mainfrom
ydflow:fix/openclaw-recall-events-decay-protection

Conversation

@ydflow

@ydflow ydflow commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Problem

#6390 forwarded an event time-decay window from recall config (recallEventsDecayProtection, sent as events_time_decay_protection). It works for the harnesses whose callers hand the whole config object to the shared recall core — claude-code and codex, with dsh/pi/opencode resolving the same schema through buildPluginConfig. It does not work for openclaw: that PR updated openclaw's vendored shared/recall-core.mjs, whose buildContextSearchBody already reads cfg.recallEventsDecayProtection, but openclaw's TypeScript layer never passes it — config.ts rejects the key as unknown, client.ts builds its contractConfig field by field without the window, and buildAutoRecallContext sends nothing. Openclaw is now the only host where the decay window cannot be configured at all, so its auto-recall keeps ranking events time-blind: a "scheduled" event outranks a newer terminal-state event on every status question.

Fix

  • config.ts: accept recallEventsDecayProtection (trimmed, default empty), expose it in the config spec.
  • client.ts: accept eventsDecayProtection on SearchContextOptions and map it into the contractConfig, so the shared buildContextSearchBody emits events_time_decay_protection.
  • auto-recall.ts: pass the configured window from buildAutoRecallContext.
  • README/README_CN: document the option.

No shared-core changes: the vendored copy already implements the contract.

Tests

  • tests/ut/config.test.ts: trim + default empty.
  • tests/ut/client.test.ts: events_time_decay_protection lands on the request body; omitted when unset.
  • tests/ut/build-memory-lines.test.ts: end-to-end — configured window reaches the context search call.

tsc --noEmit clean; full vitest suite green (44 files, 828 tests).

Notes

volcengine#6390 forwarded an event time-decay window from recall config for the
harnesses whose callers hand the whole config to the shared recall
core (claude-code, codex), and it updated the vendored shared core in
openclaw-plugin, whose buildContextSearchBody already reads
cfg.recallEventsDecayProtection. But openclaw's TypeScript layer never
passes it: config.ts rejects the key as unknown, client.ts builds its
contractConfig field by field without the window, and buildAutoRecall
Context sends nothing. Openclaw is now the only host where the decay
window cannot be configured at all (dsh and pi resolve it through
buildPluginConfig, opencode and the claude-code/codex entries pass the
whole config, hermes is covered by volcengine#6574).

Wire it through the same layers as the other options: parse
recallEventsDecayProtection (trimmed, default empty), accept
eventsDecayProtection on OpenVikingClient.searchContext and map it
into the contractConfig so the shared buildContextSearchBody emits
events_time_decay_protection, and pass the configured window from
buildAutoRecallContext. Document the option in both READMEs.

Tests: config normalization (trim/default), client body forwarding
and omission, and an end-to-end buildAutoRecallContext assertion that
the configured window reaches the context search.

This branch has not been deployed

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

Labels

agent-plugins Agent harness and plugin integrations

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants