Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

fix: classify Codex subscription model access rejections

[._.]/ Adam Eivyf1332c087b08
diff --git a/docs/TROUBLESHOOTING.md b/docs/TROUBLESHOOTING.md
index ed8c31facb..0d7b1495e7 100644
--- a/docs/TROUBLESHOOTING.md
+++ b/docs/TROUBLESHOOTING.md
@@ -2,6 +2,26 @@
Common issues and solutions when running PortOS.
+## Codex rejects a model with a ChatGPT account
+
+**Symptom**: `The 'example-model' model is not supported when using Codex with a ChatGPT account.`
+
+This is a model-access rejection, not evidence that login failed. Run
+`codex login status` in the same environment as PortOS to confirm the active
+authentication method. PortOS lets Codex own its credentials and token refresh.
+
+Choose a supported model in the task or provider settings, or clear the task's
+model override to use its configured default (check that default too). PortOS's
+shipped model catalog can include models unavailable to your account; refreshing
+the catalog alone does not prove entitlement. A quiet-session continuation cannot
+fix an unsupported model selection.
+
+ChatGPT subscription access and API-key access are separate authentication and
+billing modes. Do not re-login or replace credentials merely to fix this message.
+If API billing is intended, configure it explicitly using the
+[official Codex authentication instructions](https://learn.chatgpt.com/docs/auth).
+Never paste credential files or tokens into an issue.
+
## Startup Issues
### Start Here: `npm run doctor`
diff --git a/server/lib/aiToolkit/errorDetection.js b/server/lib/aiToolkit/errorDetection.js
index e47948ff5c..56025710de 100644
--- a/server/lib/aiToolkit/errorDetection.js
+++ b/server/lib/aiToolkit/errorDetection.js
@@ -143,6 +143,16 @@ const ERROR_PATTERNS = [
suggestedFix: 'Provider usage limit reached. Using fallback provider or wait for limit reset.',
extractWaitTime: true
},
+ {
+ // Codex authenticated successfully, but the selected model is outside this
+ // ChatGPT account's access. This is request-specific, not a broken login
+ // or an exhausted subscription; other models may still run.
+ pattern: /model is not supported when using Codex with a ChatGPT account/i,
+ category: ERROR_CATEGORIES.MODEL_NOT_FOUND,
+ requiresFallback: true,
+ actionable: true,
+ suggestedFix: 'Choose a model supported by the signed-in Codex account, or clear the model override to use the CLI default. Changing to API-key authentication uses separate API billing.'
+ },
{
pattern: /unauthorized|invalid.?api.?key|authentication|forbidden|401|403/i,
category: ERROR_CATEGORIES.AUTH_ERROR,
diff --git a/server/lib/aiToolkit/errorDetection.test.js b/server/lib/aiToolkit/errorDetection.test.js
index 39412073d2..d080ffc55f 100644
--- a/server/lib/aiToolkit/errorDetection.test.js
+++ b/server/lib/aiToolkit/errorDetection.test.js
@@ -80,6 +80,18 @@ describe('Error Detection', () => {
.toBe(ERROR_CATEGORIES.UNKNOWN);
});
+ it('classifies Codex ChatGPT model access rejection as a model fault, not a login failure', () => {
+ const message = "The 'example-model' model is not supported when using Codex with a ChatGPT account.";
+ const result = analyzeError(JSON.stringify({
+ type: 'error', status: 400, error: { type: 'invalid_request_error', message }
+ }), 1);
+ expect(result).toMatchObject({
+ hasError: true, category: ERROR_CATEGORIES.MODEL_NOT_FOUND,
+ requiresFallback: true, actionable: true, message
+ });
+ expect(result.suggestedFix).toContain('signed-in Codex account');
+ });
+
it('should detect rate limit errors', () => {
const result = analyzeError('API Error: 429 Too Many Requests');
expect(result.hasError).toBe(true);