Parcourir la source

fix: title gen w/ gpt-5-nano (#2473)

Aiden Cline il y a 5 mois
Parent
commit
93c2f5060e
1 fichiers modifiés avec 14 ajouts et 5 suppressions
  1. 14 5
      packages/opencode/src/session/index.ts

+ 14 - 5
packages/opencode/src/session/index.ts

@@ -696,13 +696,22 @@ export namespace Session {
     ).length
     ).length
     if (numRealUserMsgs === 1 && !session.parentID && isDefaultTitle(session.title)) {
     if (numRealUserMsgs === 1 && !session.parentID && isDefaultTitle(session.title)) {
       const small = (await Provider.getSmallModel(model.providerID)) ?? model
       const small = (await Provider.getSmallModel(model.providerID)) ?? model
+      const options = {
+        ...ProviderTransform.options(small.providerID, small.modelID, input.sessionID),
+        ...small.info.options,
+      }
+      if (small.providerID === "openai") {
+        options["reasoningEffort"] = "minimal"
+      }
+      if (small.providerID === "google") {
+        options["thinkingConfig"] = {
+          thinkingBudget: 0,
+        }
+      }
       generateText({
       generateText({
-        maxOutputTokens: small.info.reasoning ? 1024 : 20,
+        maxOutputTokens: small.info.reasoning ? 1500 : 20,
         providerOptions: {
         providerOptions: {
-          [model.providerID]: {
-            ...small.info.options,
-            ...ProviderTransform.options(small.providerID, small.modelID, input.sessionID),
-          },
+          [model.providerID]: options,
         },
         },
         messages: [
         messages: [
           ...SystemPrompt.title(model.providerID).map(
           ...SystemPrompt.title(model.providerID).map(