[FEATURE] Carry the naked upstream HTTP status code through the provider invoker boundary
@jeffreyaven 已经在做这个了。
开始于 2026年7月3日。
评估
这个 Issue 还没有评估数据。
描述
Description
providerinvoker.Result is currently {Body any, Messages []string}. The anysdkhttp invoker consumes the *http.Response internally, so consumers (stackql) never see the upstream HTTP status code as a value. The status survives only as text embedded in error message strings, and only when the error body parses into the shapes that processHttpResponse formats as:
HTTP response error. Status code 403. Detail: '...'
Response error. Status code 403. Body: {...}
Error bodies published verbatim (non-object JSON, HTML, XML, plain text) carry no structured status fragment at all.
Impact
stackql/stackql#670 (MCP tools must distinguish "query ran, zero rows" from "query failed upstream", with 404 mapping onto an empty result set under database semantics) had to be implemented in stackql by regex-parsing status codes back out of message text:
(?i)status code:?\s*(\d{3})in two packages (internal/stackql/executionandinternal/stackql/mcpbackend), plus- a deliberately loose
(?i)\b404\b|not\s+foundfallback for unstructured bodies.
That is fragile by construction, duplicated, and imprecise for the verbatim-body case.
Proposal
Expose the status code on the invoker result, eg:
type Result struct {
Body any
Messages []string
StatusCode int // 0 when no HTTP exchange occurred
}
or alternatively a typed upstream error carrying StatusCode. Additive and backwards compatible. The invoker sets it from the final httpResponse.StatusCode on both success and error paths, including the parsed-error-envelope (HasError) path and the verbatim-body path.
Companion
stackql-side consumption is tracked in ; on completion stackql deletes both regexes and the loose fallback.
- 主要语言
- Go
- 星标
- 0
- 派生
- 1
- 平均合并
- 33 分钟
- 30 天内合并 PR
- 7
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
stackql/any-sdk 的其他 Issue
-
enhancement go
难度 5/5 一周以上 新手友好度 38/100
-
enhancement
难度 3/5 1-2 天 新手友好度 78/100
-
[FEATURE] GraphQL mutation support (operationType, variables payload, errors-in-200 selection)可能重新可做 @jeffreyaven 于 39 天前认领,目前没有进行中的 PR。 未关闭enhancement
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
ClickHouse/ch-go#1218 ·
维护者通常 13 天内回复
-
automation models
难度 1/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 77/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
-
难度 2/5 1-3 小时 新手友好度 72/100
podman-container-tools/podman#30031 ·
维护者通常 1 天内回复