@opencode/ai 0.0.0-dev-1299 → 0.0.0-dev-1302
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -418,6 +418,9 @@ const lowerAssistantMessage = Effect.fnUntraced(function* (message, configuredFi
|
|
|
418
418
|
})();
|
|
419
419
|
const opaque = reasoningOpaque(reasoning, options.providerMetadataKey);
|
|
420
420
|
const reasoningText = reasoning.length === 0 || (opaque !== undefined && text === "") ? (requireReasoning ? "" : undefined) : text;
|
|
421
|
+
// A model that declares a different reasoning field reads reasoning there, so structured details and opaque values
|
|
422
|
+
// from earlier turns (including another model served under the same provider metadata key) must not be replayed.
|
|
423
|
+
const replaysStructured = configuredField === undefined || configuredField === "reasoning_details";
|
|
421
424
|
const result = {
|
|
422
425
|
role: "assistant",
|
|
423
426
|
content: (() => {
|
|
@@ -428,10 +431,11 @@ const lowerAssistantMessage = Effect.fnUntraced(function* (message, configuredFi
|
|
|
428
431
|
return content.map((part) => part.text).join("");
|
|
429
432
|
})(),
|
|
430
433
|
...(toolCalls.length > 0 ? { tool_calls: toolCalls } : {}),
|
|
431
|
-
...(details !== undefined ? { reasoning_details: details } : {}),
|
|
432
|
-
...(opaque !== undefined ? { reasoning_opaque: opaque } : {}),
|
|
434
|
+
...(details !== undefined && replaysStructured ? { reasoning_details: details } : {}),
|
|
435
|
+
...(opaque !== undefined && replaysStructured ? { reasoning_opaque: opaque } : {}),
|
|
433
436
|
};
|
|
434
|
-
|
|
437
|
+
// `reasoning_details` is the structured list itself, so scalar text must not be written over it.
|
|
438
|
+
if (field === undefined || reasoningText === undefined || field === "reasoning_details")
|
|
435
439
|
return result;
|
|
436
440
|
return { ...result, [field]: reasoningText };
|
|
437
441
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
|
-
"version": "0.0.0-dev-
|
|
3
|
+
"version": "0.0.0-dev-1302",
|
|
4
4
|
"name": "@opencode/ai",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -624,7 +624,7 @@
|
|
|
624
624
|
"devDependencies": {
|
|
625
625
|
"@clack/prompts": "1.0.0-alpha.1",
|
|
626
626
|
"@effect/platform-node": "4.1.0",
|
|
627
|
-
"@opencode/http-recorder": "0.0.0-dev-
|
|
627
|
+
"@opencode/http-recorder": "0.0.0-dev-1302",
|
|
628
628
|
"@tsconfig/bun": "1.0.9",
|
|
629
629
|
"@types/bun": "1.4.3",
|
|
630
630
|
"@typescript/native": "npm:typescript@7.1.0-beta",
|
|
@@ -634,7 +634,7 @@
|
|
|
634
634
|
"@aws-sdk/credential-providers": "3.1057.0",
|
|
635
635
|
"@smithy/eventstream-codec": "4.2.14",
|
|
636
636
|
"@smithy/util-utf8": "4.2.2",
|
|
637
|
-
"@opencode/schema": "0.0.0-dev-
|
|
637
|
+
"@opencode/schema": "0.0.0-dev-1302",
|
|
638
638
|
"aws4fetch": "1.0.20",
|
|
639
639
|
"effect": "4.1.0",
|
|
640
640
|
"google-auth-library": "10.5.0"
|