feat(openclaw): merge inline retain tags with defaults#948
feat(openclaw): merge inline retain tags with defaults#948Aldoustheorchestrator wants to merge 7 commits intovectorize-io:mainfrom
Conversation
|
Heads up on the current red CI: the failing The failure is in Locally, the retain-focused tests for this change pass, and the only failures I have seen are the same pre-existing backfill/symlink-path issue. I would prefer to keep this PR narrowly scoped and fix that CLI portability problem separately unless maintainers want it bundled. |
|
Small, mostly sensible change, but a couple of issues worth addressing before merge. Must-fix
Nits / scope
Looks fine: dedup logic, order preservation (config tags first, per-call tags appended), test for the merged case, type comment update. |
ffa9a0a to
951bb1d
Compare
|
Addressed. The merged-tag behavior has a real runtime caller instead of a test-only option.
That gives the merged-tag behavior a real OpenClaw-side caller: the user message being auto-retained. I also filed #1033 for the separate backfill symlink-path failure so that issue remains tracked independently. Tests run locally:
|
Summary
retainTagswith inline per-message retain tags from user contentWhy
There are two useful retain-tag layers here:
source_system:openclawclient:acmeortype:decisionOpenClaw should support both. Default tags provide consistent source labeling, while per-message tags let retained memories capture immediate context at the moment they are stored.
For OpenClaw, the clean runtime caller is a per-message override: user messages can include an inline retain-tag directive, and auto-retain merges those tags with configured defaults when building the retain request.
What changed
normalizeRetainTags(...)strict: trim, deduplicate, preserve order, and reject non-string values<retain_tags>...</retain_tags><hindsight_retain_tags>...</hindsight_retain_tags>retainTagsfirst, then inline per-message tags[role: ...] ... [role:end]transcript structure intactWhy this shape
This addresses the review concern about the old
options.tagspath having no runtime caller.The caller is now real and production-facing: user messages can provide per-message retain tags, and the auto-retain hook threads those through to
buildRetainRequest(...).Testing
npm test -- src/index.test.tsinhindsight-integrations/openclawFollow-up