docs: clarify HWLAB session resume boundaries
This commit is contained in:
@@ -101,6 +101,8 @@ HWLAB v0.2 原有 Code Agent 已经验证了 profile、session、workspace 和 S
|
||||
| writable `CODEX_HOME` 与 Secret 投影分离 | `docs/reference/code-agent-chat-readiness.md` | `ProfileRef` + runner runtime home | Secret 只读投影,复制到当前 run/profile writable runtime home;profile 间不共享。 |
|
||||
| runner/image 可追溯 | HWLAB live build/source metadata | `BackendImageRef.image` | runner/backend image 必须可追溯 digest/source commit,不能由调用方任意传未受控镜像。 |
|
||||
|
||||
HWLAB Workbench 的 project/workspace 不属于 RuntimeAssembly 四要素,也不是 AgentRun `projectId`。这些业务字段只能作为 metadata 或 `workspaceRef` 的 HWLAB 子字段进入 run;AgentRun policy 字段仍以 `tenantId` / `projectId` / `providerId` / `backendProfile` 为准。HWLAB `providerProfile` 在 RuntimeAssembly 中只映射为 `ProfileRef.profile` 和 run `backendProfile`,并应由显式 HWLAB session 继承,不能从 stale workspace fallback 覆盖。
|
||||
|
||||
## 四要素边界
|
||||
|
||||
### BackendImageRef
|
||||
@@ -139,6 +141,7 @@ HWLAB v0.2 原有 Code Agent 已经验证了 profile、session、workspace 和 S
|
||||
- runner 启动时把 PVC 名、namespace、mount path、codex rollout subdir 写入 env(`AGENTRUN_SESSION_PVC_NAME`、`AGENTRUN_SESSION_PVC_NAMESPACE`、`AGENTRUN_SESSION_PVC_MOUNT_PATH`、`AGENTRUN_CODEX_ROLLOUT_SUBDIR`),backend adapter 不需要直接读 k8s API。
|
||||
- `codex_rollout_subdir` 走 env,默认 `sessions`,codex CLI 升级改子目录时只改该 env,不改 runner/backend 装配。
|
||||
- `POST /api/v1/sessions` 创建 session 时同步创建 PVC;`POST /api/v1/runs/:runId/commands` 命中已有 session 且 `storage_kind='evicted'` 时短路返回 `session-store-evicted`,不创建 runner Job。
|
||||
- runner pod 删除或旧 lease 过期后的 replacement runner 只改变执行尝试 identity,不改变 RuntimeAssembly 的 `SessionRef`、`ProfileRef` 或 `ResourceBundleRef`。验收时应证明 replacement run/job 仍使用同一 `SessionRef.sessionId`、`threadId`、`ProfileRef.profile` 和 PVC;不能通过新 session、新 profile 或历史 prompt 拼接来制造 resume 表象。
|
||||
- GC 循环(默认 5min,可调 `AGENTRUN_SESSION_GC_INTERVAL_MS`)扫到 `expires_at` 过 + 无 active run 的 session 删 PVC。
|
||||
- runner Job 启动后把 PVC 摘要(`pvcName`/`pvcPhase`/`storage_size_bytes`/`storage_files_count`/`storage_sha256`/`storage_updated_at`)通过 `POST /api/v1/sessions/:id/storage/refresh` 写回 manager;manager 不读 PVC 内容,只读摘要。
|
||||
|
||||
@@ -280,8 +283,8 @@ HWLAB v0.2 原有 Code Agent 已经验证了 profile、session、workspace 和 S
|
||||
| 要素 | v0.1 状态 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `BackendImageRef` | 部分实现 | CI/CD 已使用 digest-pinned runtime image;当前 runner/backend 仍复用 agentrun 镜像。 |
|
||||
| `ProfileRef` | 已实现/待 MiniMax-M3 主闭环 | `codex` 与 `deepseek` 已通过 SecretRef、writable runtime home 和真实 stdio turn 验证;`minimax-m3` 已进入 profile/SecretRef 装配,需要完成真实 CLI 手动验收。 |
|
||||
| `ProfileRef` | 已实现/已通过 HWLAB v0.2 原入口复测 | `codex`、`deepseek` 与 `minimax-m3` 已通过 SecretRef、writable runtime home 和真实 stdio turn 验证;MiniMax-M3 已通过 HWLAB 显式 session 原入口复测,后续只允许作为 profile/config/SecretRef 选择,不新增直连 backend。 |
|
||||
| `SessionRef` | 已实现最小持久化 | manager 持久化 `sessionId/conversationId/threadId`,run 创建会解析既有 session,runner 按 threadId resume;session 不保存 credential 文件,TTL/GC 后续细化。 |
|
||||
| `SessionRef` | v0.1.1 实现中/未发布 | manager 持久化 `sessionId/conversationId/threadId` + 每个 session 绑 RWO PVC(`agentrun-v01-session-<sessionId>`),runner Job 把 PVC 直接挂到 `${CODEX_HOME}/<codex_rollout_subdir>`,codex app-server 自己落盘;不允许 copy/restore,不允许 replacement threadId;TTL/GC 由 mgr 周期任务管理。 |
|
||||
| `SessionRef` | v0.1.1 已实现/已通过 HWLAB v0.2 原入口复测 | manager 持久化 `sessionId/conversationId/threadId` + 每个 session 绑 RWO PVC(`agentrun-v01-session-<sessionId>`),runner Job 把 PVC 直接挂到 `${CODEX_HOME}/<codex_rollout_subdir>`,codex app-server 自己落盘;runner pod 删除后 replacement runner 仍复用同一 SessionRef/PVC/thread,禁止 copy/restore、replacement threadId 和 fake resume。 |
|
||||
| `ResourceBundleRef` | 已实现 Git-only materialization/待 promptRefs 与 skillRefs 实现 | `repoUrl + full commitId` 已进入 run schema 和 runner checkout,workspace 受 `AGENTRUN_WORKSPACE_ROOT` 限制,event/result 记录 commit/tree/workspace 摘要;`toolAliases` 已实现,`promptRefs` thread-start 注入和 `skillRefs` registry 聚合待实现。 |
|
||||
| `toolCredentials` | 已实现最小 env projection | GitHub PR 和 UniDesk SSH passthrough 等 agent shell/tool 授权通过装配 SPEC 的 SecretRef 进入 runner;v0.1 支持 `tool=github` 与 `tool=unidesk-ssh`、`projection.kind=env`,runner Job 使用 `valueFrom.secretKeyRef` 注入,不用 `transientEnv` 绕过。 |
|
||||
|
||||
Reference in New Issue
Block a user