Skip to content

Commit fccb1d5

Browse files
committed
feat(monitor): trace terminal-status exit-code recovery from log footer (#1927)
The three reconciliation branches in getIsolationSessionState now all emit a [VERBOSE] trail (req #6): stale-executing flip, no-live-record recovery, and — newly — the terminal-status branch where start-command reports a terminal status with a missing/sentinel exit code and the real code (e.g. 137) is recovered from the authoritative log footer. This leaves a greppable trace of exactly which path corrected an unreported kill, for the next iteration.
1 parent 4ea5f46 commit fccb1d5

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/session-monitor.lib.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,9 @@ async function getIsolationSessionState(sessionName, sessionInfo, options = {})
396396
if (footer?.finished) {
397397
exitCode = footer.exitCode;
398398
const correctedStatus = classifyExitStatus(footer.exitCode) || statusResult.status;
399+
if (verbose) {
400+
console.log(`[VERBOSE] Session ${sessionName} reported terminal '${statusResult.status}' with exit ${statusResult.exitCode}; recovered real exit ${exitCode} (${correctedStatus}) from log footer`);
401+
}
399402
return { running: false, exitCode, status: correctedStatus, statusResult: { ...statusResult, status: correctedStatus, exitCode } };
400403
}
401404
}

0 commit comments

Comments
 (0)