fix(opencode): support native OpenAI OAuth fetch (#28571)

This commit is contained in:
Kit Langton
2026-05-20 23:29:25 -04:00
committed by GitHub
parent 2b28cc9024
commit facd207396
9 changed files with 418 additions and 161 deletions

View File

@@ -82,6 +82,7 @@ const OpenAIResponsesToolChoice = Schema.Union([
const OpenAIResponsesCoreFields = {
model: Schema.String,
input: Schema.Array(OpenAIResponsesInputItem),
instructions: Schema.optional(Schema.String),
tools: optionalArray(OpenAIResponsesTool),
tool_choice: Schema.optional(OpenAIResponsesToolChoice),
store: Schema.optional(Schema.Boolean),
@@ -270,7 +271,9 @@ const lowerOptions = Effect.fn("OpenAIResponses.lowerOptions")(function* (reques
const summary = OpenAIOptions.reasoningSummary(request)
const encryptedState = OpenAIOptions.encryptedReasoning(request)
const verbosity = OpenAIOptions.textVerbosity(request)
const instructions = OpenAIOptions.instructions(request)
return {
...(instructions ? { instructions } : {}),
...(store !== undefined ? { store } : {}),
...(promptCacheKey ? { prompt_cache_key: promptCacheKey } : {}),
...(encryptedState ? { include: ["reasoning.encrypted_content"] as const } : {}),

View File

@@ -52,4 +52,9 @@ export const textVerbosity = (request: LLMRequest) => {
return isTextVerbosity(value) ? value : undefined
}
export const instructions = (request: LLMRequest) => {
const value = options(request)?.instructions
return typeof value === "string" ? value : undefined
}
export * as OpenAIOptions from "./openai-options"