Kill Codex's 3208-Token Output Cap for Local Models with a Model Catalog
Anyone running Codex against a local model hits this hidden output cap exactly when doing large edits; the workaround (and the catalog schema behind it) is the difference between a model that silently fails and one that finishes a multi-file patch. It also exposes a client-side assumption that local models behave like OpenAI's cloud services, which this configuration explicitly overrides.
Codex silently falls back to a conservative metadata set when it can't find a local model's metadata, which caps each tool-call output at 3208 tokens. A 131072-token context doesn't help because the limit is client-side, not server-side; the server accepts max_tokens up to 100000 without complaint.
The fix is to create a model-catalog.json entry for the model, setting truncation_policy.limit to 16384 (or higher), and reference that file via the model_catalog_json key in config.toml. A PowerShell script automates this for one or more models, and a manual path explains each required field, common errors like the deprecated model_max_output_tokens key, and how to extract the exact field list from the Codex binary for newer versions.
Verification involves three checks: the missing-metadata warning disappears, a 1500-line output completes without truncation, and a 2500-line output (1.6x the old cap) also completes, confirming the change holds under pressure. The same article also documents a related 401 pitfall caused by the STRATA_API_KEY environment variable being read by both server and client, turning a fake client key into forced server authentication.
The 3208 cap is a quiet default that only surfaces when a user pushes a genuinely large edit; most local-model workflows avoid it by accident, masking the need for metadata configuration.
The solution relies on reverse-engineering Codex's serialization schema from the binary, a pragmatic approach for any open-source CLI that doesn't expose its config format officially.
The 401/AUTH pitfall shows how environment variables create hidden coupling between client and server; a single variable can switch a service from open to locked without either side noticing until a request fails.
Setting truncation_policy.limit too high (e.g., 131072) passes validation but makes single responses impractically slow, so the practical cap is bounded by generation speed, not just token count.
If you run into other errors, you can paste them here. I have a reference table of 15 errors, and if it matches, I'll directly give the conclusion.