Skip to content

V2: simplify assistant content fragment IDs and provider state #35019

Description

@opencode-agent

Summary

Simplify V2 assistant content and provider-state event payloads.

Source discussion: https://discord.com/channels/1391832426048651334/1522263729318658181

Decisions / direction

Fragment lifecycle convention:

*.started // durable boundary: fragment exists
*.delta   // live-only streaming update
*.ended   // durable boundary: final full value

Applies to text, reasoning, tool input, and compaction streaming.

Remove textID and reasoningID unless provider adapters prove multiple text/reasoning fragments can overlap/interleave inside one assistant step. Assistant text/reasoning content parts do not need IDs just for UI keys.

Keep callID for tools because it is real provider/protocol correlation data and tool settlements need it.

Rename provider continuation payloads:

providerMetadata -> state

state is opaque provider-generated continuation/replay data. It is not app/plugin metadata, not provider identity, and should not be nested by provider ID when the owning message/model already determines the provider.

Tool lifecycle accepted

tool.input.started
tool.input.delta
tool.input.ended
tool.called
tool.success / tool.failed

tool.input.delta remains live-only; started/ended/called/settled are durable as appropriate.

Follow-up check

Confirm provider adapters cannot interleave multiple active text/reasoning fragments. If they can, retain a domain fragment ID only where required.

Metadata

Metadata

Assignees

Labels

2.0coreAnything pertaining to core functionality of the application (opencode server stuff)gang-grillDesign topics queued for later group grilling

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions