Repository navigation
Store a plain JSON copy of tool outputs that carry functions - #1642
Merged
Merged
Conversation
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
On 11-11 at 06:51 UTC a hand-made Postgres connector's
execute_querysucceeded, but its tool-call log row was lost: Prisma refused it withInvalid value for argument toPostgres: We could not serialize [object Function]. A value in the result carried atoPostgresmethod.boundPayloadmeasures the output withJSON.stringify, which drops functions silently, and then returned the original object (same reference) for Prisma to store.boundPayloadnow notices functions (and symbols) while it serializes, through the replacer it already runs, and continues with the plain JSON copy. Outputs without them are unchanged and keep the same reference.Changes
audit/bound-payload.ts: flag functions/symbols duringJSON.stringify; when found, work onJSON.parse(json), for both the small path and the truncated excerpt.audit/bound-payload.spec.ts: a row with atoPostgresfunction comes back as plain JSON, small and truncated.Type
Testing
npx jest src/audit/bound-payload.spec.tsinpackages/backend: 8/8.npx eslinton both files clean. Full checks in CI.Same in Cloud and self-hosted. No schema change, nothing in
ee/.Checklist
npm test) (CI)