We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97a4106 commit 0b5200bCopy full SHA for 0b5200b
packages/opencode/src/session/index.ts
@@ -1007,7 +1007,13 @@ export namespace Session {
1007
: undefined,
1008
maxRetries: 3,
1009
activeTools: Object.keys(tools).filter((x) => x !== "invalid"),
1010
- maxOutputTokens: outputLimit,
+ maxOutputTokens: Math.max(
1011
+ 1,
1012
+ outputLimit -
1013
+ (input.providerID === "anthropic"
1014
+ ? ((params.options as { thinking?: { budgetTokens?: number } } | undefined)?.thinking?.budgetTokens ?? 0)
1015
+ : 0),
1016
+ ),
1017
abortSignal: abort.signal,
1018
stopWhen: async ({ steps }) => {
1019
if (steps.length >= 1000) {
0 commit comments