refactor(schema): simplify session fragment state#35272
Open
kitlangton wants to merge 2 commits into
Open
Conversation
e02bc3a to
d5ca70f
Compare
6d69939 to
e263664
Compare
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.
Closes #35019.
Summary
Simplifies V2 assistant fragment and provider-continuation state while preserving provider-native correlation inside
@opencode-ai/llm.textID/reasoningIDfrom session events and projected text/reasoning parts.response.output_text.done/ completed message-item boundaries.providerMetadatawith un-nestedstate/resultStateevent payloads.providerState/providerResultState, withexecutedtop-level.session.tool.called;session.tool.input.started.nameremains authoritative.session.compaction.deltaevents and renders the streaming summary in the TUI.session.revert.committed.messageIDtoto.Provider state is extracted using the route provider (
model.provider, e.g.openai) rather than the catalog provider identity, then re-nested only when replaying history through the same model.Fragment premise
The adapter audit found no provider-valid overlapping text/reasoning fragments in Anthropic or Bedrock recordings/contracts. OpenAI Responses appeared overlapping because completed text blocks were left open until response finish; this PR closes them at their real done boundaries and adds a sequential-message regression test. Provider block IDs remain internal to
packages/llm.Persistence
20260703200000_reset_v2_event_fragmentsclears V2 events, sequences, projected messages, and admitted inputs. Changed durable contracts restart at version 1.Verification
Base #35271 is a one-file test isolation prerequisite; this PR's product diff is otherwise independent.