Repository navigation
fix(agent): replay legacy memories that resolve to JSON text - #10701
Open
kowshikdev wants to merge 1 commit into
Open
kowshikdev wants to merge 1 commit into
kowshikdev wants to merge 1 commit into
Conversation
An Agent block saved before the messages-array redesign can still carry a `memories` field, which the serializer keeps as a legacy field. The executor redesign (simstudioai#1790) made every reference in a string input resolve to text, so `<getmemory.memories>` now reaches the handler as a JSON string. processMemories only accepted arrays, so it returned nothing and the agent silently ran without the memories. Parse JSON text before reading the memories, and turn structured message content into text, which providers otherwise reject with a 400 (simstudioai#1151). A string `memories` input is now listed as a model-input path, so a secret resolved into it is projected out before the provider request. Fixes simstudioai#1151 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Agent blocks saved before the messages-array redesign can still carry a
memoriesfield, which the serializer keeps as a legacy field. Since the executor redesign (#1790), a reference such as<getmemory.memories>reaches the handler as a JSON string.processMemoriesonly accepted arrays, so those agents silently ran without their memories.memoriesinput as a model-input path, so a secret resolved into it is projected out before the provider request. When the projected text no longer parses as JSON, the memories are dropped (fails closed).Reviewer note: this restores behaviour on a field the editor no longer shows, so affected old workflows will start sending memories again. If you would rather remove the legacy field, I am happy to close this.
Fixes #1151
Type of Change
Testing
Two regression tests in
executor/handlers/agent/handler.test.ts: the memories are replayed, and a secret resolved into them stays out of the model request.Also checked, with this change stacked on
staging(0f6b0d4) together with my other independent fixes, on Windows:bun run type-check: 33/33 packages pass.biome checkon the changed files: no findings.check-block-registry.ts origin/stagingpasses, andbun run generateleaves the tree clean (skills:synccannot run on this checkout, which has no symlinks).bun run check:audits: the 12 audits that fail also fail on a cleanstagingcheckout on this machine (mostly Windows path handling). No additional audit fails.Not run: the full
bun run testsuite, the integration suites (no Docker here), or a live run of the app.Checklist
Screenshots/Videos
N/A
🤖 Generated with Claude Code