@theronap/cortex-mcp 0.9.139 → 0.9.140

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.
@@ -290,6 +290,18 @@ export function classifyEdgeFailure(r) {
290
290
  // The other shape of the same event: spawnSync killed the child, so status is null and signal set.
291
291
  if (r.signal) return { reason: 'timeout', detail: `killed by ${r.signal} after ${summaryTimeoutMs()}ms` }
292
292
 
293
+ // 🔴 EVERYTHING BELOW APPLIES ONLY TO A FAILED CALL. Exit 0 means the model answered; its answer
294
+ // is CONTENT, not a status report, and must never be scanned for failure keywords.
295
+ //
296
+ // This ordering was wrong on the first version and produced a false `auth-expired` on a call that
297
+ // had returned status 0 — because the session being summarized was itself about fixing an OAuth
298
+ // bug, so the model's own summary contained the word. A working extraction was thrown away for
299
+ // discussing the wrong subject. Any session about auth, 401s or logins would have hit it.
300
+ //
301
+ // The general form of the mistake: matching a symptom string across a channel that carries both
302
+ // diagnostics AND payload. The exit status is the only trustworthy separator, so it goes first.
303
+ if (r.status === 0) return r.stdout ? null : { reason: 'no-output', detail: 'claude exited 0 with empty stdout' }
304
+
293
305
  const out = `${r.stdout ?? ''}\n${r.stderr ?? ''}`
294
306
  // ⚠ THE AUTH MESSAGE ARRIVES ON **STDOUT**, WITH EXIT 1 — not on stderr, which is where a reader
295
307
  // would look for it. Verified against the live failure 2026-09-08:
@@ -305,9 +317,7 @@ export function classifyEdgeFailure(r) {
305
317
  + 'and no page proposals are made.',
306
318
  }
307
319
  }
308
- if (r.status !== 0) return { reason: 'exit', detail: `claude exited ${r.status}: ${firstLine(out)}` }
309
- if (!r.stdout) return { reason: 'no-output', detail: 'claude exited 0 with empty stdout' }
310
- return null
320
+ return { reason: 'exit', detail: `claude exited ${r.status}: ${firstLine(out)}` }
311
321
  }
312
322
 
313
323
  function firstLine(s) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theronap/cortex-mcp",
3
- "version": "0.9.139",
3
+ "version": "0.9.140",
4
4
  "description": "Connect your AI assistant to Cortex — your org's projects, activity, gaps, and directives, scoped to you.",
5
5
  "type": "module",
6
6
  "bin": {