Skip to content

Refactor external agent runtime architecture - #1110

Merged
chen-ran merged 4 commits into
mainfrom
stack/external-agent-architecture
Sep 1, 2026
Merged

Refactor external agent runtime architecture#1110
chen-ran merged 4 commits into
mainfrom
stack/external-agent-architecture

Conversation

@akazwz

@akazwz akazwz commented Aug 31, 2026

Copy link
Copy Markdown
Member

变更内容

  • 抽出中立的 External Agent Driver 接口,由应用层统一调度 Native、通用 ACP 和后续 direct runtime。
  • 将通用 ACP 收敛为自定义 Agent 通道,移除 Codex、Claude Code、Hermes 的内置 ACP profile 和旧 OAuth 接线。
  • 统一 External Agent 的会话状态、恢复、工具审批、Ask User、凭证和 Bot Agent 生命周期边界。
  • 增加 direct Codex / Claude Code runtime 的数据库约束,但不把旧内置 ACP Agent、Session、Schedule 或凭证回填为 Direct Agent。
  • 升级时将旧内置 ACP 默认值重置为 Native、删除对应 Schedule、归档旧 Session,并退役对应 Bot Agent;自定义 ACP 不受影响。
  • 将 ACP checkpoint 表按统一 External Agent 语义改名为 agent_session_*,保留通用 ACP 的既有 checkpoint 数据。
  • 升级 workspace contract v3:内置 direct Codex/Claude CLI,移除旧 ACP wrapper 和 Hermes。

PR 边界

本 PR 建立共享架构、通用 ACP 基础和数据库 schema/retirement migration,不包含 Codex/Claude Code 的具体 direct runtime 或 Web 接入。该 stack 应整体合入,Direct Agent 由用户升级后重新创建并认证。

风险

  • 旧内置 ACP Codex、Claude Code 和 Hermes 不提供到新 Direct Agent 的连续性迁移;旧默认会回落到 Native,旧 Schedule 被删除,旧 Session 被归档,凭证不会自动绑定到新的 Direct Agent。
  • 0144 down migration 会删除新版本创建的 Direct Agent、Session、Schedule 和对应历史,而不会把它们伪装回旧 ACP profile。
  • workspace contract 升级到 v3,旧 workspace image 需要重建。
  • feat(queue): add live steer and follow-up session input queues #1105 当前同样占用 migration 0144;两个 PR 中后合入者必须在 merge 前 rebase 并重新编号。

验证

  • mise run sqlc-generate 完成且无生成漂移。
  • go test ./... 通过。
  • migration integration tests 已覆盖旧内置 ACP 退役、Native 默认回落、自定义 ACP 保留、0145 rename,以及 down migration 丢弃 Direct 数据;真实 PostgreSQL 执行由 PR migration CI 验证。

⚠️ No human QA — this PR has not been verified by a human yet. Remove this line once a human confirms the happy path.

@akazwz
akazwz requested review from a team as code owners August 31, 2026 05:08
@akazwz akazwz changed the title refactor(agent): introduce external agent runtime foundation Refactor external agent runtime architecture Aug 31, 2026
@akazwz
akazwz force-pushed the stack/external-agent-architecture branch 2 times, most recently from b330124 to 4ebf7e7 Compare August 31, 2026 05:20
@akazwz
akazwz force-pushed the stack/external-agent-architecture branch 3 times, most recently from ee5cddf to dc37e7c Compare August 31, 2026 10:14
@chen-ran
chen-ran force-pushed the stack/external-agent-architecture branch from 83a5bbc to 65a126b Compare September 1, 2026 19:55
@chen-ran
chen-ran merged commit 9801a81 into main Sep 1, 2026
29 of 31 checks passed
sheepbox8646 added a commit that referenced this pull request Sep 2, 2026
Design for moving agent CLIs out of the workspace image contract into a
server-pinned, user-visible dependency manager, revised for the direct
Codex/Claude Code runtimes (#1110-#1112). The plan groups the work into
five stacked code PRs with per-PR file lists, tests and merge conditions,
and documents the gh-stack workflow used to land them.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017sihinqYWYNmZ9K842WqDJ
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.

2 participants