Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

api-proxy adds stream_options to Claude-on-Vertex requests, which then fail with 400

未关闭 适合新手
#71,987 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
javascript
领域
backend, testing

调研方向

阅读 containers/api-proxy/body-transform.js,尤其是 injectStreamOptions,以及 body-transform.test.js 中现有的用例。为 rawPredict 和 streamRawPredict 路径补充回归测试,包括 v1beta1 和查询字符串,然后检查 Vertex 的 OpenAI 兼容请求是否仍会收到 stream_options。当这些用例通过,且报告中的 Claude-on-Vertex 请求不再收到额外字段时,即为完成。

由索引模型根据 Issue 内容生成。

描述

ai-inspected

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_options so that token usage can be read from OpenAI-style requests.
  • Anthropic-style requests are skipped when the provider is anthropic or the path is /messages.
  • Claude on Vertex uses the vertex provider and a :streamRawPredict path, 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

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

github/gh-aw 的其他 Issue

查看 github/gh-aw 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。