From 0a875f98cd32fc1f240b35e754593178c618bf3f Mon Sep 17 00:00:00 2001 From: eowca <4008965+eowca@users.noreply.github.com> Date: Thu, 26 Nov 2026 09:44:07 +0100 Subject: [PATCH 1/2] Bound ai-accounts stderr drain after the command exits Architecture-Review: unchanged; the optional account shim keeps command and replay behavior and returns the known exit status if stderr remains open. Co-Authored-By: Codex --- scripts/ai-accounts/ai-accounts | 4 +++- tests/test_ai_accounts.py | 6 ++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/scripts/ai-accounts/ai-accounts b/scripts/ai-accounts/ai-accounts index c7aeaca2..5f8ebcf5 100755 --- a/scripts/ai-accounts/ai-accounts +++ b/scripts/ai-accounts/ai-accounts @@ -1064,7 +1064,9 @@ def cmd_run(providers: str, argv: list[str], retry_exit: set[int] | None = None, t = threading.Thread(target=pump, daemon=True) t.start() code = proc.wait() - t.join() + t.join(timeout=1) + if t.is_alive(): + return code text = b"".join(seen).decode("utf-8", "replace") retryable = code != 0 and (retry_exit is None or code in retry_exit) if (not retryable or attempt == 2 or not model or providers not in PROVIDERS diff --git a/tests/test_ai_accounts.py b/tests/test_ai_accounts.py index 2d3037a6..0565ddb3 100644 --- a/tests/test_ai_accounts.py +++ b/tests/test_ai_accounts.py @@ -95,6 +95,12 @@ def test_codex_requires_requested_model_evidence(helper, monkeypatch): assert helper.active('codex') == 'main' +def test_run_returns_after_leader_exits_with_inherited_stderr(helper): + argv = [helper.sys.executable, helper.__file__, 'run', 'claude', '--', helper.sys.executable, + '-c', 'import subprocess, sys; subprocess.Popen(["sleep", "6"]); sys.exit(7)'] + assert helper.subprocess.run(argv, timeout=5).returncode == 7 + + @pytest.mark.parametrize('providers,explicit,retry_safe,runs,active', [ ('claude,codex', False, False, 1, 'a'), ('claude', False, False, 1, 'b'), ('claude', False, True, 2, 'b'), ('claude', True, True, 1, 'a')]) From 2242efb1f215a735d5c31844f6b9e846272876ac Mon Sep 17 00:00:00 2001 From: eowca <4008965+eowca@users.noreply.github.com> Date: Thu, 26 Nov 2026 09:58:21 +0100 Subject: [PATCH 2/2] Point post-review base updates to the Review budget Co-Authored-By: Codex --- core/skills/implement/SKILL.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/skills/implement/SKILL.md b/core/skills/implement/SKILL.md index dd96eaac..45b983de 100644 --- a/core/skills/implement/SKILL.md +++ b/core/skills/implement/SKILL.md @@ -64,8 +64,8 @@ Before the check and draft push for primary review, rebase your own commits onto `[repo].base` (default `main`). For a stack, follow [stacked delivery](../../../docs/DELEGATION.md#stacked-delivery). Leave base merges out of a branch awaiting its delta. -After an approved primary or a delta, merge `origin/` into the existing -branch when the base or its check scripts change. +For base or check-script changes after review, follow the +[Review budget](../../CONTRACT.md#review-budget). Preserve the primary for the delta and the delta for post-review fixes. Split the PR if resolving conflicts requires rewriting its reviewed history.