补齐项目总控纯聊天入口

新增agc:chat短命令并默认进入project-supervisor
保留agc:swarm显式父Agent调试兼容
补充CLI默认路由与参数回归测试
同步Runtime方案、App计划和长期决策记录
完成真实终端入口启动退出验证
This commit is contained in:
AIGameCreator App
2026-07-15 04:20:29 +08:00
parent f5d2b3786a
commit 5f317e79f8
7 changed files with 38 additions and 7 deletions
+1
View File
@@ -10,6 +10,7 @@
"build": "npm --prefix ../.. exec tauri -- build",
"llm-status": "node scripts/run-cli-with-config.mjs --llm-status",
"agent-task": "node scripts/run-cli-with-config.mjs --agent-task",
"chat": "node scripts/run-cli-with-config.mjs --swarm-chat",
"swarm": "node scripts/run-cli-with-config.mjs --swarm-chat",
"agent-run": "node scripts/run-cli-with-config.mjs --agent-run",
"agent-run:smoke": "node scripts/smoke-agent-run-local-provider.mjs",
@@ -375,14 +375,17 @@ pub(crate) fn parse_cli_command(args: &[String]) -> Result<Option<CliCommand>, S
} else {
false
};
if rest.len() != 2 || rest.iter().any(|value| value.trim().is_empty()) {
if !(1..=2).contains(&rest.len()) || rest.iter().any(|value| value.trim().is_empty()) {
return Err(
"用法:--swarm-chat [--init] <本地项目绝对路径> <parentAgentId>".to_string(),
"用法:--swarm-chat [--init] <本地项目绝对路径> [parentAgentId]".to_string(),
);
}
return Ok(Some(CliCommand::SwarmChat {
project_path: PathBuf::from(&rest[0]),
parent_agent_id: rest[1].trim().to_string(),
parent_agent_id: rest
.get(1)
.map(|value| value.trim().to_string())
.unwrap_or_else(|| GAME_CREATOR_PROJECT_SUPERVISOR_AGENT_ID.to_string()),
initialize,
}));
}
@@ -924,6 +927,26 @@ mod tests {
assert!(error.contains("--config-dir"));
}
#[test]
fn swarm_chat_defaults_to_project_supervisor() {
let project_path = std::env::current_dir().expect("current directory");
let command = parse_cli_command(&[
"--swarm-chat".to_string(),
project_path.display().to_string(),
])
.expect("parse supervisor chat")
.expect("supervisor chat command");
assert_eq!(
command,
CliCommand::SwarmChat {
project_path,
parent_agent_id: GAME_CREATOR_PROJECT_SUPERVISOR_AGENT_ID.to_string(),
initialize: false,
}
);
}
#[test]
fn swarm_chat_rejects_missing_or_extra_arguments() {
assert!(parse_cli_command(&["--swarm-chat".to_string()]).is_err());
@@ -8,8 +8,8 @@
## 范围
- 新增 `--swarm-chat [--init] <本地项目绝对路径> <parentAgentId>`
- 新增短命令 `npm run agc:swarm -- --config-dir <项目外 AppData 绝对路径> [--init] <project> <parentAgentId>`
- 新增 `--swarm-chat [--init] <本地项目绝对路径> [parentAgentId]`,省略时默认进入 `project-supervisor`
- 新增总控短命令 `npm run agc:chat -- --config-dir <项目外 AppData 绝对路径> [--init] <project>`;保留 `agc:swarm` 显式父 Agent 调试入口
- 普通输入进入父 Agent background Runtime;不使用一次性 `--agent-chat`
- 复用 External Runner、active Session、现有 conversation、Agent 私有记忆、项目黑板、`agent.delegate``agent.spawn_isolated`、terminal receipt 和 all-join。
- 展示全部 Agent 的状态、事件、父子身份和委派关系,并支持在终端批准或拒绝待确认动作。
@@ -4577,6 +4577,12 @@
- 终审补充:finalization v2 读取边界必须再次要求所有结构化步骤 `completed` 且 active index 为空;仅重算合法 `planSnapshotFingerprint / finalizationId` 的未完成快照也失败关闭。开发 CLI 的 Runtime JSON 只输出状态和安全身份,递归移除 `sessionPath / eventPath / taskPath`,不把项目绝对存储位置写入命令 transcript;Tauri/App 内部结果结构保持不变。
- 验收现状:确定性回归已通过,真实 `gpt-5.5 llm-runtime` 连续三轮均在首个 Provider planning POST 返回前因同一 TLS record-layer failure 失败,未产生 plan/tool/kill/steer 证据;第三轮绝对路径、密钥和诱饵泄漏为 0。V1.17 继续保持未 PASS,Provider 恢复后必须完整重跑。
## 2026-07-15 Project Supervisor 纯聊天短入口
- 决策:无 GUI 开发聊天省略 `parentAgentId` 时固定进入 `project-supervisor`;新增 `npm run agc:chat -- --config-dir <AppData> [--init] <project>` 作为总控入口。原 `agc:swarm` 和显式 `<parentAgentId>` 继续保留给专业父 Agent 调试,不改变既有调用兼容性。
- 边界:短入口只复用现有 Swarm CLI、External Runner、Supervisor active Session、conversation、黑板、记忆和 durable 委派协议,不新增 Agent、HTTP 服务、数据库或旁路 Provider 调用。
- 验收:CLI 单测覆盖省略 ID 默认总控和显式 ID 兼容;真实入口 smoke 用一次性项目启动 `agc:chat`,终端显示 `project-supervisor`、创建空总控 Session,并在未发起 LLM 请求时通过 `/quit` 正常退出和清理。
## 2026-07-13 普通微信支付 V3 退款使用统一观察事务闭环
- 背景:普通微信支付 V3 的退款申请响应、退款结果回调、主动查单和商户平台手工退款发现可能重复、乱序或只出现其中一种;原充值订单只有单一终态,无法表达多次部分退款、权益回收欠款和会员人工处理。
@@ -656,7 +656,7 @@ V1.14 对标 `codex fork`,允许开发者从任意已有静态 Agent 会话创
## V1.15 Agent Swarm 纯聊天验证入口
V1.15 新增不依赖 Tauri WebView 或正常客户端 GUI 的终端聊天入口,用于开发阶段直接验证多 Agent 协作。入口固定为 `--swarm-chat [--init] <本地项目绝对路径> <parentAgentId>`,推荐通过 `npm run agc:swarm -- --config-dir <项目外 AppData 绝对路径> [--init] <project> <parentAgentId>` 启动。它不是新的 Agent 实现:每条普通输入都投递给现有父 Agent background Runtime,继续由同一发布二进制的 External Runner 执行;不得退化到一次性 `--agent-chat`,也不得新建本地 HTTP 服务、旁路 Provider 客户端或第二套持久化。
V1.15 新增不依赖 Tauri WebView 或正常客户端 GUI 的终端聊天入口,用于开发阶段直接验证多 Agent 协作。入口固定为 `--swarm-chat [--init] <本地项目绝对路径> [parentAgentId]`;省略 `parentAgentId` 时固定使用 `project-supervisor`,推荐通过 `npm run agc:chat -- --config-dir <项目外 AppData 绝对路径> [--init] <project>` 启动总控聊天。需要直接调试其他父 Agent 时仍可使用 `npm run agc:swarm -- --config-dir <项目外 AppData 绝对路径> [--init] <project> <parentAgentId>`。它不是新的 Agent 实现:每条普通输入都投递给现有父 Agent background Runtime,继续由同一发布二进制的 External Runner 执行;不得退化到一次性 `--agent-chat`,也不得新建本地 HTTP 服务、旁路 Provider 客户端或第二套持久化。
- 首版复用父 Agent 当前 active SessionRuntime 继续把 user / assistant 写入 `.agent/conversations/agents/<agentId>/sessions/<sessionId>.jsonl`,静态委派、动态 `child-*`、私有记忆、项目黑板、durable action、verification gate 和 all-join 均沿用现有身份与恢复语义。`--init` 只复用现有项目初始化函数;Runtime 写命令仍强制显式传项目外 `--config-dir`。入口启动和一轮准备收束前都执行现有 resume / reconciliation 扫描,不能只凭 idle 快照跳过尚未发布的 receipt 或 join 修复。
- 终端只提供聊天所需的轻量控制命令:`/help``/agents``/status``/history``/quit`。空闲时普通文本创建父 Agent 新 run;父 Agent run 仍处于 pending / running 时普通文本追加为同一 run steer,只有 child 忙而父 Agent 已终态时拒绝吞掉输入并要求稍后重发。确认动作在终端显示 Agent、run、action、tool 和安全摘要,并接受 `approve / reject`,分别调用现有 confirm / reject Runtime 路径,不能要求回到开发窗口。stdin 由独立读取线程投递,因此活跃 run 中 `/quit`、EOF、状态命令和 steer 仍可响应;退出只结束观察客户端。
@@ -46,7 +46,7 @@ V1.11 的受保护仓库控制目录同时包含 `.git / .agent / .agents / .cod
2026-07-14 起,同一文档的“V1.14 Agent 会话分叉”补齐 `codex fork` 风格的开发会话分支。开发 Agent 窗口可从 active、archived 或 legacy Session 复制截至当前的持久 conversation,创建带来源记录的新 active Session;源会话不变,后续消息与 run 按新 Session 隔离。分叉不复制 Runtime / pending action / process session,不推进项目 revision,并在当前 Agent 或委派 child 未终态时拒绝执行;Session 变更与 Runtime 入队共用 per-Agent lane gate,损坏任务日志失败关闭,catalog 提交前的分叉文件不会被列表暴露。
2026-07-14 起,同一文档的“V1.15 Agent Swarm 纯聊天验证入口”补充无 GUI 开发验收面。`npm run agc:swarm -- --config-dir <项目外AppData> [--init] <project> <parentAgentId>` 直接把每轮输入投递给真实父 Agent background Runtime复用 External Runner、active Session、conversation、静态委派、动态隔离 child、私有记忆、项目黑板、确认策略和 all-join,不调用一次性 `--agent-chat`,不新建本地 HTTP 服务或平行数据库。终端持续显示全 Agent 状态、事件和父子 / 委派关系,提供 `/agents``/status``/history``/help``/quit` 以及 approve / reject;父 run 活跃时普通输入走 same-run steerstdin channel 保证运行中仍可退出。入口启动和收束前执行恢复扫描,只有全 Runtime 非活跃、队列为空、恢复扫描无新增工作并通过稳定观察窗口后才输出绑定父 Session 的最后回复。首版没有 Runner Provider token delta,只承诺状态 / 事件实时输出和最终回复。真实 Provider 已证明入口、两个静态 Agent 并行、确认 / 拒绝、重启恢复和活跃退出,但父 Agent 的全量状态轮询与 receipt 原目标恢复仍导致汇总失败;当前不得宣称完整 swarm 已通过,动态 isolated child / all-join 也待复验
2026-07-14 起,同一文档的“V1.15 Agent Swarm 纯聊天验证入口”补充无 GUI 开发验收面。`npm run agc:chat -- --config-dir <项目外AppData> [--init] <project>` 默认把每轮输入投递给真实 `project-supervisor` background Runtime`agc:swarm` 仍可显式追加 `<parentAgentId>` 调试其他父 Agent。两者都复用 External Runner、active Session、conversation、静态委派、动态隔离 child、私有记忆、项目黑板、确认策略和 all-join,不调用一次性 `--agent-chat`,不新建本地 HTTP 服务或平行数据库。终端持续显示全 Agent 状态、事件和父子 / 委派关系,提供 `/agents``/status``/history``/help``/quit` 以及 approve / reject;父 run 活跃时普通输入走 same-run steerstdin channel 保证运行中仍可退出。入口启动和收束前执行恢复扫描,只有全 Runtime 非活跃、队列为空、恢复扫描无新增工作并通过稳定观察窗口后才输出绑定父 Session 的最后回复。首版没有 Runner Provider token delta,只承诺状态 / 事件实时输出和最终回复。V1.15 的历史父 Agent 汇总失败结论保留;V1.16 已通过 `project-supervisor` 双专业 Agent 并行、唯一最终回复和同 Session 第二轮真实 Provider 验收
2026-07-14 起,Runtime V1.1 文档的“V1.16 Project Supervisor 总控 Agent”作为正式用户主聊天的新事实源。规范 ID 为 `project-supervisor`,使用独立 active Agent Session 和现有 External Runner;空闲输入创建新 run,匹配 Session 的活跃输入继续走 same-run steer。它可以澄清、使用白名单工具、维护黑板、在同一父 run 内最多并行等待 3 个静态专业 Agent 并汇总结果。旧 `agentLlm.chat` 只作 `agentLlm.project-supervisor` 的配置兼容回退。静态 `agent.delegate` 必须通过 durable delivery 和同一父 run 的等待 / 唤醒 / 认领屏障收束,不能再靠新 `delegate-receipt-*` run 产生第二次用户回复;普通用户面只展示紧凑状态、安全确认和唯一最终回复。
+1
View File
@@ -139,6 +139,7 @@
"ai-game-creator-shell:build": "npm --prefix apps/ai-game-creator-shell run build --",
"ai-game-creator-shell:llm-status": "npm --prefix apps/ai-game-creator-shell run llm-status --",
"ai-game-creator-shell:agent-task": "npm --prefix apps/ai-game-creator-shell run agent-task --",
"agc:chat": "npm --prefix apps/ai-game-creator-shell run chat --",
"agc:swarm": "npm --prefix apps/ai-game-creator-shell run swarm --",
"ai-game-creator-shell:agent-run": "npm --prefix apps/ai-game-creator-shell run agent-run --",
"ai-game-creator-shell:agent-run:smoke": "npm --prefix apps/ai-game-creator-shell run agent-run:smoke",