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. 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 9eaea5cb..a3133441 100644 --- a/tests/test_ai_accounts.py +++ b/tests/test_ai_accounts.py @@ -102,6 +102,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')])