Skip to content
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
4 changes: 4 additions & 0 deletions autogpt_platform/backend/backend/blocks/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ class LlmModel(str, Enum, metaclass=LlmModelMeta):
O1_MINI = "o1-mini"
# GPT-5 models
GPT5 = "gpt-5-2025-08-07"
GPT5_1 = "gpt-5.1-2025-11-13"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The GPT5_1 model uses an invalid identifier not found in OpenAI documentation.
Severity: CRITICAL | Confidence: 1.00

🔍 Detailed Analysis

The model identifier gpt-5.1-2025-11-13 assigned to GPT5_1 is not listed in OpenAI's official API documentation for GPT-5.1 models. When oai_client.chat.completions.create() is called with this identifier, OpenAI's API will reject the request with a 'model not found' error, preventing the GPT5_1 model from being used.

💡 Suggested Fix

Update the GPT5_1 model identifier to a valid one from OpenAI's official documentation, such as gpt-5.1 or gpt-5.1-chat-latest.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: autogpt_platform/backend/backend/blocks/llm.py#L96

Potential issue: The model identifier `gpt-5.1-2025-11-13` assigned to `GPT5_1` is not
listed in OpenAI's official API documentation for GPT-5.1 models. When
`oai_client.chat.completions.create()` is called with this identifier, OpenAI's API will
reject the request with a 'model not found' error, preventing the `GPT5_1` model from
being used.

Did we get this right? 👍 / 👎 to inform future reviews.

Reference_id: 2766327

GPT5_1_CODEX = "gpt-5.1-codex"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: The GPT5_1_CODEX model uses the incorrect OpenAI API, causing API rejection.
Severity: CRITICAL | Confidence: 1.00

🔍 Detailed Analysis

The GPT5_1_CODEX model is configured to use the OpenAI Chat Completions API (oai_client.chat.completions.create()). However, OpenAI's official documentation specifies that gpt-5.1-codex is exclusively served through the Responses API. This mismatch will cause OpenAI's API to reject requests for gpt-5.1-codex, leading to runtime crashes whenever this model is invoked by any LLM block.

💡 Suggested Fix

Implement support for OpenAI's Responses API within llm_call() for gpt-5.1-codex or remove the model if Responses API integration is not planned.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: autogpt_platform/backend/backend/blocks/llm.py#L97

Potential issue: The `GPT5_1_CODEX` model is configured to use the OpenAI Chat
Completions API (`oai_client.chat.completions.create()`). However, OpenAI's official
documentation specifies that `gpt-5.1-codex` is exclusively served through the Responses
API. This mismatch will cause OpenAI's API to reject requests for `gpt-5.1-codex`,
leading to runtime crashes whenever this model is invoked by any LLM block.

Did we get this right? 👍 / 👎 to inform future reviews.

Reference_id: 2766327

GPT5_MINI = "gpt-5-mini-2025-08-07"
GPT5_NANO = "gpt-5-nano-2025-08-07"
GPT5_CHAT = "gpt-5-chat-latest"
Expand Down Expand Up @@ -189,6 +191,8 @@ def max_output_tokens(self) -> int | None:
LlmModel.O1_MINI: ModelMetadata("openai", 128000, 65536), # o1-mini-2024-09-12
# GPT-5 models
LlmModel.GPT5: ModelMetadata("openai", 400000, 128000),
LlmModel.GPT5_1: ModelMetadata("openai", 400000, 128000),
LlmModel.GPT5_1_CODEX: ModelMetadata("openai", 400000, 128000),
LlmModel.GPT5_MINI: ModelMetadata("openai", 400000, 128000),
LlmModel.GPT5_NANO: ModelMetadata("openai", 400000, 128000),
LlmModel.GPT5_CHAT: ModelMetadata("openai", 400000, 16384),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,11 @@
LlmModel.O1_MINI: 4,
# GPT-5 models
LlmModel.GPT5: 2,
LlmModel.GPT5_1: 5,
LlmModel.GPT5_1_CODEX: 5,
LlmModel.GPT5_MINI: 1,
LlmModel.GPT5_NANO: 1,
LlmModel.GPT5_CHAT: 2,
LlmModel.GPT5_CHAT: 5,
LlmModel.GPT41: 2,
LlmModel.GPT41_MINI: 1,
LlmModel.GPT4O_MINI: 1,
Expand Down
Loading