skills/vibe-debug-serve/SKILL.md
Use when checking orchestra service health, viewing serve running status, debugging vibe3 serve (orchestra server), checking whether a new serve debugging round is ready, inspecting agent execution logs in temp/logs/, diagnosing governance or manager chain failures, or identifying bugs in the heartbeat/dispatch pipeline. Triggered by "serve status", "orchestra service running", "FailedGate", "heartbeat", "serve health". Do not use for flow/task metadata repair (use vibe-check) or issue pool governance (use vibe-orchestra).
npx skillsauth add jacobcy/vibe-coding-control-center vibe-debug-serveInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
调试 vibe3 serve 的标准化流程,涵盖日志读取、链路验证、问题识别与修复。
调试原则:先看日志,再做判断;先 dry-run,再最小执行;每步执行后停下来确认结果。
开调前先分流目标:先判断这轮要调的是全局 serve/heartbeat/dispatch,还是当前分支承载的单 issue / flow 链路。两者前置条件不同,不要混成一次“总调试”。
分支隔离原则:调试 serve 链路时,默认使用临时 debug/* 分支承载新的调试动作;不要在已经承载自动化 PR 的 task/issue-* 分支上继续引入新的调试目标。
调试规范、日志分层与反模式定义以
docs/standards/agent-debugging-standard.md为权威来源。
vibe3 serve 相关的日志读取、链路调试、bug 识别、修复验证。vibe-check)、issue pool 治理建议(用 vibe-orchestra)、roadmap 规划(用 vibe-roadmap)。vibe3 命令完成,不直接改 .git/vibe3/ 底层文件。debug/* 只是临时调试分支,不是 canonical flow 分支,不替代 dev/issue-* 或 task/issue-* 的正式语义。serve 派发链路按这个顺序排查:
可见性规则:
task status 可见。serve status / FailedGate 可见。temp/logs/orchestra/events.log 是 tick、queue、dispatch 的时间线证据。先判断故障是单点历史残留还是全局机制问题:
当 serve status 显示 FailedGate ACTIVE 或 dispatch FROZEN 时,按以下顺序诊断:
# 系统错误在 serve status 中直接展示
uv run python src/vibe3/cli.py serve status
# 从 serve status 输出中获取主日志路径(Log: 行)
# 输出示例:
# Server: running
# Log: /Users/.../vibe-coding-control-center/temp/logs/orchestra/events.log
# 使用该路径读取日志(适用于任何工作目录)
# 查询详细错误日志(数据库在主仓库共享目录)
sqlite3 <main_repo>/.git/vibe3/handoff.db \
"SELECT id, tick_id, issue_number, severity, error_code, error_message, created_at
FROM error_log ORDER BY id DESC LIMIT 10"
数据库路径:handoff.db 位于主仓库共用 .git/vibe3/ 目录(不是当前 worktree 的 .git),
可通过 cat .git 找到 gitdir: 指针定位主仓库路径。
# flow 被 blocked 的原因在 task status 中展示
uv run python src/vibe3/cli.py task status
# 查询所有 BLOCKED 的 flow
sqlite3 <main_repo>/.git/vibe3/handoff.db \
"SELECT branch, flow_status, blocked_reason FROM flow_state WHERE flow_status = 'blocked'"
BLOCKED 但 GitHub 已 CLOSED 的 issue 是常见的问题源。qualify gate 可能尝试 dispatch 已关闭的 issue,导致错误。
# 对每个 BLOCKED 的 flow,检查 GitHub issue 状态
for issue in <issue_numbers>; do
gh issue view $issue --json state,title -R <owner>/<repo>
done
若发现 github_state=CLOSED 但本地 flow_status=blocked 的 issue,
需要在 qualify gate 中 terminalize 或手动 vibe3 check --clean-branch。
Repo 根目录解析由 vibe3.clients.git_client.find_repo_root() 统一提供。
解析链:git-common-dir → .git 文件指针 → 向上遍历 → 抛出 SystemError。
在 worktree 中运行时,该函数正确返回主仓库路径而非 worktree 路径。
异常场景:
git rev-parse --git-common-dir 失败 → 尝试解析 .git 文件中的 gitdir: 指针.git 文件中的 gitdir: 为相对路径 → 相对于 cwd 解析验证方法:
uv run python -c "
from vibe3.clients.git_client import find_repo_root
print('Resolved repo root:', find_repo_root())
"
# 应返回主仓库路径,例如 /Users/.../vibe-coding-control-center
# 不应返回 worktree 路径
诊断错误关键字:"Failed to resolve permanent worktree for planner" 或 "plan_ref not found" → 意味着 repo 根目录解析失败或 worktree 使用了错误路径。
# 使用 mem-search 查找之前是否解决过类似问题
# 搜索关键字:worktree resolve, FailedGate, planner dispatch, BLOCKED+CLOSED
# 对问题 issue 关联的 branch,查看 plan_ref 和 handoff 记录
uv run python src/vibe3/cli.py handoff show @plan --branch <branch>
当当前工作树已经是 task/issue-* 自动化分支,且该分支上已有活跃 PR 时:
serve / heartbeat / dispatch 调试,请先合并当前 PR,再从干净基线新开 debug/* 分支。推荐流程:
# 先合并当前 PR
# 回到最新主线(或约定基线)后创建临时调试分支
git checkout main
git pull
git checkout -b debug/serve-<topic>
使用约束:
debug/* 只用于隔离调试,不默认注册为 flow。dev/issue-<id> 或 task/issue-<id> 分支处理。debug/* 分支长期保留成正式交付分支。在进入日志调试前,先运行:
uv run python src/vibe3/cli.py task status
uv run python src/vibe3/cli.py flow show
uv run python src/vibe3/cli.py check
uv run python src/vibe3/cli.py serve status
然后按目标分流:
serve status 必须能说明 server 当前是 running、stopped,还是启动失败。flow show 提示当前分支尚未注册为 flow,则这轮条件不完整,应先补 vibe3 flow update 或转交 vibe-check / vibe-new。关于分支选择:
task/issue-* 自动化分支,这通常不满足新调试目标的分支隔离条件。serve 调试主题,建议在当前 PR 合并后改到新的 debug/* 分支继续。判断规则:
check 不干净:先走 vibe-check 做 runtime 审计与修复,不要先怪 serve。serve status 显示 stopped:说明当前不满足 live heartbeat 调试条件;除非你要调的是“为什么启动不起来”,否则先补启动现场。task/issue-*:说明当前不满足新调试主题的隔离分支条件;优先等当前 PR 合并后切到新的 debug/* 分支。重要:实际读取日志时应使用 vibe3 serve status 输出的绝对路径,而非硬编码的相对路径。以下结构仅供参考。
temp/logs/
orchestra/
events.log # 主事件日志(serve 生命周期、tick、dispatch)
governance/
governance.log # Governance service 详细事件
dry-run/governance_dry_run_*.md # dry-run prompt 组装结果
temp/logs/issues/issue-{n}/
manager.async.log # Manager 执行日志
plan.async.log # Plan 执行日志
run.async.log # Run 执行日志
review.async.log # Review 执行日志
supervisor.async.log # Supervisor apply 执行日志
temp/logs/governance/
vibe3-governance-scan-{ts}-t{n}.async.log # Governance 执行日志
temp/ 在 .gitignore 中排除,日志不进入 git。
先读取:
uv run python src/vibe3/cli.py task status
uv run python src/vibe3/cli.py flow show
uv run python src/vibe3/cli.py check
uv run python src/vibe3/cli.py serve status
这一层回答四个问题:
若结论是“不是 serve 调试问题而是 runtime / binding 问题”,立即转交 vibe-check,不要继续在本 skill 内盲读日志。
uv run python src/vibe3/cli.py serve status
curl http://127.0.0.1:8080/health
curl http://127.0.0.1:8080/status
serve status 输出 running 才进入后续步骤serve status 是 stopped,但当前目标是“启动路径调试”,则继续读取启动日志或最小启动证据;如果目标不是启动问题,先恢复 live serve 现场再继续获取日志路径(推荐方式):
# 从 serve status 获取主日志路径(适用于任何工作目录)
uv run python src/vibe3/cli.py serve status
# 输出中包含 "Log: <absolute_path>" 行
# 使用输出的路径读取日志
tail -f <log_path_from_status>
读取日志:
# 实时跟踪(serve 正在运行时)
tail -f <log_path_from_status>
# 事后复盘
cat <log_path_from_status>
事件日志记录:server 启停、tick 开始/完成、dispatch 触发/跳过/失败、runtime 错误。
识别关键信号:
[governance] tick #N dispatched — governance 已触发,正常[governance] tick #N skip — governance 本轮跳过,检查 interval_ticks 配置[server] heartbeat tick #N completed — 心跳正常ERROR / exception 的行 — 立即定位# 查看最近的 manager 日志
ls -lt temp/logs/vibe3-manager-*.async.log | head -5
# 实时跟踪正在运行的 agent
tail -f temp/logs/issues/issue-{n}/manager.async.log
# 查看特定 issue 的所有执行日志
ls temp/logs/*issue-{n}*.async.log
# 查看 tmux session(如仍存活)
tmux ls | grep vibe3
tmux capture-pane -t vibe3-manager-issue-{n} -p
agent 日志包含完整的 stdout/stderr,内置 awk 过滤器已抑制 Codex runtime noise。执行结束后 session 保持 60s keep-alive。
根据日志判断问题归属:
A. Prompt 材料问题(governance / supervisor 链路)
现象:agent 的行为不符合治理预期,决策逻辑错误。
# 检查 dry-run prompt 组装输出
uv run python src/vibe3/cli.py serve start --dry-run
cat temp/logs/orchestra/governance/dry-run/governance_dry_run_*.md
检查点:
@vibe/supervisor/governance/assignee-pool.md(governance 链,使用 vibe3 handoff show @vibe/supervisor/governance/assignee-pool.md 命令读取)或 @vibe/supervisor/manager.md(manager 链,使用 vibe3 handoff show @vibe/supervisor/manager.md 命令读取)B. 配置问题(角色模型 / 间隔 / 并发)
现象:某个角色行为明显偏差(过度执行或过于保守)。
cat config/v3/settings.yaml
检查点:
orchestra.assignee_dispatch 中 manager 的 agent preset 是否独立配置(不得隐式继承 run.agent_config)interval_ticks 是否合理max_concurrent 是否限制了并发C. 状态迁移问题(state labels / flow 不一致)
vibe3 task status
vibe3 flow show
gh issue view {n} --json labels,state
状态迁移语义以 docs/standards/vibe3-state-sync-standard.md 为准。
如果这里发现的根因其实是:
则应停止 vibe-debug-serve,转交 vibe-check 处理。
D. Agent 执行崩溃(tmux / session 异常退出)
# 查看日志尾部
tail -50 temp/logs/issues/issue-{n}/manager.async.log
# 检查 tmux session 是否异常退出
tmux ls 2>&1
问题定位后按链路选择最小入口验证:
Governance 治理链:
手动触发 governance suggest:在 issue 中发布带有 [governance suggest] 标记的评论来创建治理 issue。
Manager / 开发执行链:
Manager 由 StateLabelDispatchService 自动调度(state/ready 或 state/handoff labels),不需要手动命令触发。验证方法:
# 观察 manager 是否被自动 dispatch
tail -f temp/logs/orchestra/events.log
# 查看 manager 执行日志
tail -f temp/logs/issues/issue-{n}/manager.async.log
禁止同时打开 heartbeat + dry-run + 自动 apply + 自动回收,每步执行后必须停下来确认结果。
修复后按以下顺序确认:
temp/logs/orchestra/events.log — 确认无新的 ERRORtemp/logs/vibe3-{role}-issue-{n}.async.log — 确认执行日志正常uv run python src/vibe3/cli.py flow show — 确认 flow 状态正确成功标准(governance 链):
最终报告包含:
详细列表见 docs/standards/agent-debugging-standard.md §八。核心禁止项:
docs/standards/agent-debugging-standard.md — 调试规范权威来源(日志分层、调试循环、反模式)docs/standards/v3/orchestra-runtime-standard.md — Orchestra 运行时架构docs/standards/v3/command-standard.md — state labels 与状态迁移语义docs/standards/v3/command-standard.md — Shell 命令边界与共享状态规范| 文件 | 作用 |
|------|------|
| src/vibe3/execution/coordinator.py:_resolve_repo_path | worktree 解析入口,Path.cwd() fallback 是错误根源 |
| src/vibe3/domain/qualify_gate.py:qualify_blocked_issue | BLOCKED issue dispatch 前的 qualify gate |
| src/vibe3/environment/worktree.py:resolve_manager_cwd | worktree 查找/创建的核心方法 |
| src/vibe3/environment/worktree_lifecycle.py:find_or_create_worktree_for_branch | 4 步优先级查询 worktree |
| src/vibe3/domain/handlers/dispatch.py | Planner/Executor/Reviewer dispatch handler |
| src/vibe3/domain/handlers/issue_state_dispatch.py | Manager dispatch handler |
| src/vibe3/services/check_pr_service.py:_reset_issue_after_pr_closed | PR 关闭后 issue 重置逻辑 |
development
Use after `vibe init` to verify project configuration completeness. Interactively prompts user to fill missing items. Orchestrates existing commands without adding Python code. Do not use for system-level installation issues (use vibe-onboard instead).
development
Use when the user wants a comprehensive review using the multi-agent team workflow. Applies to PRs, code changes, architecture decisions, and any task requiring team-based analysis.
development
Use when manager has signaled flow terminal state cleanup via handoff indicate. Reads cleanup instructions and executes FlowCleanupService. Do not use for code changes or PR creation.
testing
Use for handling blocked and RFC issues, making decisions that may form ADRs (Architecture Decision Records). Processes problem issues requiring human judgment, dependency resolution, and architectural decisions. Do not use for routine issue monitoring (use vibe-orchestra) or roadmap planning (use vibe-roadmap).