[FEATURE]: Show HTTP response headers and status in opencode api

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
68/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
typescript
领域
cli

调研方向

定位 opencode api 命令的实现,以及其标志(尤其是 --header)的解析位置;打印正文和非 2xx 状态消息的响应处理就是新输出应放置的位置。添加一个 opt-in 的 --include 标志,在正文之前打印状态行和响应头,同时保持仅输出正文为默认行为。使用本地服务器的空响应、成功响应和错误响应进行验证,并检查故障排查文档中关于检查 API 的部分,以更新措辞。

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

描述

area/cli type/feature version/v2
Feature hasn't been suggested before.
  • I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request

Add an opt-in mode to opencode api, such as --include, that displays the HTTP response status and headers alongside the body. Retain the existing body-only default.

The current command accepts outgoing --header values but prints only the response body, plus a status message for non-2xx responses. This makes it awkward to inspect an empty response or verify ETag, Last-Modified, Content-Type and Retry-After when testing OpenCode endpoints. The workaround is rebuilding the authenticated request in curl or an SDK script.

The mode should work for successful, empty and error responses. It would extend the API troubleshooting workflow already documented in Troubleshooting, using the command's existing server discovery and authentication.

This concerns responses from the OpenCode server. It is separate from provider-response metadata in #26091 and request-body file/stdin support in #51199.

主要语言
TypeScript
星标
227k
派生
30.7k
平均合并
3 小时 57 分钟
30 天内合并 PR
484

环境准备

从这里开始

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

anomalyco/opencode 的其他 Issue

查看 anomalyco/opencode 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

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