triflux 10.13.3 → 10.13.5

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.
@@ -9,7 +9,7 @@
9
9
  {
10
10
  "name": "triflux",
11
11
  "description": "Tri-CLI orchestrator for Claude Code. Routes tasks across Claude + Codex + Gemini with consensus intelligence, natural language routing, 42 skills, and cross-model review.",
12
- "version": "10.13.3",
12
+ "version": "10.13.5",
13
13
  "author": {
14
14
  "name": "tellang"
15
15
  },
@@ -30,5 +30,5 @@
30
30
  ]
31
31
  }
32
32
  ],
33
- "version": "10.13.3"
33
+ "version": "10.13.5"
34
34
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triflux",
3
- "version": "10.13.3",
3
+ "version": "10.13.5",
4
4
  "description": "CLI-first multi-model orchestrator for Claude Code — route tasks to Codex, Gemini, and Claude",
5
5
  "author": {
6
6
  "name": "tellang"
package/hud/constants.mjs CHANGED
@@ -79,17 +79,15 @@ export const CLAUDE_USAGE_CACHE_PATH = join(
79
79
  "cache",
80
80
  "claude-usage-cache.json",
81
81
  );
82
- export const PLUGIN_USAGE_CACHE_PATH = join(
82
+ export const OMC_PLUGIN_USAGE_CACHE_PATH = join(
83
83
  homedir(),
84
84
  ".claude",
85
85
  "cache",
86
86
  "tfx-hub",
87
87
  "plugin-usage-cache.json",
88
88
  );
89
- export const OMC_PLUGIN_USAGE_CACHE_PATH = PLUGIN_USAGE_CACHE_PATH; // OMC alias
90
- export const CLAUDE_USAGE_STALE_MS_SOLO = 5 * 60 * 1000; // 플러그인 없을 때: 5 캐시
91
- export const CLAUDE_USAGE_STALE_MS_WITH_PLUGIN = 15 * 60 * 1000; // 플러그인 있을 때: 15분
92
- export const CLAUDE_USAGE_STALE_MS_WITH_OMC = CLAUDE_USAGE_STALE_MS_WITH_PLUGIN; // OMC alias
89
+ export const CLAUDE_USAGE_STALE_MS_SOLO = 5 * 60 * 1000; // OMC 없을 때: 5분 캐시
90
+ export const CLAUDE_USAGE_STALE_MS_WITH_OMC = 15 * 60 * 1000; // OMC 있을 때: 15
93
91
  export const CLAUDE_USAGE_429_BACKOFF_MS = 10 * 60 * 1000; // 429 에러 시 10분 backoff
94
92
  export const GEMINI_429_BASE_DELAY_MS = 2000;
95
93
  export const GEMINI_429_MAX_RETRIES = 3;
package/hud/utils.mjs CHANGED
@@ -212,11 +212,13 @@ export function getContextPercent(stdin) {
212
212
  }
213
213
 
214
214
  // 과거 리셋 시간 → 다음 주기로 순환하여 미래 시점 반환
215
+ // elapsed가 cycleMs의 정수배일 때 ceil은 target=now를 반환해 diff=0이 되므로
216
+ // floor+1로 항상 다음 사이클을 가리키도록 한다.
215
217
  export function advanceToNextCycle(epochMs, cycleMs) {
216
218
  const now = Date.now();
217
219
  if (epochMs >= now || !cycleMs) return epochMs;
218
220
  const elapsed = now - epochMs;
219
- return epochMs + Math.ceil(elapsed / cycleMs) * cycleMs;
221
+ return epochMs + (Math.floor(elapsed / cycleMs) + 1) * cycleMs;
220
222
  }
221
223
 
222
224
  function parseResetDate(isoOrUnix) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triflux",
3
- "version": "10.13.3",
3
+ "version": "10.13.5",
4
4
  "description": "CLI-first multi-model orchestrator for Claude Code — route tasks to Codex, Gemini, and Claude",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1354,6 +1354,11 @@ heartbeat_monitor() {
1354
1354
  local kill_grace="${TFX_STALL_KILL_GRACE:-30}"
1355
1355
  if [[ "$kill_on_stall" -eq 1 && "$stall_count" -ge $((stall_threshold + kill_grace)) ]]; then
1356
1356
  echo "[tfx-heartbeat] pid=$pid elapsed=${elapsed}s output=${current_size}B status=STALL_KILL stall=${stall_count}s — SIGTERM" >&2
1357
+ # Snapshot child PIDs before SIGTERM — wrapper 가 SIGTERM 을 수용해 죽으면
1358
+ # 부모 소멸 후 taskkill /T 가 자식 트리를 탐색하지 못해 codex 자식이 orphan 으로 남는다.
1359
+ # 사용자 보고(2026-04-22): "tfx-route 래퍼 exit 이후에도 Codex 자식이 살아있음".
1360
+ local _stall_children
1361
+ _stall_children=$(_find_fork_pids "$pid" 2>/dev/null || echo "")
1357
1362
  kill -TERM "$pid" 2>/dev/null || true
1358
1363
  local _grace_waited=0
1359
1364
  while kill -0 "$pid" 2>/dev/null && [[ "$_grace_waited" -lt 5 ]]; do
@@ -1372,6 +1377,28 @@ heartbeat_monitor() {
1372
1377
  kill -KILL "$pid" 2>/dev/null || true ;;
1373
1378
  esac
1374
1379
  fi
1380
+ # Orphan sweep: wrapper 가 SIGTERM 을 수용해도 자식 codex 프로세스는 별도
1381
+ # Win32 process 이므로 자동 종료되지 않는다. 스냅샷 PID 중 살아있는 것만 tree kill.
1382
+ if [[ -n "$_stall_children" ]]; then
1383
+ local _orphan_alive=""
1384
+ local _cpid
1385
+ for _cpid in $_stall_children; do
1386
+ kill -0 "$_cpid" 2>/dev/null && _orphan_alive="$_orphan_alive $_cpid"
1387
+ done
1388
+ if [[ -n "$_orphan_alive" ]]; then
1389
+ echo "[tfx-heartbeat] pid=$pid orphan children detected:$_orphan_alive — tree kill" >&2
1390
+ case "$(uname -s)" in
1391
+ MINGW*|MSYS*)
1392
+ for _cpid in $_orphan_alive; do
1393
+ MSYS_NO_PATHCONV=1 cmd.exe //c "taskkill /T /F /PID $_cpid" 2>/dev/null || true
1394
+ done ;;
1395
+ *)
1396
+ for _cpid in $_orphan_alive; do
1397
+ kill -KILL "$_cpid" 2>/dev/null || true
1398
+ done ;;
1399
+ esac
1400
+ fi
1401
+ fi
1375
1402
  break
1376
1403
  fi
1377
1404
  echo "[tfx-heartbeat] pid=$pid elapsed=${elapsed}s output=${current_size}B status=STALL stall=${stall_count}s" >&2