Commit Graph

13 Commits

Author SHA1 Message Date
tctinh
802dfe1fdb Refactor rate limit handling and improve error responses
- Deleted the RATE_LIMIT_ROUTING_ANALYSIS.md document as it is no longer needed.
- Enhanced the regression test to provide detailed failure information, including the first failure's stderr output.
- Updated the plugin to handle 400 errors ("Prompt too long") with a synthetic response instead of returning a session-locking error.
- Introduced createSyntheticErrorResponse function to generate a synthetic SSE response for error messages, allowing continued session usage.
- Added tests for createSyntheticErrorResponse to ensure correct behavior and structure of the synthetic SSE events.
2025-12-28 18:28:56 +07:00
tctinh
457b3ac12b fix: improve rate limit handling and add prompt-too-long toast
- Add 2s deduplication window to prevent rate limit counter inflation from concurrent 429s
- Separate cooldown system from rate limits for non-429 errors (auth failures, 5xx)
- Add quota_fallback config option for automatic quota switching on rate limit
- Add toast notification for 400 'Prompt is too long' errors guiding users to /compact
- Add 5 new cooldown unit tests
- Enhance regression test suite with concurrent test infrastructure
- Add comprehensive rate limit analysis documentation
2025-12-28 16:09:52 +07:00
tctinh
ab86d6d8d1 fix: prevent tool_use without tool_result errors
Add defense-in-depth protection against Claude API tool pairing errors:

- findOrphanedToolUseIds(): Detect orphaned tool_use blocks
- fixClaudeToolPairing(): Inject placeholder tool_result responses
- validateAndFixClaudeToolPairing(): Nuclear fallback removes broken blocks
- 12 new unit tests covering all edge cases

Fixes permanent session corruption when ESC pressed or context compacted.
2025-12-26 11:44:06 +07:00
tctinh
5ee1e9302e Merge branch 'dev' of github.com:NoeFabris/opencode-antigravity-auth into dev 2025-12-26 02:34:34 +07:00
tctinh
096d2516bd chore: bump version to 1.2.5-beta.0 for beta release
- Add release-beta.yml workflow for dev branch
- Add CLAUDE_INSTABILITY_RESEARCH.md documentation
- Add PR description.md
2025-12-26 02:32:56 +07:00
tctinh
6c1e3b7b40 feat: Implement session recovery module for handling recoverable errors
- Added recovery functionality for tool_result_missing, thinking_block_order, and thinking_disabled_violation errors.
- Introduced constants and types for session recovery.
- Created storage utilities for reading and writing session data.
- Enhanced debug logging capabilities in debug.ts.
- Refactored debug state management for better initialization and access.
2025-12-26 02:09:15 +07:00
Noe
b7c6222ce3 feat: add option to preserve thinking blocks for Claude models with trade-offs 2025-12-24 10:44:05 +01:00
tctinh
0f74555d0c feat: improve thinking block handling in Antigravity request preparation 2025-12-24 15:09:02 +07:00
tctinh
dd5ea5556f feat: update Claude model handling to strip all thinking blocks, eliminating signature errors, improve parsing tool and thinking logic reference to CLIProxyAPI 2025-12-24 14:35:12 +07:00
tctinh
9e430af3e6 feat: implement thinking signature safeguards and enhance filtering mechanisms 2025-12-23 14:40:27 +07:00
tctinh
ed4dabf434 docs: expand Claude model flow with comprehensive quirks and adaptations 2025-12-18 11:17:35 +07:00
tctinh
bb1bbaf1ef docs: add Claude model flow documentation for both branches 2025-12-18 11:07:49 +07:00
tctinh
08f9da97f7 feat: implement thinking block sanitization for Claude API compliance 2025-12-18 10:47:02 +07:00