Skip to content

fix: model catalog fallback for not_configured status#1325

Open
Marnie0415 wants to merge 3 commits into
BigPizzaV3:mainfrom
Marnie0415:fix/model-catalog-fallback
Open

fix: model catalog fallback for not_configured status#1325
Marnie0415 wants to merge 3 commits into
BigPizzaV3:mainfrom
Marnie0415:fix/model-catalog-fallback

Conversation

@Marnie0415

@Marnie0415 Marnie0415 commented Jul 3, 2026

Copy link
Copy Markdown

Summary

Two fixes for model whitelist injection failure on Codex App 26.623+:

  1. Rust backend (model_catalog.rs): When settings.json exists but the active relay profile has no models, fall through to read from config.toml instead of returning not_configured immediately.

  2. Inject script (renderer-inject.js): When /codex-model-catalog returns not_configured, add a fallback that reads modelList from the active relay profile via /settings/get.

Problem

On Codex App 26.623+:

  • app-server-manager-signals- module is not found, breaking one layer of whitelist injection
  • /codex-model-catalog returns {"status":"not_configured"} even when settings.json has a populated modelList in the active relay profile
  • This happens because read_codex_model_catalog() returns early from the relay profile path without checking config.toml when models are empty

Root Cause

In read_codex_model_catalog() (model_catalog.rs), when settings.json exists, the function always returns from the relay profile path. If relay_profile_model_ids() returns empty (e.g. modelList parsing issue), it returns not_configured without ever falling through to read model_catalog_json from config.toml.

Fix Details

Rust (model_catalog.rs)

  • Check if relay profile models are non-empty before returning
  • If empty, continue to read_codex_model_catalog_from_home() which reads config.toml

JS (renderer-inject.js)

  • In loadCodexModelCatalog(), when bridge returns not_configured with empty models
  • Fetch settings via /settings/get with 3s timeout
  • Parse modelList from active relay profile
  • Populate codexModelCatalog.models
  • Diagnostic events for fallback success/failure

Testing

  • Non-breaking: fallback only triggers when original path returns empty models
  • Verified: relay profile modelList format is newline/comma separated

Related

When /codex-model-catalog returns status 'not_configured' with empty models,
the inject script now falls back to reading modelList from the active relay
profile via /settings/get. This allows custom models to appear in the Codex
model selector even when the Rust backend cannot serve the catalog.
Audit changes:
- Added 3s Promise.race timeout on fallback settings request
- Replaced silent catch with sendCodexPlusDiagnostic for error tracking
- Removed unsafe status='ok' override (keeps original not_configured status)
- Added diagnostic event on successful fallback
- Only reads modelList/activeRelayId from settings, no sensitive data exposure
When settings.json exists but the active relay profile's modelList is empty
or fails to parse, the model catalog now falls through to read from
config.toml (including model_catalog_json). Previously it would return
not_configured without ever checking config.toml.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Model whitelist injection fails: app-server-manager-signals- module not found in Codex 26.623+

1 participant