OpenViking icon indicating copy to clipboard operation
OpenViking copied to clipboard

[Bug] v0.4.19 restricted DSL rejects experience content.edit() — extraction can no longer split/maintain large memories

Open xbyzr opened this issue 2 months ago • 2 comments

Environment: v0.4.19 (pip install), Ubuntu 24.04, Python 3.12, local deployment.

Since 0.4.17 → 0.4.19, Phase-2 memory extraction repeatedly fails with:

Failed to parse memory operations (iteration 2/2)
failure_kind=parse_error
error=Line 1: field 'content' does not support edit()/drop()

Pattern: it happens whenever the extraction model tries to split or trim a large accumulated experience (e.g. a counter-style experience that has grown many repeated appended entries over weeks). The emitted operation experiences_1.content.edit(...) is rejected by the restricted Python DSL extraction protocol (default since #4581).

Frequency: ~9/day on our deployment and accelerating (~55 in the last two days).

Impact: no data is lost, but experiences cannot self-maintain: split/merge/trim attempts on grown experiences consistently fail at parse time, so they stay bloated indefinitely. The only working workaround is delete-and-re-add from outside.

Questions: is content.edit() on experiences intentionally unsupported in the restricted DSL? Is there a sanctioned operation for splitting/trimming an existing memory? If not, could one be added (or the replacement documented) so the extraction loop can still groom memories? Happy to test any fix.

xbyzr avatar Sep 26 '26 14:09 xbyzr

Thanks for reporting this! This is the same prompt/operation mismatch tracked in #5176, and the fix has been merged in #5180.

Experience content uses whole-field replacement, so content.edit() and content.drop() are intentionally unsupported. The bug was that the extraction prompt recommended those methods too broadly. The supported way to trim an existing experience is:

experiences_1.content.update("""Complete revised content, including anything that should be preserved""")

Splitting can update the original experience and create additional experiences; it does not require deleting and re-adding the memory externally.

#5180 aligns the prompt with these rules and includes a valid update() example in the error fed back to the model for its retry. It does not change the experience schema or enable edit()/drop() on replacement fields.

The fix is on main, but is not included in v0.4.22, the latest release at the time of this reply. Closing as resolved by #5180.

qin-ctx avatar Sep 28 '26 12:09 qin-ctx

Thanks for the clear answer — content.update() (whole-field replacement) as the supported operation makes sense. We'll retest once a release containing #5180 lands.

One data point that may interest you for #5403: the failed content.edit() attempts also appear to leak empty .md-named directories into memories/experiences/ (212 accumulated over ~10 days on our deployment). Those orphans then break snapshot git_commit ("vfs: plugin error: is a directory"). So the rejected operations may be leaking cleanup-wise — worth a look at the exception path after a parse failure.

xbyzr avatar Sep 28 '26 12:09 xbyzr