fix: 让 gitbundle 自动使用 G14 git mirror

This commit is contained in:
AgentRun Codex
2026-06-11 16:48:50 +08:00
parent 8cf6534bec
commit e624835bc8
8 changed files with 34 additions and 61 deletions
+7 -9
View File
@@ -93,23 +93,21 @@ imageRef:
- 通过 `toolCredentials` 获取 GitHub Issue/PR 写入 token`agentrun-v01-tool-github-pr` -> env `GH_TOKEN`
- 通过 `toolCredentials` 获取 UniDesk SSH 透传 token`agentrun-v01-tool-unidesk-ssh` -> env `UNIDESK_SSH_CLIENT_TOKEN`
- 通过 `toolCredentials` 获取 GitHub SSH 凭据:`agentrun-v01-tool-github-ssh` -> volume `/home/agentrun/.ssh`
- 通过 GitHub SSH 直接 checkout 多仓库 gitbundle,装配 UniDesk repo 中的 `unidesk-*` skills、AgentRun repo 中的 `tools/trans``tools/tran``tools/apply_patch`,以及 `agent_skills` repo 中的 `dad-dev``cli-spec``docs-spec``git-spec`Artificer 默认不依赖 G14 git mirror 的覆盖范围
- 通过声明 GitHub repo URL 的多仓库 gitbundle,装配 UniDesk repo 中的 `unidesk-*` skills、AgentRun repo 中的 `tools/trans``tools/tran``tools/apply_patch`,以及 `agent_skills` repo 中的 `dad-dev``cli-spec``docs-spec``git-spec`runner 物化阶段自动把 GitHub URL 改写到 G14 git mirrorArtificer 规格本身不声明 mirror 开关或 mirror base URL
- 通过 `requiredSkills[]` 在 runner 启动 backend 前校验 `dad-dev` 与 UniDesk 关键 skills 已被 materialize;缺失时必须 `required-skill-unavailable`,不得使用模型默认 skill 猜测。
- Artificer 默认是 session-capable agent。`render`/`queue submit --aipod Artificer` 在调用方没有显式传入 `sessionRef` 时,必须生成稳定的默认 `SessionRef``sessionId` 使用 `sess_artificer_<24 hex>` 形态,`conversationId` 默认等于 `sessionId`,并把该引用写入 Queue task/run 装配输入;后续 follow-up、补测、reviewer feedback 和 manager recovery 优先继续同一个 session,而不是每次新开 session。
## Git mirror
`resourceBundleRef.gitMirror` 用于把 GitHub repo URL 改写为 G14 git mirror read URL,提高 runner checkout 的稳定性和速度
Git mirror 是 AgentRun/G14 基础设施能力,不是 AipodSpec 或 Queue task 规格能力。`AipodSpec.spec.resourceBundleRef` 必须继续声明无明文 credential 的 GitHub repo URL;不得在 AipodSpec、Queue task、prompt 或业务 adapter 中声明 `gitMirror`、mirror base URL、direct/mirror 开关或 per-agent mirror 策略
规则:
- `enabled` 缺省为 `true`;显式 `false` 时不改写
- `baseUrl` 必须是无 credentials、query、fragment 的 HTTP(S) URL;未设置时 runner 使用 `AGENTRUN_GIT_MIRROR_BASE_URL`,再缺省为 `http://git-mirror-http.devops-infra.svc.cluster.local`
- runner 在 materialization 阶段自动把 GitHub URL 改写为 G14 git mirror read URL;基础 URL 来自 `AGENTRUN_GIT_MIRROR_BASE_URL`缺省为 `http://git-mirror-http.devops-infra.svc.cluster.local`
- 支持 `git@github.com:owner/repo.git``ssh://git@github.com/owner/repo.git``ssh://git@ssh.github.com:443/owner/repo.git``https://github.com/owner/repo.git`
- 非 GitHub URL 不改写,仍按原 `repoUrl` fetch。
- materialization event 必须输出 `repoUrl``fetchRepoUrl``mirrorUsed``mirrorBaseUrl`、requested ref/commit 和实际 commit;不得输出 credential 值
Artificer 默认 `gitMirror.enabled=false`,依靠 `agentrun-v01-tool-github-ssh` 投影的 SSH 凭据直接拉取 `unidesk``agentrun``agent_skills`。只有明确确认目标 repo 已纳入 G14 mirror cache 的规格,才应显式启用 `gitMirror`
- devops-infra mirror cache 必须覆盖 Artificer 默认 bundle 使用的 `pikasTech/unidesk``pikasTech/agentrun``pikasTech/agent_skills`;缺 cache 是基础设施缺口,不能通过修改 AipodSpec 直连 GitHub 来绕过
- materialization event 必须输出原始 `repoUrl`、实际 `fetchRepoUrl``mirrorUsed``mirrorBaseUrl`、requested ref/commit 和实际 commit;不得输出 credential 值。
## Tool credential projection
@@ -154,10 +152,10 @@ CLI
## 测试规格
- A1`config/aipods/artificer.yaml` 能被 manager list/show/renderrender 结果包含 `imageRef.kind=env-image-dockerfile``repoUrl``commitId``dockerfilePath``backendProfile=sub2api``model=gpt-5.5``reasoningEffort=xhigh`、provider SecretRef、GitHub PR token env projection、UniDesk SSH env projection、GitHub SSH volume projection、Artificer `gitMirror.enabled=false`、AgentRun runner tools gitbundle 和 gitbundle requiredSkills。
- A1`config/aipods/artificer.yaml` 能被 manager list/show/renderrender 结果包含 `imageRef.kind=env-image-dockerfile``repoUrl``commitId``dockerfilePath``backendProfile=sub2api``model=gpt-5.5``reasoningEffort=xhigh`、provider SecretRef、GitHub PR token env projection、UniDesk SSH env projection、GitHub SSH volume projection、`resourceBundleRef.gitMirror` 字段、AgentRun runner tools gitbundle 和 gitbundle requiredSkills。
- A2`queue submit --aipod Artificer --dry-run` 输出标准 `queue-submit-plan`,且 `idempotencyKey`、prompt 与 metadata 被保留。
- A2b`queue submit --aipod Artificer --dry-run``render Artificer` 在没有显式 `sessionRef` 时必须输出默认 `sessionRef.sessionId` / `conversationId`;显式传入 `sessionRef` 时不得覆盖。
- A3Artificer 默认 `gitMirror.enabled=false` 时 GitHub URL 保持 SSH fetch;显式启用 `gitMirror` GitHub URL 改写到 mirror base URL非 GitHub URL 不改写。
- A3Artificer 规格只声明 GitHub URL,不声明 `gitMirror`runner 默认把 GitHub URL 改写到 mirror base URL非 GitHub URL 不改写。请求体显式携带 `resourceBundleRef.gitMirror` 必须 schema-invalid,避免把基础设施策略下放到 AipodSpec。
- A4Aipod 启动/dispatch 能基于 `imageRef` 命中 artifact catalog / registry 并复用 digest-pinned env image;未命中时返回明确 build-required 或进入受控 CI/CD,不在 runner 任务内补装依赖。
- A5runner Job dry-run 支持 tool credential volume mount,并且 response/manifest/event 不泄漏 Secret 明文。
- A6`bun run check``bun run self-test` 必须覆盖 A1-A5。