Repository navigation
fix(opencode): preserve tool results and validate native input - #3
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 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.
OpenCode v2 tool results previously reordered interleaved captions/images and collapsed text segments without reporting losses. Structured tool errors silently lost their type/status/response, and malformed native control/session fields could pass after projection.
Preserve ordered portable tool blocks in capable destinations; count flattening in legacy OpenCode/Kilo. Count omitted structured-error fields separately without copying diagnostics into opaque metadata. Validate original native fields and control variants before dropping or defaulting them. Include the review reproductions and a cold-export checkpoint regression in the existing native CI gate.
Validation: 1744 passed, 55 skipped locally with stock OpenCode2.0.22, Python3.14.4 and isolated HOME/XDG. Independent review approved with 542 passes, zero skips. Ruff, shell/diff checks, wheel/sdist build and five new native cases importing the built wheel passed. The 55 skips are unavailable exact historical clients or opt-in private-store gates. Local stock2.0.23 and Windows execution remain unvalidated; this PR runs the existing exact stock2.0.23 CI gate.
Same adapter correction published for upstream review in xhluca/session-migrate#17, commit
2e3671dcf402159bcb456380409a103cfaaf19cf. No changes to profiles, migration UI or global installation in this diff.