feat: Add comprehensive Ollama integration with JSON repair #1424
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.
Pull Request: Add comprehensive Ollama integration with JSON repair
Branch Information
feat/ollama-json-repair
main
PR Title
feat: Add comprehensive Ollama integration with JSON repair
PR Description
Summary
This PR adds comprehensive Ollama support to Codex with robust handling of malformed JSON responses. Ollama models can now execute shell commands, apply patches, and use other Codex tools reliably.
Key Features
1. Dynamic JSON Repair System
\(
→\\(
)2. Multi-line JSON Parsing
3. Ollama-Specific Enhancements
4. Error Recovery
Changes
repair-json.ts
- JSON repair utilitiesresponses.ts
- Ollama detection and multi-line JSON parsingparsers.ts
- JSON repair for tool arguments/outputextract-applied-patches.ts
- JSON repair for patch extractionagent-loop.ts
- Ollama-specific system promptshandle-exec-command.ts
- ENOTDIR error handlingexec.ts
- Shell built-in detectionterminal-chat-response-item.tsx
- Enhanced UI filteringOLLAMA_INTEGRATION.md
Testing
Tested with multiple Ollama models including:
All models successfully:
Usage
Test Plan
Files Changed (12 files, +763 -65)