fix(core): preserve provider metadata namespaces (#35817)

Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
This commit is contained in:
opencode-agent[bot] 2026-07-07 21:45:58 -05:00 committed by GitHub
commit ed4f833813
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 201 additions and 46 deletions

View file

@ -454,6 +454,34 @@ Recent work
])
})
test("replays flat state under an OpenCode hosted model's route key", () => {
const opencode = ModelV2.Ref.make({ id: ModelV2.ID.make("claude-fable-5"), providerID: ProviderV2.ID.opencode })
const messages = toLLMMessages(
[
SessionMessage.Assistant.make({
id: id("assistant-opencode-reasoning"),
type: "assistant",
agent: build,
model: opencode,
content: [
SessionMessage.AssistantReasoning.make({
type: "reasoning",
text: "Think",
state: { signature: "signed" },
}),
],
time: { created, completed: created },
}),
],
opencode,
"anthropic",
)
expect(messages[0]?.content).toEqual([
{ type: "reasoning", text: "Think", providerMetadata: { anthropic: { signature: "signed" } } },
])
})
test("lowers failed assistant reasoning to text", () => {
const messages = toLLMMessages(
[