Merge pull request #68 from gabrii/gpt-5.1-update

Change default truncation to prevent issues with gpt-5.1-codex.*
This commit is contained in:
Gabriel Gavilan
2025-11-22 11:39:26 +01:00
committed by GitHub
16 changed files with 33 additions and 45 deletions
+12 -13
View File
@@ -24,20 +24,19 @@ This project originates from Cursor's lack of support for Azure models that are
## Supported Models
The entire gpt-5 series is supported, although `gpt-5-pro` and `gpt-5-codex` have some limitations on the reasoning effort / verbosity values they accept:
The entire gpt-5 series is supported, although some models have some limitations on the reasoning effort / verbosity / truncation values they accept:
| Model Name | Reasoning Effort | Verbosity |
| ------------------ | ----------------------------------------------- | ----------------------------------- |
| gpt-5 | ✅ `minimal` `low` `medium` `high` | ✅ `low` `medium` `high` |
| gpt-5.1 | ✅ `minimal` `low` `medium` `high` | ✅ `low` `medium` `high` |
| gpt-5-mini | ✅ `minimal` `low` `medium` `high` | ✅ `low` `medium` `high` |
| gpt-5-nano | ✅ `minimal` `low` `medium` `high` | ✅ `low` `medium` `high` |
| gpt-5-pro | ⚠️ _~~`minimal`~~ ~~`low`~~ ~~`medium`~~_ `high` | ✅ `low` `medium` `high` |
| gpt-5-codex | ⚠️ _~~`minimal`~~_ `low` `medium` `high` | ⚠️ _~~`low`~~_ `medium` _~~`high`~~_ |
| gpt-5.1-codex | 🛑 Error on Azure's end | |
| gpt-5.1-codex-mini | 🛑 Error on Azure's end | |
| Model Name | Reasoning Effort | Verbosity | Truncation |
| ------------------ | ----------------------------------------------- | ----------------------------------- | ------------------------- |
| gpt-5 | ✅ `minimal` `low` `medium` `high` | ✅ `low` `medium` `high` | ✅ `auto` `disabled` |
| gpt-5.1 | ✅ `minimal` `low` `medium` `high` | ✅ `low` `medium` `high` | ✅ `auto` `disabled` |
| gpt-5-mini | ✅ `minimal` `low` `medium` `high` | ✅ `low` `medium` `high` | ✅ `auto` `disabled` |
| gpt-5-nano | ✅ `minimal` `low` `medium` `high` | ✅ `low` `medium` `high` | ✅ `auto` `disabled` |
| gpt-5-pro | ⚠️ _~~`minimal`~~ ~~`low`~~ ~~`medium`~~_ `high` | ✅ `low` `medium` `high` | ✅ `auto` `disabled` |
| gpt-5-codex | ⚠️ _~~`minimal`~~_ `low` `medium` `high` | ⚠️ _~~`low`~~_ `medium` _~~`high`~~_ | ✅ `auto` `disabled` |
| gpt-5.1-codex | ⚠️ _~~`minimal`~~_ `low` `medium` `high` | ⚠️ _~~`low`~~_ `medium` _~~`high`~~_ | ⚠️ _~~`auto`~~_ `disabled` |
| gpt-5.1-codex-mini | ⚠️ _~~`minimal`~~_ `low` `medium` `high` | ⚠️ _~~`low`~~_ `medium` _~~`high`~~_ | ⚠️ _~~`auto`~~_ `disabled` |
The `gpt-5.1` series is partially supported, although `gpt-5.1-codex` and `gpt-5.1-codex-mini` are just broken in Azure.
## Feature highlights
@@ -65,6 +64,7 @@ Make a copy of the file `.env.example` as `.env` and update the following flags
| `AZURE_DEPLOYMENT` | Name of the Azure model deployment to use. | `gpt-5` |
| `AZURE_VERBOSITY_LEVEL` | Hint the model to be more or less expansive in its replies. Use either `high` / `medium` / `low` | `medium` |
| `AZURE_SUMMARY_LEVEL` | Set to `none` to disable summaries. You might have to disable them if your organization hasn't been approved for this feature. | `detailed` |
| `AZURE_TRUNCATION` | Truncation strategy for long inputs. Either `auto` or `disabled` | `disabled` |
Alternatively, you can pass them through the environment where you run the application.
@@ -74,7 +74,6 @@ Alternatively, you can pass them through the environment where you run the appli
| Flag | Description | Default |
| ------------------- | ---------------------------------------------------------------------- | -------------------- |
| `AZURE_API_VERSION` | Azure OpenAI Responses API version to call. | `2025-04-01-preview` |
| `AZURE_TRUNCATION` | Truncation strategy for long inputs. | `auto` |
| `FLASK_ENV` | Flask environment. Use `development` for dev or `production` for prod. | `production` |
| `RECORD_TRAFFIC` | Toggle writing request/response traffic to `recordings/` | `off` |
| `LOG_CONTEXT` | Enable rich pretty-printing of request context to console. | `on` |
+2
View File
@@ -183,6 +183,8 @@ class RequestAdapter:
responses_body["store"] = False
responses_body["stream_options"] = {"include_obfuscation": False}
if settings["AZURE_TRUNCATION"] == "auto":
responses_body["truncation"] = settings["AZURE_TRUNCATION"]
request_kwargs: Dict[str, Any] = {
+1 -1
View File
@@ -26,7 +26,7 @@ AZURE_DEPLOYMENT = env.str("AZURE_DEPLOYMENT") or "gpt-5"
AZURE_API_VERSION = env.str("AZURE_API_VERSION") or "2025-04-01-preview"
AZURE_SUMMARY_LEVEL = env.str("AZURE_SUMMARY_LEVEL") or "detailed"
AZURE_VERBOSITY_LEVEL = env.str("AZURE_VERBOSITY_LEVEL") or "medium"
AZURE_TRUNCATION = env.str("AZURE_TRUNCATION") or "auto"
AZURE_TRUNCATION = env.str("AZURE_TRUNCATION") or "disabled"
AZURE_RESPONSES_API_URL = (
f"{AZURE_BASE_URL}/openai/responses?api-version={AZURE_API_VERSION}"
@@ -346,6 +346,5 @@
"store": false,
"stream_options": {
"include_obfuscation": false
},
"truncation": "auto"
}
}
@@ -649,6 +649,5 @@
"store": false,
"stream_options": {
"include_obfuscation": false
},
"truncation": "auto"
}
}
@@ -649,6 +649,5 @@
"store": false,
"stream_options": {
"include_obfuscation": false
},
"truncation": "auto"
}
}
@@ -395,6 +395,5 @@
"store": false,
"stream_options": {
"include_obfuscation": false
},
"truncation": "auto"
}
}
@@ -32,6 +32,5 @@
"store": false,
"stream_options": {
"include_obfuscation": false
},
"truncation": "auto"
}
}
@@ -431,6 +431,5 @@
"store": false,
"stream_options": {
"include_obfuscation": false
},
"truncation": "auto"
}
}
@@ -395,6 +395,5 @@
"store": false,
"stream_options": {
"include_obfuscation": false
},
"truncation": "auto"
}
}
@@ -313,6 +313,5 @@
"store": false,
"stream_options": {
"include_obfuscation": false
},
"truncation": "auto"
}
}
@@ -313,6 +313,5 @@
"store": false,
"stream_options": {
"include_obfuscation": false
},
"truncation": "auto"
}
}
@@ -395,6 +395,5 @@
"store": false,
"stream_options": {
"include_obfuscation": false
},
"truncation": "auto"
}
}
@@ -398,6 +398,5 @@
"store": false,
"stream_options": {
"include_obfuscation": false
},
"truncation": "auto"
}
}
+1 -1
View File
@@ -11,7 +11,7 @@ AZURE_API_KEY = "test-api-key"
AZURE_DEPLOYMENT = "gpt-5"
AZURE_SUMMARY_LEVEL = "detailed"
AZURE_VERBOSITY_LEVEL = "medium"
AZURE_TRUNCATION = "auto"
AZURE_TRUNCATION = "disabled"
RECORD_TRAFFIC = False
LOG_CONTEXT = True
+5 -7
View File
@@ -35,8 +35,7 @@ Check "azure_response" for the error details:
\t "store": false,
\t "stream_options": {
\t "include_obfuscation": false
\t },
\t "truncation": "auto"
\t }
\t }
\t}
If the issue persists, report it to:
@@ -73,8 +72,7 @@ Check "azure_response" for the error details:
\t "store": false,
\t "stream_options": {
\t "include_obfuscation": false
\t },
\t "truncation": "auto"
\t }
\t }
\t}
If the issue persists, report it to:
@@ -109,8 +107,7 @@ Check "azure_response" for the error details:
\t "store": false,
\t "stream_options": {
\t "include_obfuscation": false
\t },
\t "truncation": "auto"
\t }
\t }
\t}
If the issue persists, report it to:
@@ -122,7 +119,8 @@ class TestCompletionError(ReplyBase):
"""Test a successful HTTP request but with a streamed response.error event."""
def modify_settings(self, app) -> None:
"""Set gpt-5.1-codex model, which is currently causing this issue."""
"""Set gpt-5.1-codex model and auto truncation, which is currently causing this issue."""
app.config["AZURE_DEPLOYMENT"] = "gpt-5.1-codex"
app.config["AZURE_TRUNCATION"] = "auto"
recording = "response_error"