Commit Graph

18 Commits

Author SHA1 Message Date
Noe
dd17d3516c PR fixes 2025-12-18 12:10:02 +00:00
tctinh
ae86e3a5f5 feat: enhance removeTrailingThinkingBlocks to preserve signed thinking blocks 2025-12-18 10:47:12 +07:00
tctinh
08f9da97f7 feat: implement thinking block sanitization for Claude API compliance 2025-12-18 10:47:02 +07:00
Noe
314ac9d427 feat(claude): add multi-turn thinking signature caching and real-time SSE streaming
Implement comprehensive support for Claude thinking models with interleaved
thinking in multi-turn conversations:

- Add signature caching system to preserve and restore thinking block
  signatures across conversation turns, preventing "invalid signature" errors
- Enable real-time SSE streaming with immediate forwarding of thinking tokens
- Add interleaved-thinking-2025-05-14 beta header for Claude thinking models
- Implement smart system hints to encourage thinking during tool use
- Add VALIDATED mode for tool calling on Claude models
- Ensure output token limits accommodate thinking budgets
- Filter and sanitize thinking blocks, removing SDK-injected cache_control
- Add comprehensive test suites for auth, cache, and request-helpers modules
- Update build config to exclude test files from production builds
- Document streaming and thinking features in README
2025-12-17 15:52:40 +00:00
Noe
c42a90d645 feat(auth): add login mode selection and improve rate limit handling
- Add CLI prompt to choose between adding accounts or starting fresh
- Implement automatic retry with backoff for single-account rate limits
- Show toast notifications for account switching and rate limit status
- Clear stale account storage when OpenCode auth state changes
- Add sleep helper function with abort signal support
- Improve README with clearer step-by-step setup instructions

TUI flow now adds accounts non-destructively; CLI flow offers choice.
2025-12-17 00:09:17 +00:00
Noe
2052e4d580 Add multi-account load balancing and improved OAuth UX
Adds multi-account support and round-robin load balancing for Google Antigravity OAuth to increase request throughput and resilience. Introduces an on-disk account pool with cooldowns for rate-limited accounts, automatic removal of revoked refresh tokens, and persistence of rotation state.

Improves OAuth flows and UX: CLI flow can add multiple accounts with per-account project IDs, TUI flow remains single-account, improved browser opening/fallback copy-paste handling, and clearer prompts for pasting redirect URLs or codes. Adds robust parsing of callback input and better headless handling.

Makes token refresh handling explicit and typed (throws a specific error on invalid_grant) and centralizes account management logic into an in-memory manager with persistence utilities. Adds tests for account rotation and rate-limit behavior and bumps package version.

Overall, this increases reliability under rate limits, makes multi-account configuration straightforward, and improves error handling and developer/user experience.
2025-12-16 01:35:02 +00:00
tctinh
98fe23a19b feat: add headers initialization for response transformation in Antigravity 2025-12-13 17:00:10 +07:00
tctinh
09509c3038 Merge branch 'main' of github.com:tctinh/opencode-antigravity-auth 2025-12-13 16:57:54 +07:00
tctinh
a85e6be8dc feat: enhance schema normalization and streaming response handling in Antigravity requests 2025-12-13 16:39:45 +07:00
tctinh
85d2847baf feat: implement true streaming support for SSE responses with TransformStream and enhance response transformation 2025-12-13 10:36:48 +07:00
tctinh
52597a212b feat: enhance thinking/reasoning support with configuration extraction and filtering 2025-12-12 12:41:16 +07:00
tctinh
7bd9474a88 feat: add thinking/reasoning support for Claude and Gemini models
- Add transformThinkingParts() to transform thinking content in responses
- Handle both Gemini-style (thought: true) and Anthropic-style (type: thinking)
- Extract thinking config from extra_body and Anthropic-style options
- Auto-enable thinking for thinking-capable models (opus, gemini-3, thinking)
- Filter unsigned thinking blocks for Claude multi-turn conversations
- Apply transformations to both streaming and JSON responses
2025-12-12 11:36:03 +07:00
tctinh
e2b2e9b955 Fix tool call issue with claude model cause by multiples tool call result 2025-12-11 00:17:37 +07:00
Noe
8e58a2474c better repo config 2025-12-10 15:18:43 +00:00
Noe
fe39ca886d Fixed anthropic models tool use 2025-12-10 13:14:55 +00:00
Noe
d946805235 Updates to make it work with workspace accounts 2025-12-10 11:33:03 +00:00
Noe
6a801b6373 Removed fallback logic 2025-12-10 10:32:32 +00:00
Noe
5d229bf44e First commit - auth and models working 2025-12-09 23:59:18 +00:00