docs: 固化 HWLAB 基线承接 SPEC
This commit is contained in:
@@ -30,6 +30,19 @@ Backend adapter 消费 RuntimeAssembly 中的 `BackendImageRef` 和 `ProfileRef`
|
||||
|
||||
`v0.1` 的第一真实 adapter 是 Codex stdio adapter。它必须走 Codex CLI app-server JSON-RPC over stdio;adapter 合同把 Codex 的 thread、turn、notification、tool lifecycle 和 stderr/exit 信息归一化为 AgentRun 标准 events。`codex` 与 `deepseek` 只是该 adapter 的 profile/config/SecretRef 选择,不允许复制两套协议实现。
|
||||
|
||||
## HWLAB v0.2 Code Agent 能力吸收
|
||||
|
||||
Backend adapter 的第一阶段实现应吸收 HWLAB v0.2 已验证的 Codex stdio 行为,而不是另写一套不兼容协议。吸收只限通用 backend 执行能力,HWLAB 的自然语言业务路由、device-pod 授权和 Workbench 展示不进入 adapter。
|
||||
|
||||
| HWLAB v0.2 基线 | 参考入口 | Adapter 固化规则 |
|
||||
| --- | --- | --- |
|
||||
| Codex app-server JSON-RPC stdio | `internal/cloud/codex-stdio-session.ts`、`internal/cloud/codex-stdio-session-turn-state.ts` | 支持 `initialize`、`thread/start`、`thread/resume`、`turn/start`,并处理 app-server client request;未知请求要记录 unsupported error,不能静默等待。 |
|
||||
| completed 判定 | `docs/reference/code-agent-chat-readiness.md` | 只有 Codex turn terminal completed 且 assistant reply 可聚合时才输出 completed;assistant delta、item completed、stdout 或 transport close 不能单独完成。 |
|
||||
| assistant stream 和 trace | `internal/cloud/code-agent-trace-store.ts` | assistant delta 可归并为 `assistant_message`;event 必须保留 `threadId`、`turnId`、session 摘要和 redacted backend metadata。 |
|
||||
| command/tool output bounded | `docs/reference/code-agent-chat-readiness.md`、`web/hwlab-cloud-web/app-trace.ts` | `tool_call` 和 `command_output` 必须记录状态、摘要、字节数、截断标记;完整大输出只能通过后续 log/artifact 引用。 |
|
||||
| provider/profile 隔离 | `internal/cloud/code-agent-contract.ts` | `codex` 与 `deepseek` 共享同一 backend kind,但必须使用 profile-scoped SecretRef、model/base-url/config 和 writable runtime home。 |
|
||||
| Secret redaction | `internal/cloud/code-agent-trace-store.ts` | `OPENAI_API_KEY`、auth/config、token、password、kubeconfig、URL credential 不得进入 event、result、log 或 health。 |
|
||||
|
||||
## Backend Profile Registry
|
||||
|
||||
`GET /api/v1/backends` 和 adapter 内部 registry 至少报告以下 profile:
|
||||
|
||||
Reference in New Issue
Block a user