fix: 清洗 Claude 工具 schema 并改写被 Antigravity 误判的身份前缀 - #412
Open
neverforget-1 wants to merge 1 commit into
Open
neverforget-1 wants to merge 1 commit into
neverforget-1 wants to merge 1 commit into
Conversation
- 新增 _ensure_empty_tool_schema_for_claude: 对话式客户端传入的不完整工具 schema 清洗为 Antigravity 接受的结构 - 识别并改写触发 Antigravity 429 误判的系统身份前缀,避免正常请求被当作滥用拦截 - 补充对应测试
This branch has not been deployed
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.
背景 / Background
两类上游 429 误判:
方案 / Solution
_ensure_empty_tool_schema_for_claude:对进入 antigravity 转换层的工具声明做结构清洗(补全空 schema 的 type/properties 字段)测试 / Testing
pytest tests/test_gemini_fix.py:3 passedEnglish TL;DR: Sanitize incomplete tool schemas from conversational agent clients into structures Antigravity accepts, and reword system-identity prefixes that Antigravity's abuse heuristic misjudges as 429s (semantically equivalent rephrasing). Includes tests.
Note: 另外注意到上游 master 的
tests/test_gemini_fix.py引用了gemini_fix._ensure_empty_tool_schema_for_claude,但该函数实际定义在antigravity_fix.py,上游当前 master 测试存在 ImportError——本 PR 合并后可修复该问题(本 PR 的测试文件包含正确定义与导入)。