feat(terminal): terminal_wait_for 增 skipped 结果与 agent-pty.skip-wait 路由

This commit is contained in:
HuanLinOTO
2026-09-09 13:26:36 +08:00
parent fb2afabc72
commit 993f7aaacd
3 changed files with 50 additions and 3 deletions
+9
View File
@@ -543,6 +543,15 @@ function buildApi(
agentPtyRegistry?.close(uuid)
return { ok: true }
},
// The sidebar wait banner's skip button: abort every active
// terminal_wait_for on one agent terminal. Idempotent — 0 when nothing
// is waiting (a stale banner racing a wait that already resolved).
// Degraded mode (node-pty unavailable) has no registry and no waits: an
// honest ok.
'agent-pty.skip-wait': (payload) => {
const uuid = requireString(payload, 'uuid')
return { ok: true, skipped: agentPtyRegistry?.skipWait(uuid) ?? 0 }
},
// Terminal dependency status (issue #140): after a WS close 1011 with
// reason `pty-deps-missing` the client fetches the full repair details
// here — the close reason itself is capped at 123 bytes, too small for