@cocorograph/hub-agent 0.7.2 → 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 +14 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocorograph/hub-agent",
3
- "version": "0.7.2",
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
@@ -2144,13 +2144,25 @@ async function dispatch(msg, ctx) {
2144
2144
  noCache: true,
2145
2145
  logger,
2146
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)で従来どおり高速消灯する。
2147
2156
  ctx.client.send({
2148
2157
  type: "session.state",
2149
2158
  session_name: sessionName,
2150
- status: snap.status,
2159
+ status: generating ? "processing" : snap.status,
2151
2160
  context_pct: snap.context_pct,
2152
2161
  permission_mode: snap.permission_mode,
2153
- stable: snap.status !== "processing" && snap.stable === true,
2162
+ stable:
2163
+ !generating &&
2164
+ snap.status !== "processing" &&
2165
+ snap.stable === true,
2154
2166
  })
2155
2167
  } catch (err) {
2156
2168
  logger?.warn(