fix/codex turn failed and model selection#415
Merged
pedramamini merged 1 commit intomainfrom Feb 19, 2026
Merged
Conversation
- Codex output parser now handles string-based `turn.failed` errors reliably 🧨 - Centralized error-text extraction for object-or-string Codex error payloads 🧩 - Improved error detection across `error`, `turn.failed`, and generic `error` fields 🔍 - Avoids false matches when JSON contains no useful error message 🚫 - Expanded test coverage for polymorphic Codex error formats to prevent regressions 🧪
|
No actionable comments were generated in the recent review. 🎉 📝 WalkthroughWalkthroughThe PR refactors error handling in the Codex output parser by introducing a helper function to normalize error text extraction and expanding error detection to handle string-based errors alongside object errors, with corresponding test coverage added. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Comment |
Greptile SummaryRefactored Codex output parser to improve error handling for Key changes:
Confidence Score: 5/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Codex JSON Output] --> B{Parse JSON Line}
B --> C{Message Type?}
C -->|turn.failed| D[extractErrorText]
C -->|error| D
C -->|other types| E[Other handlers]
D --> F{Error field type?}
F -->|object with message| G[Return error.message]
F -->|string| H[Return error string]
F -->|undefined/null| I[Return fallback]
G --> J[Create error event]
H --> J
I --> J
J --> K[Error Pattern Matching]
K --> L{Pattern matches?}
L -->|Yes| M[Return typed AgentError]
L -->|No| N[Return null]
style D fill:#90EE90
style J fill:#FFB6C1
style M fill:#87CEEB
Last reviewed commit: 8b3077d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary by CodeRabbit
Release Notes