api-proxy adds stream_options to Claude-on-Vertex requests, which then fail with 400
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 82/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- javascript
调研方向
阅读 containers/api-proxy/body-transform.js,尤其是 injectStreamOptions,以及 body-transform.test.js 中现有的用例。为 rawPredict 和 streamRawPredict 路径补充回归测试,包括 v1beta1 和查询字符串,然后检查 Vertex 的 OpenAI 兼容请求是否仍会收到 stream_options。当这些用例通过,且报告中的 Claude-on-Vertex 请求不再收到额外字段时,即为完成。
由索引模型根据 Issue 内容生成。
描述
Anthropic's Claude is officially available on Google Vertex AI (Google docs), and Claude Code supports it with CLAUDE_CODE_USE_VERTEX=1 (Claude Code docs). Requests send a Messages API body to .../publishers/anthropic/models/{model}:streamRawPredict.
When I route this through the AWF Vertex adapter (port 10004), every request fails with:
400 invalid_request_error: stream_options: Extra inputs are not permitted
Authentication via GCP WIF and model access both work. Calling the same model without AWF returns a normal response.
The field comes from injectStreamOptions in the api-proxy (code):
- It adds
stream_optionsso that token usage can be read from OpenAI-style requests. - Anthropic-style requests are skipped when the provider is
anthropicor the path is/messages. - Claude on Vertex uses the
vertexprovider and a:streamRawPredictpath, so neither check applies and the field gets added.
Skipping .../publishers/anthropic/models/{model}:rawPredict and :streamRawPredict should fix it. Vertex's OpenAI-compatible endpoint (/endpoints/openapi/chat/completions) can keep the current behavior. The patch and regression tests are available on this fork branch. Creating a draft PR against gh-aw-firewall was rejected with a CreatePullRequest permission error, so no PR is open yet.
The firewall change is limited to containers/api-proxy/body-transform.js. Add regression tests in body-transform.test.js for rawPredict / streamRawPredict, including v1beta1 and query strings, and verify that Vertex OpenAI-compatible requests still get the field. The new cases fail before the patch and pass after it. This fixes the body transformation only, not compiler support or token startup retries.
Versions: gh-aw v0.93.0, AWF v0.28.70, Claude Code 2.1.296. I set up the Vertex environment for Claude Code by hand. Compiler support is requested separately in #71985.
- 主要语言
- Go
- 星标
- 5.5k
- 派生
- 606
- 平均合并
- 4 小时 13 分钟
- 30 天内合并 PR
- 823
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
github/gh-aw 的其他 Issue
-
[doc-healer] DDUw improvement: retry integrity-filtered issue reads with direct single-item lookups未关闭automation documentation
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
automated-analysis code-quality cookie testing
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
ai-inspected
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
agent-research
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
automation cli cookie documentation
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
docs: Google Safe Browsing flags go-bonnie.dev as "deceptive" (pipe-to-shell install instructions)未关闭documentation
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 2 天内回复
-
[Bug]: Telegram bot (v3.11.0): "Ban log" no longer sends the current 3xipl-banned.log可能已有人在做 @HamedSanaei 今天认领。 未关闭bug
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 3 天内回复
-
bug(tool/internal/instrument): identical inject_code rules from two rule packages are applied twice未关闭
难度 2/5 1-3 小时 新手友好度 76/100
open-telemetry/opentelemetry-go-compile-instrumentation#1611 ·
维护者通常 2 天内回复