Errors and recovery
A redundant formal field diagnosis that agrees with the core is combined with the retained issue, including its sources, candidates, questions and suggestion references. A claim that contradicts a formal proof remains MODEL_OUTPUT_INVALID, with a candidate location where available. An inference targeting an inputs/extensions container or its descendants is also invalid; use a real semantic location for an unconfirmed assumption. Ordinary invalid business values remain normal field results and data issues.
Technical failures throw IntentError rather than returning truncated candidates or infrastructure failures as normal success. Field issues remain in a normal result's issues.
If there is no result, check for an exception. If the result lacks an order ID, inspect fieldResults and issues first. Timeout, authentication failure, and missing user information need different recovery actions. If Codex cannot start or has no tools, begin with registration diagnostics.
Recovery is identify code/issue → repair input/configuration → make an explicit new call → inspect the new result. It is not automatic retry. See MCP envelopes.
Structure failures use MODEL_OUTPUT_INVALID with stage='validation' and bounded JSON Pointer paths in details.violations, such as /relations, /nodes/0/action, or /observations/0/path. An invalid complete OpenAI wire candidate is a candidate failure; it is not an authentication or transport failure. Unsupported local projection shapes fail before a request with CONFIG_INVALID and an outputSchema path. Strict output does not repair missing business data or bypass source and semantic checks.
Canonical diagnostics identify an invalid related node at /relatedKeys/1, a wrong snapshot delta path at /changes/0/deltaHints/0/path, and an applied add for an existing intent at /changes/0/operation (SEMANTIC_INVARIANT). The OpenAI wire may reject these combinations earlier with STRUCTURE; callers should use the reported rule and path rather than assuming one validation stage.
Resource checks may stop as soon as a limit is exceeded instead of measuring all remaining material. An omitted details.observed does not mean zero; display only available diagnostic properties. For example, setting limits.maxContextBytes to 16 and supplying an oversized Context can produce this safe summary:
Semantic issue codes include AMBIGUOUS_REFERENCE, INTENT_INFORMATION_MISSING, CONSTRAINT_CONFLICT, RELATION_CONFLICT, CONTEXT_CONFLICT, CONTEXT_INCOMPLETE, UNCONFIRMED_INFERENCE. Field codes include FIELD_REQUIRED_MISSING, FIELD_APPLICABILITY_UNKNOWN, FIELD_CARDINALITY_MISMATCH, FIELD_VALUE_INVALID, FIELD_DEPENDENCY_MISSING, FIELD_VALIDATION_UNDETERMINED, FIELD_INVALIDATED.
Recover at the right layer
Ambiguity, missing fields, and invalid values are usually normal interpretation issues, not transport failures.
Runtime does not perform these recovery actions for you. Host format correction is based on explicit feedback; missing knowledge, unknown fields, and business authorization are separate.
Serialization includes name/code/message/stage and safe details; cause is non-enumerable. Standard technical messages are generic English without original input or keys. MCP technical failures return isError=true and text {error:...}, with no structuredContent or partialResult.
Preserve prior results and original messages. Failure does not clear application state. The caller decides technical retry and handles out-of-order requests with its own revision. Unknown fields do not trigger automatic fact generation.
This is a caller helper, not an SDK method; the caller owns Intent lifetime. The current version never produces PROCESSING_INCOMPLETE and never sets partialResult on IntentError; truncated text is not a normal result. toJSON omits partialResult by default, since complete results can contain original material. Use serialize options explicitly when needed; see IntentError.