桌面「智能体」面板:宿主死亡(runtime 自动更新)的 agent 永久显示「运行中」,无终态清理
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 22
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Bug report(draft):ZCode 桌面「智能体」面板對死亡 agent 無終態清理
2026-09-14。發現於 zcode-vscode extension 開發弧(VS Code ext 經 app-server
spawn 的 subagent)。證據齊全,供回報 zcode 上游。
症狀
桌面 app「智能体」面板將三個 已死亡 15+ 小時的 agent 顯示為「运行中」,
計時器持續累計(912 分 56 秒),且跨桌面 app 重啟存續。
重現時間線
- 09-13 19:20-19:22:三個 subagent(Agent W/R/P2)由 CLI harness spawn
- 09-13 19:22:carrier(zcode app-server runtime)自動更新 3.12.1,
runtime active cache 被替換——三個 agent 的宿主進程當場死亡
(無優雅終止、無終態寫入) - 09-14 07:1x:user 重啟桌面 app 與機器
- 09-14 10:34:智能体面板仍顯示三個「运行中 · 已运行 912 分 56 秒」
機械證據
- 進程:
ps三個 agent 對應進程零存在(死亡 15 小時) - agent session DB(CLI db.sqlite):三個 session 最後活動凍結於
09-13 19:21-19:22,之後零寫入 - 呼叫端 harness 的 task registry:三個 agent id 均「No task found」
——無活任務可停 - 桌面 tasks-index.sqlite:僅 W 一列存在且
task_status為空
(死亡時未寫終態;R/P2 兩列完全不存在)——「运行中」判定的
資料源不完整覆蓋 spawn 來源的 agent - 系統自身的死亡標記慣例存在(同期其他死亡 agent row 為
error狀態)
——證明終態機制在場,但宿主被外部殺死時不走它
影響
- 面板誠信:顯示的「運行中」不可信(含計時器)
- 操作面:呼叫端 stop 無目標(registry 查無);桌面 stop 對無
tasks-index row 的 agent 無效果 - 根因關聯:宿主死亡=carrier runtime 更新替換 active cache——升級
場景下所有在飛 spawn 都會產生這類殭屍
期望行為
- runtime 死亡/更換時,spawn 側或桌面端應將受影響 agent 標記終態
(error/interrupted)而非保留 running - 智能体面板對「進程不存在+session 長時間零活動」的 row 顯示
存活疑問標記或自動標記
暫時對策(已驗證)
- 對有 tasks-index row 的殭屍:將
task_status補寫為error
(照系統自身慣例)——面板刷新後消失 - 對無 row 的殭屍:桌面 stop 鈕或重啟後的行為待驗證(若仍存在,
狀態存於桌面私有存儲,外部無清理面)
環境
- carrier:/Applications/ZCode.app 3.12.1(runtime 內部版號 0.16.5)
- agent 來源:zcode CLI harness 的 Task tool(背景 spawn)——
agent session id:sess_subagent_agent_{4da7b681,17ecbf69,1ac014e0}-*
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the CLI harness Task tool, the carrier runtime replacement path, and the desktop agent panel data in tasks-index.sqlite and the CLI session db.sqlite. Reproduce a runtime update with background agents, then trace how missing processes and inactive sessions are represented. Done means every affected agent receives an error or interrupted terminal state and no longer appears as running after app or machine restart.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sqlite, vscode
- Domain
- databases, desktop, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100