Uh oh!
There was an error while loading. Please reload this page.
fix(session): coerce legacy string tool-part input - #44705
Open
LovePlayCode wants to merge 3 commits into
Open
Conversation
Upgrades from 1.14 stored tool state.input as a JSON string, which made GET /session/:id/message fail schema encode for the whole transcript. Co-authored-by: Cursor <cursoragent@cursor.com>
Contributor
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found one potentially related PR: PR #44535 - This PR is related because it also addresses tool-part handling in sessions, though it focuses on preventing creation of phantom tool parts rather than coercing legacy string inputs. The other PRs found (like #37541 and #41830) address broader session message encoding and structure, but are less directly related to the specific legacy string coercion issue that PR #44705 is fixing. |
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 freeto 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.
Issue for this PR
Closes#44688
Type of change
What does this PR do?
1.14 stored some tool-part
state.inputvalues as JSON strings. 1.18 encodes messages withSchema.Record, soGET /session/:id/message400s the whole transcript.Hydrate now parses those strings (invalid JSON / non-objects become
{}). A data migration rewrites the storedpartrows the same way.How did you verify your code works?
bun typecheckinpackages/coreandpackages/opencodebun test test/session/message-v2.test.tsinpackages/opencode(hydrate + HTTP encode)bun test test/database-migration.test.tsinpackages/core(SQL backfill)Screenshots / recordings
If this is a UI change, please include a screenshot or recording.
Checklist
Made with Cursor