Conversation
…count Refactor 401 error handling in both executeWithRetry and executeStreamWithRetry to always attempt token refresh regardless of remaining retry attempts. Previously, token refresh was only attempted when retries remained, which could leave valid refreshed tokens unused. Also add auth directory resolution in RefreshManager.Initialize to properly resolve the base directory path before creating the token repository.
fix(kiro): always attempt token refresh on 401 before checking retry …
feat(kiro): 添加用于令牌额度查询的api-call兼容
Add ExtractIDCIdentifier and GenerateTokenFileName functions to centralize token filename generation logic. This improves code maintainability by: - Extracting IDC identifier from startUrl for unique token file naming - Supporting priority-based filename generation (email > startUrl > authMethod) - Removing duplicate filename generation code from oauth_web.go - Adding comprehensive unit tests for the new functions
…e-#131 Resolve Issue router-for-me#131
The background refresher was skipping token files with auth_method values like 'IdC' or 'IDC' because the comparison was case-sensitive and only matched lowercase 'idc'. This fix normalizes the auth_method to lowercase before comparison in: - token_repository.go: readTokenFile() when filtering tokens to refresh - background_refresh.go: refreshSingle() when selecting refresh method Fixes the issue where 'IdC' != 'idc' caused tokens to be skipped entirely.
**Problem:** GitHub Copilot API returns 400 error "missing required Copilot-Vision-Request header for vision requests" when requests contain image content blocks, even though the requests are valid Claude API calls. **Root Cause:** The GitHub Copilot executor was not detecting vision content in requests and did not add the required `Copilot-Vision-Request: true` header. **Solution:** - Added `detectVisionContent()` function to check for image_url/image content blocks - Automatically add `Copilot-Vision-Request: true` header when vision content is detected - Applied fix to both `Execute()` and `ExecuteStream()` methods **Testing:** - Tested with Claude Code IDE requests containing code context screenshots - Vision requests now succeed instead of failing with 400 errors - Non-vision requests remain unchanged Fixes issue where GitHub Copilot executor fails all vision-enabled requests, causing unnecessary fallback to other providers and 0% utilization. Co-Authored-By: Claude (claude-sonnet-4.5) <noreply@anthropic.com>
支持多个idc登录凭证保存
…case-sensitivity fix: case-insensitive auth_method comparison for IDC tokens
Changed the provider matching logic in AccountInfo() method to use prefix matching instead of exact matching. This allows both 'github' (Kiro OAuth) and 'github-copilot' providers to be correctly identified as OAuth providers, enabling proper debug logging output. Before: Use OAuth logs were missing for github-copilot requests After: Logs show "Use OAuth provider=github-copilot auth_file=..." Co-Authored-By: Claude (claude-sonnet-4.5) <noreply@anthropic.com>
… support with device registration loading for Kiro.
…ve matching during token refresh and introduce new CLIProxyAPIPlus component.
When the Kiro/AWS CodeWhisperer API receives a Write tool request with content that exceeds transmission limits, it truncates the tool input. This can result in: - Empty input buffer (no input transmitted at all) - Missing 'content' field in the parsed JSON - Incomplete JSON that fails to parse This fix detects these truncation scenarios and converts them to Bash tool calls that echo an error message. This allows Claude Code to execute the Bash command, see the error output, and the agent can then retry with smaller chunks. Changes: - kiro_claude_tools.go: Detect three truncation scenarios in ProcessToolUseEvent: 1. Empty input buffer (no input transmitted) 2. JSON parse failure with file_path but no content field 3. Successfully parsed JSON missing content field When detected, emit a special '__truncated_write__' marker tool use - kiro_executor.go: Handle '__truncated_write__' markers in streamToChannel: 1. Extract file_path from the marker for context 2. Create a Bash tool_use that echoes an error message 3. Include retry guidance (700-line chunks recommended) 4. Set hasToolUses=true to ensure stop_reason='tool_use' for agent continuation This ensures the agent continues and can retry with smaller file chunks instead of failing silently or showing errors to the user.
…eamResult` for consistency - Updated `ExecuteStream` functions in executors to use `StreamResult` instead of channels. - Enhanced upstream header handling in OpenAI handlers. - Improved maintainability and alignment across executors and handlers.
feat(registry): add Gemini 3.1 Pro to GitHub Copilot provider
…ng-stream-dedup fix(kiro): stop duplicated thinking on OpenAI and preserve Claude multi-turn thinking
feat(registry): add GPT-4o model variants for GitHub Copilot
…aude-aliases fix: add default copilot claude model aliases for oauth routing
- Change RequiredFieldsByTool value type from []string to [][]string - Outer slice = AND (all groups required); inner slice = OR (any one satisfies) - Fix Bash entry to accept "cmd" or "command", resolving soft-truncation loop - Update findMissingRequiredFields logic and inline docs accordingly
…ToolResults fix: filter out orphaned tool results from history and current context
fix(kiro): support OR-group field matching in truncation detector
# Conflicts: # internal/runtime/executor/claude_executor_test.go # sdk/api/handlers/handlers_stream_bootstrap_test.go
Xm798
pushed a commit
that referenced
this pull request
Feb 26, 2026
由AI进行更改修复了Kiro供应商的Claude协议与OpenAI协议。(对比AIClient-2-API项目进行变更)
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.
No description provided.