Skip to content

refactor(agent-engine): add timeout to runInstructionSilent - #4

Merged
HelloWorldU merged 1 commit into
mainfrom
fix/timeout-and-cleanup
May 14, 2026
Merged

refactor(agent-engine): add timeout to runInstructionSilent#4
HelloWorldU merged 1 commit into
mainfrom
fix/timeout-and-cleanup

Conversation

@HelloWorldU

Copy link
Copy Markdown
Owner
  • runInstructionSilent: add 120s timeout with Promise.race + proc.kill()
  • fixBasedOnCiFailure: remove redundant githubToken param
  • git.ts: replace catch(err: any) with precise type assertion
  • kimi.ts: remove unused ChildProcess type import

…nused param

- runInstructionSilent: add 120s timeout with Promise.race + proc.kill()
- fixBasedOnCiFailure: remove redundant githubToken param (already in class)
- git.ts: replace catch(err: any) with precise type assertion
- kimi.ts: remove unused ChildProcess type import
@HelloWorldU
HelloWorldU merged commit d71277b into main May 14, 2026
1 check passed
HelloWorldU added a commit that referenced this pull request May 27, 2026
… fix prompt 污染

SKILL.md 加「Print 模式 ≠ Afk 模式」段:明确 afk 只在 --afk flag
显式传时生效,agent-engine 只传 --print 不传 --afk;用户在 UI 聊天
面板读输出,没 AskUserQuestion 不等于 afk 模式;本 skill GATE 优先级
高于系统指令的 afk 自动决策规则。

铁律段加「用户暂时不在 ≠ 批准」一句,堵掉「让流程往前推 / 自己决策更
高效」这类合理化跳过 GATE 的内部理由。

backlog 加两条:
- #4 kimi 在 print 模式下误用 afk 行为(已加 SKILL 缓解,待复测验证)
- #5 引擎自动注入 fix prompt 污染 UI 任务指令区(已修主场景,待真机
  观察是否有未覆盖路径)

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
HelloWorldU added a commit that referenced this pull request May 28, 2026
- 新增「engine→runtime」架构决策项作为首位优先级
- 新增 Bug #1 reviewer.comment 丢失(PR #25 暴露,源码确认)
- 新增 Bug #2 stop() 不级联取消异步链
- 新增 Bug #3 syncBranchWithMain 同步成功却报「同步提交失败」
- 保留 Bug #4 F5 刷新失踪
- 重新收回 Bug #5 CI log 截断方向错(PR #28 重现,被 8KB git config 噪音占满)
- 删除已实施的 syncBranchWithMain 完成项、低优 orphan 工作目录项、旧设计哲学段
HelloWorldU added a commit that referenced this pull request May 28, 2026
…iewer 修订

接管 PR #29 + 应用自审 reviewer 两处修订:

PR #29 原内容:
- agent.ts submitReview: 补 review.comment = comment || '',解决 fix loop 拿不到具体审阅意见的根因(Bug #1)
- agent.ts syncBranchWithMain: 删 merge 成功后多余的 gitCommit/abortMerge,squash merge 场景不再误报「同步提交失败」(Bug #3)
- agent.ts: sendInstruction 后增加 stopped 状态检查,最小可行的 stop 级联兜底(Bug #2 增量修,根治仍归并到架构决策项)
- github-api.ts getCheckRunLogs: 截断方向从 slice(0, 8000) 改为 slice(-8000)(Bug #5)
- 配套文档同步 + AgentDetail/Store 透传 review.comment 字段

reviewer 修订(本次额外):
- github-api.ts: '...[truncated]' 标记从尾部挪到头部,避免误导用户以为尾部还有截断
- backlog.md: footer 同步更新(4 个活跃 bug → 1 个 #4 F5 失踪)+ 应用本地删除架构项「风险」段
HelloWorldU added a commit that referenced this pull request May 29, 2026
Bug #4 修复(5 个文件,~18 行):
- engine.ts: 新增 list-agents command,全量 emit agent-created + engine-restored
- types.ts / schemas.ts: 注册 list-agents 到 EngineCommand 类型和 Zod schema
- useSwarmStore.ts: engine 已运行时发 list-agents 拉回 state.agents,而非直接 return
- ARCHITECTURE.md: 补 F5 刷新场景说明

架构决策项重写:
engine = 多 Agent 协作 control plane(lifecycle/routing/token/持久化)
PR workflow 细节(git add/commit/push/CI 修复/review 处理)属于 agent+SKILL
硬门控(reviewer failed 上限/merge 资格)仍由 engine 保证
LLM 只在关键决策点介入(RPI 框架),工具执行层是确定性代码
HelloWorldU added a commit that referenced this pull request May 29, 2026
backlog:
- Bug #4 F5 刷新已修复,移出活跃项
- 架构决策项精简表述,关联新 exec-plan
- 活跃 bug 清零

engine-to-control-plane.md(新建):
- 目标架构图:engine = control plane,agent 用 Kimi CLI 工具能力跑 git/gh
- 当前 workflow 触点全量清单(agent.ts / engine.ts)+ 迁移方向
- 保留的硬门控清单(不可 LLM 绕过)
- 需新增的 SKILL(PR Workflow / RPI 框架)
- 5 个渐进迁移阶段(阶段 0 已完成)
- 迁移后 IPC 命令集预期
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.

1 participant