instar 1.3.133 → 1.3.134

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.
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAmSH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAwvDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAmmPtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
1
+ {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/commands/server.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAmSH,UAAU,YAAY;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;2DACuD;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAwvDD,wBAAsB,WAAW,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAipPtE;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsDzE;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuD5E"}
@@ -5298,6 +5298,10 @@ export async function startServer(options) {
5298
5298
  notifyFn: rateLimitNotify,
5299
5299
  projectDir: config.projectDir,
5300
5300
  getClaudeSessionId: getClaudeSessionIdForName,
5301
+ // #33 codex parity: for codex sessions, recovery-verification reads the newest
5302
+ // codex rollout (account-wide throttle → newest-rollout growth = cleared) and
5303
+ // the user-facing messages use OpenAI wording.
5304
+ getSessionFramework: (name) => sessionManager.listRunningSessions().find((s) => s.tmuxSession === name)?.framework,
5301
5305
  }, rlsCfg);
5302
5306
  // Zombie-kill veto: compose BOTH sentinels (editing the single-predicate
5303
5307
  // checker — a second setActiveRecoveryChecker call would drop the
@@ -5325,6 +5329,48 @@ export async function startServer(options) {
5325
5329
  sessionManager.on('apiErrorAtIdle', (sessionName) => {
5326
5330
  rateLimitSentinel.report(sessionName, 'idle-error', { errorClass: 'transient-api' });
5327
5331
  });
5332
+ // #33 codex parity: the two triggers above read CLAUDE panes / claude-PID watchdog,
5333
+ // so a codex session throttled by OpenAI is invisible to them. This poll reads the
5334
+ // codex account usage; when codex itself flags a rate-limit hit
5335
+ // (rateLimitReachedType), it reports each running codex session into the sentinel
5336
+ // (deduped — report() no-ops while a recovery is active). The recovery keeps the
5337
+ // session alive and verifies via the newest codex rollout's growth (the codex-aware
5338
+ // readJsonlBaseline / getSessionFramework dep above).
5339
+ //
5340
+ // KNOWN LIMITATION — must-fix BEFORE enabling (2nd-pass review): the OpenAI limit is
5341
+ // account-wide and recovery-verification watches the ACCOUNT's newest rollout, not a
5342
+ // specific session's. Correct for ONE codex session (today's reality), but with ≥2
5343
+ // concurrent throttled codex sessions, one session's resumed output grows the shared
5344
+ // newest rollout and would recover ALL reported sessions — including a sibling that
5345
+ // is genuinely still stuck (a false recovery). Safe while DARK + single-session; do
5346
+ // NOT flip codexUsageDetection on a host that runs ≥2 concurrent codex sessions until
5347
+ // this is per-session (track the session's own rollout) or redefined as account-level
5348
+ // with per-session re-probe. Ships DARK (default off); rollback = set it false.
5349
+ // Best-effort + non-blocking.
5350
+ if (rlsCfg.codexUsageDetection === true) {
5351
+ const codexRateLimitPoll = setInterval(() => {
5352
+ void (async () => {
5353
+ try {
5354
+ const codexSessions = sessionManager
5355
+ .listRunningSessions()
5356
+ .filter((s) => s.framework === 'codex-cli');
5357
+ if (codexSessions.length === 0)
5358
+ return;
5359
+ const { readLatestCodexUsage } = await import('../providers/adapters/openai-codex/observability/codexRateLimitReader.js');
5360
+ const usage = await readLatestCodexUsage();
5361
+ if (!usage || !usage.rateLimitReachedType)
5362
+ return;
5363
+ for (const s of codexSessions) {
5364
+ rateLimitSentinel.report(s.tmuxSession, 'codex-usage-poll', { errorClass: 'throttle' });
5365
+ }
5366
+ }
5367
+ catch {
5368
+ /* @silent-fallback-ok best-effort codex-throttle detection; never crash the poll */
5369
+ }
5370
+ })();
5371
+ }, 60_000);
5372
+ codexRateLimitPoll.unref?.();
5373
+ }
5328
5374
  // Observability: every RateLimitSentinel lifecycle transition → the shared
5329
5375
  // sentinel-events.jsonl audit trail, so a throttle recovery is never
5330
5376
  // invisible (the 2026-05-30 ask: "instrument so we can SEE it working").