Skip to content

Fix GPT-5 Responses API issues with condensing and image support #7067

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/types/src/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ export const modelInfoSchema = z.object({
// Capability flag to indicate whether the model supports an output verbosity parameter
supportsVerbosity: z.boolean().optional(),
supportsReasoningBudget: z.boolean().optional(),
// Capability flag to indicate whether the model supports temperature parameter
supportsTemperature: z.boolean().optional(),
requiredReasoningBudget: z.boolean().optional(),
supportsReasoningEffort: z.boolean().optional(),
supportedParameters: z.array(modelParametersSchema).optional(),
Expand Down
21 changes: 21 additions & 0 deletions packages/types/src/providers/openai.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export const openAiNativeModels = {
description: "GPT-5: The best model for coding and agentic tasks across domains",
// supportsVerbosity is a new capability; ensure ModelInfo includes it
supportsVerbosity: true,
supportsTemperature: false,
},
"gpt-5-mini-2025-08-07": {
maxTokens: 128000,
Expand All @@ -32,6 +33,7 @@ export const openAiNativeModels = {
cacheReadsPrice: 0.03,
description: "GPT-5 Mini: A faster, more cost-efficient version of GPT-5 for well-defined tasks",
supportsVerbosity: true,
supportsTemperature: false,
},
"gpt-5-nano-2025-08-07": {
maxTokens: 128000,
Expand All @@ -45,6 +47,7 @@ export const openAiNativeModels = {
cacheReadsPrice: 0.01,
description: "GPT-5 Nano: Fastest, most cost-efficient version of GPT-5",
supportsVerbosity: true,
supportsTemperature: false,
},
"gpt-4.1": {
maxTokens: 32_768,
Expand All @@ -54,6 +57,7 @@ export const openAiNativeModels = {
inputPrice: 2,
outputPrice: 8,
cacheReadsPrice: 0.5,
supportsTemperature: true,
},
"gpt-4.1-mini": {
maxTokens: 32_768,
Expand All @@ -63,6 +67,7 @@ export const openAiNativeModels = {
inputPrice: 0.4,
outputPrice: 1.6,
cacheReadsPrice: 0.1,
supportsTemperature: true,
},
"gpt-4.1-nano": {
maxTokens: 32_768,
Expand All @@ -72,6 +77,7 @@ export const openAiNativeModels = {
inputPrice: 0.1,
outputPrice: 0.4,
cacheReadsPrice: 0.025,
supportsTemperature: true,
},
o3: {
maxTokens: 100_000,
Expand All @@ -83,6 +89,7 @@ export const openAiNativeModels = {
cacheReadsPrice: 0.5,
supportsReasoningEffort: true,
reasoningEffort: "medium",
supportsTemperature: false,
},
"o3-high": {
maxTokens: 100_000,
Expand All @@ -93,6 +100,7 @@ export const openAiNativeModels = {
outputPrice: 8.0,
cacheReadsPrice: 0.5,
reasoningEffort: "high",
supportsTemperature: false,
},
"o3-low": {
maxTokens: 100_000,
Expand All @@ -103,6 +111,7 @@ export const openAiNativeModels = {
outputPrice: 8.0,
cacheReadsPrice: 0.5,
reasoningEffort: "low",
supportsTemperature: false,
},
"o4-mini": {
maxTokens: 100_000,
Expand All @@ -114,6 +123,7 @@ export const openAiNativeModels = {
cacheReadsPrice: 0.275,
supportsReasoningEffort: true,
reasoningEffort: "medium",
supportsTemperature: false,
},
"o4-mini-high": {
maxTokens: 100_000,
Expand All @@ -124,6 +134,7 @@ export const openAiNativeModels = {
outputPrice: 4.4,
cacheReadsPrice: 0.275,
reasoningEffort: "high",
supportsTemperature: false,
},
"o4-mini-low": {
maxTokens: 100_000,
Expand All @@ -134,6 +145,7 @@ export const openAiNativeModels = {
outputPrice: 4.4,
cacheReadsPrice: 0.275,
reasoningEffort: "low",
supportsTemperature: false,
},
"o3-mini": {
maxTokens: 100_000,
Expand All @@ -145,6 +157,7 @@ export const openAiNativeModels = {
cacheReadsPrice: 0.55,
supportsReasoningEffort: true,
reasoningEffort: "medium",
supportsTemperature: false,
},
"o3-mini-high": {
maxTokens: 100_000,
Expand All @@ -155,6 +168,7 @@ export const openAiNativeModels = {
outputPrice: 4.4,
cacheReadsPrice: 0.55,
reasoningEffort: "high",
supportsTemperature: false,
},
"o3-mini-low": {
maxTokens: 100_000,
Expand All @@ -165,6 +179,7 @@ export const openAiNativeModels = {
outputPrice: 4.4,
cacheReadsPrice: 0.55,
reasoningEffort: "low",
supportsTemperature: false,
},
o1: {
maxTokens: 100_000,
Expand All @@ -174,6 +189,7 @@ export const openAiNativeModels = {
inputPrice: 15,
outputPrice: 60,
cacheReadsPrice: 7.5,
supportsTemperature: false,
},
"o1-preview": {
maxTokens: 32_768,
Expand All @@ -183,6 +199,7 @@ export const openAiNativeModels = {
inputPrice: 15,
outputPrice: 60,
cacheReadsPrice: 7.5,
supportsTemperature: false,
},
"o1-mini": {
maxTokens: 65_536,
Expand All @@ -192,6 +209,7 @@ export const openAiNativeModels = {
inputPrice: 1.1,
outputPrice: 4.4,
cacheReadsPrice: 0.55,
supportsTemperature: false,
},
"gpt-4o": {
maxTokens: 16_384,
Expand All @@ -201,6 +219,7 @@ export const openAiNativeModels = {
inputPrice: 2.5,
outputPrice: 10,
cacheReadsPrice: 1.25,
supportsTemperature: true,
},
"gpt-4o-mini": {
maxTokens: 16_384,
Expand All @@ -210,6 +229,7 @@ export const openAiNativeModels = {
inputPrice: 0.15,
outputPrice: 0.6,
cacheReadsPrice: 0.075,
supportsTemperature: true,
},
"codex-mini-latest": {
maxTokens: 16_384,
Expand All @@ -219,6 +239,7 @@ export const openAiNativeModels = {
inputPrice: 1.5,
outputPrice: 6,
cacheReadsPrice: 0,
supportsTemperature: false,
description:
"Codex Mini: Cloud-based software engineering agent powered by codex-1, a version of o3 optimized for coding tasks. Trained with reinforcement learning to generate human-style code, adhere to instructions, and iteratively run tests.",
},
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,14 @@ export interface ApiHandlerCreateMessageMetadata {
* Used to enforce "skip once" after a condense operation.
*/
suppressPreviousResponseId?: boolean
/**
* Controls whether the response should be stored for 30 days in OpenAI's Responses API.
* When true (default), responses are stored and can be referenced in future requests
* using the previous_response_id for efficient conversation continuity.
* Set to false to opt out of response storage for privacy or compliance reasons.
* @default true
*/
store?: boolean
}

export interface ApiHandler {
Expand Down
Loading
Loading