Skip to content

feat(cli): accept the PREVIEW lifecycle state and add --preview - #79

Merged
dxiongya merged 3 commits into
devfrom
feature/sandbox-to-preview
Nov 25, 2026
Merged

dxiongya merged 3 commits into
devfrom
feature/sandbox-to-preview

Conversation

@dxiongya

Copy link
Copy Markdown
Collaborator

Sandbox → Preview 改名的 P0(客户端先兼容)。服务的生命周期状态 SANDBOX 将改名为 PREVIEW;Sandbox 计算产品不改名。

改动

  • provider wait 等读取修订状态的地方同时接受 SANDBOX 和 PREVIEW。旧版 CLI 只认 SANDBOX,后端 P1 开始写 PREVIEW 后会卡住,所以 CLI 要先发。
  • 新增 --preview:action 列表、搜索、get、get-batch、categories 会带上 include_preview=true,用来取代 key 上的 allowSandbox 权限。--code 生成的代码片段也会带上这个参数。
  • 后端还没上 P1 时,带 --preview 的请求会返回 400,CLI 会提示这是后端版本还不支持。不带 --preview 时行为不变。

文档(feature/sandbox-to-preview-docs)跟后端 P1 一起发,不在本 PR。

验证

bun test 全部通过,新增了 action、client、codegen、provider-onboarding 的测试。和 dev、staging 都没有冲突。

Kanby-Task: KANBY-141

🤖 Generated with Claude Code

dxiongya and others added 3 commits November 24, 2026 00:24
The backend renames the provider lifecycle state SANDBOX to PREVIEW.
`provider wait` rejected PREVIEW as an unknown state and crashed with
"Invalid review response"; it now accepts PREVIEW (and still SANDBOX
during the transition) and reports it like SANDBOX.

Preview services are no longer exposed through a key permission.
`list`, `search` and `services` gain `--preview` (query
include_preview=true) and `call` gains `--preview` (execute body field
include_preview: true, on json/stream/output/output-json paths). The
field is sent only when the flag is given so older backends keep working.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`categories` sends include_preview=true as a query parameter; `get` and
`get-batch` (both POST /v1/actions/batch) add include_preview: true to the
body. As before, the field is sent only when --preview is given.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…d 400s

- call/get --code --preview now emit include_preview in every generated
  snippet (curl, python, js, ts, go), so the snippet reaches the same
  PREVIEW service the command would.
- A backend that predates preview rejects the body field with 400
  "property include_preview should not exist"; the error now says
  --preview needs a backend with preview support. call --help says so too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dxiongya
dxiongya merged commit 71344fd into dev Nov 25, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant