claude-dev-env 8.43.0 → 8.43.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -244,7 +244,7 @@ def _attempt_once(context: _RunContext, decision: Decision) -> JobOutcome | None
|
|
|
244
244
|
except (OSError, subprocess.TimeoutExpired) as error:
|
|
245
245
|
status = "timeout" if isinstance(error, subprocess.TimeoutExpired) else "start_failed"
|
|
246
246
|
_record_spent_attempt(context, account, status, COMMAND_MISSING_EXIT_CODE)
|
|
247
|
-
if not context.all_readings:
|
|
247
|
+
if isinstance(error, subprocess.TimeoutExpired) or not context.all_readings:
|
|
248
248
|
context.report.final_decision = decision
|
|
249
249
|
return JobOutcome(COMMAND_MISSING_EXIT_CODE, "", str(error), account.name, tuple(context.all_attempts), "advisor_blocked", None, None)
|
|
250
250
|
return None
|
|
@@ -361,12 +361,8 @@ def test_should_keep_spent_mark_until_reset(
|
|
|
361
361
|
assert json.loads(capsys.readouterr().out)["decision"]["account"] == "second"
|
|
362
362
|
|
|
363
363
|
|
|
364
|
-
@pytest.mark.parametrize(
|
|
365
|
-
("start_error", "expected_status"),
|
|
366
|
-
((OSError("missing command"), "start_failed"), (subprocess.TimeoutExpired("job", 1), "timeout")),
|
|
367
|
-
)
|
|
368
364
|
def test_should_leave_later_choices_open_after_start_failure(
|
|
369
|
-
monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str]
|
|
365
|
+
monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str]
|
|
370
366
|
) -> None:
|
|
371
367
|
accounts = (_account("first"), _account("second"))
|
|
372
368
|
monkeypatch.setitem(account_broker.all_product_adapters, Product.CODEX, _adapter(accounts, {
|
|
@@ -374,12 +370,37 @@ def test_should_leave_later_choices_open_after_start_failure(
|
|
|
374
370
|
}))
|
|
375
371
|
|
|
376
372
|
def runner(argv: object, **options: object) -> subprocess.CompletedProcess[str]:
|
|
377
|
-
raise
|
|
373
|
+
raise OSError("missing command")
|
|
378
374
|
|
|
379
375
|
with account_broker.override_subprocess_runner(runner):
|
|
380
376
|
outcome, _ = account_broker._execute(Product.CODEX, ("job",), now=datetime.now(timezone.utc))
|
|
381
377
|
|
|
382
|
-
assert outcome.attempts == (("first",
|
|
378
|
+
assert outcome.attempts == (("first", "start_failed"), ("second", "start_failed"))
|
|
379
|
+
assert account_broker.main(("choose", "--product", "codex")) == 0
|
|
380
|
+
assert json.loads(capsys.readouterr().out)["decision"]["account"] == "first"
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
def test_should_stop_after_timeout_without_running_job_again(
|
|
384
|
+
monkeypatch: pytest.MonkeyPatch, capsys: pytest.CaptureFixture[str]
|
|
385
|
+
) -> None:
|
|
386
|
+
accounts = (_account("first"), _account("second"))
|
|
387
|
+
monkeypatch.setitem(account_broker.all_product_adapters, Product.CODEX, _adapter(accounts, {
|
|
388
|
+
"first": _meters(80, 80), "second": _meters(70, 70)
|
|
389
|
+
}))
|
|
390
|
+
invoked_homes: list[str] = []
|
|
391
|
+
|
|
392
|
+
def runner(argv: object, **options: object) -> subprocess.CompletedProcess[str]:
|
|
393
|
+
invoked_homes.append(Path(options["env"]["CODEX_HOME"]).name)
|
|
394
|
+
raise subprocess.TimeoutExpired("job", 1)
|
|
395
|
+
|
|
396
|
+
with account_broker.override_subprocess_runner(runner):
|
|
397
|
+
outcome, report = account_broker._execute(Product.CODEX, ("job",), now=datetime.now(timezone.utc))
|
|
398
|
+
|
|
399
|
+
assert invoked_homes == ["first"]
|
|
400
|
+
assert outcome.attempts == (("first", "timeout"),)
|
|
401
|
+
assert outcome.status == "advisor_blocked"
|
|
402
|
+
assert outcome.account_name == "first"
|
|
403
|
+
assert report.final_decision.account.name == "first"
|
|
383
404
|
assert account_broker.main(("choose", "--product", "codex")) == 0
|
|
384
405
|
assert json.loads(capsys.readouterr().out)["decision"]["account"] == "first"
|
|
385
406
|
|
|
@@ -13,7 +13,7 @@ def _comment_policy_phrases() -> tuple[str, ...]:
|
|
|
13
13
|
"leave comments tied to untouched code unchanged",
|
|
14
14
|
"keep comment cleanup inside the requested task",
|
|
15
15
|
"production and tests follow one rule",
|
|
16
|
-
"changed directive, todo, fixme, hack, xxx, and type-ignore comments are removed
|
|
16
|
+
"changed directive, todo, fixme, hack, xxx, and type-ignore comments are removed",
|
|
17
17
|
)
|
|
18
18
|
|
|
19
19
|
|