Skip to content

chore(container): STDERR_GRACE_MS env override + recovery test#44

Merged
topcoder1 merged 1 commit into
mainfrom
claude/stderr-grace-env
Apr 28, 2026
Merged

chore(container): STDERR_GRACE_MS env override + recovery test#44
topcoder1 merged 1 commit into
mainfrom
claude/stderr-grace-env

Conversation

@topcoder1
Copy link
Copy Markdown
Owner

Summary

Two follow-ups parked from PR #43's code review:

1. CONTAINER_STDERR_GRACE_MS env override — was hardcoded at 5 min. Now reads from src/config.ts, default 300000ms, override via env. Lets ops bump the grace window if a workload regularly produces longer stderr-quiet stretches (e.g. an MCP tool that blocks for 6+ min on a slow upstream) without recompiling.

2. Recovery edge-case test — reviewer flagged the missing scenario: stderr active, then briefly silent past the 5-min grace, then resumes. Verifies the kill condition correctly requires both stdout_idle > timeoutMs and stderr_idle > grace; an isolated stderr gap within the stdout-idle window does NOT kill.

Tests

Full suite 2448/2448 green (was 2447, +1)
Typecheck clean
Recovery test exercises 10min stderr-active → 6min silence → 30min stderr-active → success

Notable

The first follow-up (stream-command.ts:entityDisplayName drift) flagged in PR #39's reviewer feedback was already shipped via PR #40 (refactor(brain): /brainstream uses shared deriveTitle helper) — confirmed by reading the file at main HEAD. No action needed there.

🤖 Generated with Claude Code

Two follow-ups to PR #43:

1. Add CONTAINER_STDERR_GRACE_MS env override in src/config.ts.
   Default 300000 (5min). container-runner reads from config instead
   of the local hardcoded constant. Lets ops bump the grace window
   if a workload regularly produces longer stderr-quiet stretches
   (e.g. an MCP tool that blocks for 6+ min on a slow upstream)
   without recompiling.

2. New test in container-runner.test.ts: 'recovers when stderr goes
   briefly silent then resumes (gap shorter than stdout idle)'. The
   reviewer-flagged edge case — stderr active, then 6min silence
   (past 5min grace), then stderr resumes for another 30min before
   stdout emits. Confirms the kill condition correctly requires BOTH
   stdout idle > timeoutMs AND stderr idle > grace; an isolated
   stderr gap within the stdout-idle window does NOT kill.

Full suite: 2448/2448 green (was 2447, +1 new test).
@topcoder1 topcoder1 merged commit 8706734 into main Apr 28, 2026
@topcoder1 topcoder1 deleted the claude/stderr-grace-env branch April 28, 2026 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant