Repository navigation
fix(cli): show the old-backend hint when call --preview gets a 400 - #81
Merged
Merged
Conversation
call rebuilds its error from the response body in actionErrorDetail, so the hint withPreviewHint appends to the HttpError message never reached the output (call, --stream and --output alike). Add it as the detail's hint field when a 400 mentions include_preview; other 400s are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
自查发现:
call --preview连到还不支持 preview 的后端时会返回 400,但输出里没有「后端版本不支持」的提示。list、get等命令都有这个提示。原因:
call的报错由actionErrorDetail根据响应体重新组装,withPreviewHint加在 HttpError message 上的提示就丢了。call、--stream、--output三条路径都受影响。修复:在
actionErrorDetail里统一处理。如果是 400 且错误内容提到include_preview,就在输出里加上hint字段。提示文案和withPreviewHint共用同一个常量。其他 400 不受影响。验证:新增回归测试,覆盖带 include_preview 的 400 和普通 400 两种情况;
bun test1540 个通过、0 个失败;tsc --noEmit通过。Kanby-Task: KANBY-141
🤖 Generated with Claude Code