mirror of
https://github.com/sst/opencode.git
synced 2025-12-23 10:11:41 +00:00
fix: anthropic reasoning
This commit is contained in:
parent
4bf0541bd6
commit
dd10460c2b
3 changed files with 12 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
|||
"$schema": "https://opencode.ai/config.json",
|
||||
"mcp": {
|
||||
"weather": {
|
||||
"enabled": false,
|
||||
"type": "local",
|
||||
"command": ["opencode", "x", "@h1deya/mcp-server-weather"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -549,6 +549,15 @@ export namespace MessageV2 {
|
|||
},
|
||||
]
|
||||
}
|
||||
if (part.type === "reasoning") {
|
||||
return [
|
||||
{
|
||||
type: "reasoning",
|
||||
text: part.text,
|
||||
providerMetadata: part.metadata,
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
return []
|
||||
}),
|
||||
|
|
|
|||
|
|
@ -853,6 +853,7 @@ export namespace SessionPrompt {
|
|||
if (value.id in reasoningMap) {
|
||||
const part = reasoningMap[value.id]
|
||||
part.text += value.text
|
||||
if (value.providerMetadata) part.metadata = value.providerMetadata
|
||||
if (part.text) await Session.updatePart(part)
|
||||
}
|
||||
break
|
||||
|
|
@ -861,7 +862,7 @@ export namespace SessionPrompt {
|
|||
if (value.id in reasoningMap) {
|
||||
const part = reasoningMap[value.id]
|
||||
part.text = part.text.trimEnd()
|
||||
part.metadata = value.providerMetadata
|
||||
|
||||
part.time = {
|
||||
...part.time,
|
||||
end: Date.now(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue