fix: repair Gemini model-turn compaction failures - #4
Merged
Conversation
Add --fix-model-turn to codex-cross-provider-session-repair. The option removes thread_rolled_back events that hide the trailing user turn and appends a dummy user message when the effective history still ends with an assistant turn, fixing HTTP 400 'Requests ending with a model turn are not supported' from Gemini. Also bump version to 0.3.0, document the end-to-end user flow in SKILL.md, and add model-turn detection/repair tests.
|
Analysis CompleteGenerated ECC bundle from 1 commits | Confidence: 50% View Pull Request #5Repository Profile
Changed Files (7)
Top hotspots
Top directories
Analysis Depth Readiness (commit-history, 7%)ECC Tools uses this to decide whether recommendations should stay at commit-history/setup guidance or expand into CI, security, harness, reference-set, AI-routing, and team backlog work.
Reference Set Readiness (0/7, 0%)
Likely Future Issues (1)
Suggested Follow-up Work (1)
Copy-ready bodies test: add regression coverage for codex-cross-provider-session-repair/scripts/repair.py + codex-cross-provider-session-repair/tests/test_repair.py ## Summary
- Add regression coverage for the recently touched code paths before more changes stack on top.
## Why
- Backfill regression coverage before another change set lands on the touched code paths.
## Touched paths
- `codex-cross-provider-session-repair/scripts/repair.py`
- `codex-cross-provider-session-repair/tests/test_repair.py`
## Validation
- Add or extend focused tests that exercise the touched paths.
- Run the affected test suite and verify the new coverage closes the gap.Generated Instincts (5)
After merging, import with: Files
|
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
Adds
--fix-model-turntocodex-cross-provider-session-repairto fix Gemini compaction failures when a session's effective history ends with an assistant turn (HTTP 400Requests ending with a model turn are not supported).Changes
--fix-model-turnoption that removesthread_rolled_backevents (restoring the trailing user turn) and appends a dummy user message when the history still ends with an assistant turndetect_compaction_model_turn()andread_model_turn_error()diagnostics; dry-run report now shows aModel-turn compactionlineVerification
019fc2cb-5370-7d32-899c-89310a4e370arepaired:Model-turn compaction: RISK -> ok,last_role: assistant -> userpython -m pytest tests/test_repair.py: 7 passed