@cocorograph/hub-agent 0.8.89 → 0.8.90

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocorograph/hub-agent",
3
- "version": "0.8.89",
3
+ "version": "0.8.90",
4
4
  "description": "Hub Hosted Cockpit のローカル常駐 agent。Hub と outbound WSS で接続し、ローカルの Claude / Codex チャットと tmux セッションを中継する。",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -43,7 +43,7 @@ const SLOW_DISPATCH_MS = 1000
43
43
  * 調査対象そのものなので、速かった場合も含めて毎回記録する
44
44
  * (速いことの記録が無いと「詰まっていない」を示せない)。
45
45
  */
46
- const ALWAYS_TIMED_TYPES = new Set(["tmux.kill_session"])
46
+ const ALWAYS_TIMED_TYPES = new Set(["chat.session.stop"])
47
47
 
48
48
  export function isConnectionLifecycleMessage(type) {
49
49
  return LIFECYCLE_TYPES.has(type)
@@ -184,7 +184,7 @@ export class DispatchScheduler {
184
184
  const mutationMode = globalMutationMode(type)
185
185
  if (mutationMode) return `${mutationMode}:global`
186
186
 
187
- // usage build は最大 25 秒かかり、同じ control lane の tmux.list_sessions が
187
+ // usage build は最大 25 秒かかり、同じ control lane の一覧要求 (当時は tmux.list_sessions) が
188
188
  // frontend の 10 秒打ち切りで捨てられていたため分離する (2026-09-04 本番計測)。
189
189
  if (type === "usage.request") return "usage"
190
190
 
@@ -203,8 +203,7 @@ export class DispatchScheduler {
203
203
  }
204
204
  return "control"
205
205
  }
206
- // chat.stop_all は全レーンに跨るため control に置く。その時点で live な会話だけを
207
- // 止める契約であり、接続処理中のまだ live でない会話は対象外。sessions.request も control。
206
+ // chat.sessions.request は control。
208
207
  const mode = chatMode(type)
209
208
  if (!mode) return "control"
210
209
 
package/src/main.mjs CHANGED
@@ -4398,43 +4398,6 @@ export async function dispatch(msg, ctx) {
4398
4398
  ctx.client.send(result)
4399
4399
  return
4400
4400
  }
4401
- case "chat.stop_all": {
4402
- // exit に載る停止理由。bridge 側の既定 ("tui-bind-stop" / "explicit-stop") は
4403
- // それぞれ TUI 切替・個別停止の名前なので、全停止はここで明示して区別する。
4404
- const STOP_ALL_REASON = "chat-stop-all"
4405
- const result = { type: "chat.stop_all.result", request_id: msg.request_id, stopped: 0, failed: [] }
4406
- try {
4407
- const live = describeLiveSessionsUnion({ claudeBridge: ctx.claudeBridge, codexBridge: ctx.codexBridge })
4408
- const claudeCwds = new Set()
4409
- const codexStreams = new Set()
4410
- for (const session of live) {
4411
- let target
4412
- try {
4413
- if (session.kind === "claude") {
4414
- const cwd = session.cwd
4415
- if (claudeCwds.has(cwd)) continue
4416
- claudeCwds.add(cwd)
4417
- // ⚠️ reason を省くと stopSessionsFor の既定 "tui-bind-stop" が exit に載り、
4418
- // 画面から止めた会話が「tmux へ切り替えたせい」で消えたように見える。
4419
- target = { cwd, reason: STOP_ALL_REASON }
4420
- result.stopped += await ctx.claudeBridge.stopSessionsFor(target)
4421
- } else if (session.kind === "codex") {
4422
- const stream_id = session.stream_id
4423
- if (codexStreams.has(stream_id)) continue
4424
- codexStreams.add(stream_id)
4425
- target = { stream_id, reason: STOP_ALL_REASON }
4426
- result.stopped += await ctx.codexBridge.stopSessionForStream(target)
4427
- }
4428
- } catch (err) {
4429
- result.failed.push({ ...target, reason: err?.message || String(err) })
4430
- }
4431
- }
4432
- } catch (err) {
4433
- result.error = err?.message || String(err)
4434
- }
4435
- ctx.client.send(result)
4436
- return
4437
- }
4438
4401
  case "chat.sessions.request": {
4439
4402
  try {
4440
4403
  const snapshot = await buildChatSessionsSnapshot({