chore(container): STDERR_GRACE_MS env override + recovery test#44
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two follow-ups parked from PR #43's code review:
1.
CONTAINER_STDERR_GRACE_MSenv override — was hardcoded at 5 min. Now reads fromsrc/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 > timeoutMsandstderr_idle > grace; an isolated stderr gap within the stdout-idle window does NOT kill.Tests
Notable
The first follow-up (
stream-command.ts:entityDisplayNamedrift) 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 atmainHEAD. No action needed there.🤖 Generated with Claude Code