@cocorograph/hub-agent 0.7.1 → 0.7.3

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/main.mjs +19 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocorograph/hub-agent",
3
- "version": "0.7.1",
3
+ "version": "0.7.3",
4
4
  "description": "Hub Hosted Cockpit のローカル常駐 agent。Hub と outbound WSS で接続し、ローカルの tmux/pty を中継する。",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
package/src/main.mjs CHANGED
@@ -1179,6 +1179,7 @@ function startStateLoop({ client, plugins, logger, intervalMs, claudeBridge, rea
1179
1179
  prev.permission_mode !== permissionMode ||
1180
1180
  prev.stable !== stable ||
1181
1181
  prev.proc_busy !== procBusy ||
1182
+ prev.child_busy !== childBusy ||
1182
1183
  prev.stalled !== stalled
1183
1184
  ) {
1184
1185
  lastByName.set(s.session_name, {
@@ -1187,6 +1188,7 @@ function startStateLoop({ client, plugins, logger, intervalMs, claudeBridge, rea
1187
1188
  permission_mode: permissionMode,
1188
1189
  stable,
1189
1190
  proc_busy: procBusy,
1191
+ child_busy: childBusy,
1190
1192
  stalled,
1191
1193
  })
1192
1194
  // 計装 (2026-06-19, 既定 OFF=2026-06-20): 状態変化時に値を記録する。常時 info はログ肥大の
@@ -1216,6 +1218,9 @@ function startStateLoop({ client, plugins, logger, intervalMs, claudeBridge, rea
1216
1218
  permission_mode: permissionMode,
1217
1219
  stable,
1218
1220
  proc_busy: procBusy,
1221
+ // child_busy: outputActive を含まない真の子プロセス busy。frontend の shouldQueue が
1222
+ // 出力残り火 (proc_busy 残存) でアイドルなのにキューへ逃がす誤キュー (症状A) を断つために使う。
1223
+ child_busy: childBusy,
1219
1224
  stalled,
1220
1225
  })
1221
1226
  }
@@ -2139,13 +2144,25 @@ async function dispatch(msg, ctx) {
2139
2144
  noCache: true,
2140
2145
  logger,
2141
2146
  })
2147
+ // 症状C対策: 生成中(armed / pane=processing で判定済みの generating)に TUIビューを
2148
+ // 再マウントすると、frontend は全 ref/state がリセットされ、capture 再描画ギャップで
2149
+ // この noCache スナップショットの status が一瞬 'waiting' に化けると「生成中なのに
2150
+ // 三点リーダーが消える」偽陰性になり、shouldQueue=false でメッセージが PTY(TUI
2151
+ // ネイティブキュー)へ流入する。generating を真として status='processing' を配ることで
2152
+ // capture 誤読を masking し、frontend の再点灯(turnActive)と shouldQueue 第1ゲートを
2153
+ // 即座に効かせる。proc_busy は配らない: outputActive(出力残り火)を含むため、ターン
2154
+ // 終了直後の真 idle セッションでも proc_busy=true となり高速消灯(症状B)を再発させる。
2155
+ // 終了後(非 generating)は snap.status(waiting)で従来どおり高速消灯する。
2142
2156
  ctx.client.send({
2143
2157
  type: "session.state",
2144
2158
  session_name: sessionName,
2145
- status: snap.status,
2159
+ status: generating ? "processing" : snap.status,
2146
2160
  context_pct: snap.context_pct,
2147
2161
  permission_mode: snap.permission_mode,
2148
- stable: snap.status !== "processing" && snap.stable === true,
2162
+ stable:
2163
+ !generating &&
2164
+ snap.status !== "processing" &&
2165
+ snap.stable === true,
2149
2166
  })
2150
2167
  } catch (err) {
2151
2168
  logger?.warn(