fix(config): preserve inherited prerelease readiness settings - #105
Open
Haloukaidi wants to merge 1 commit into
Open
Haloukaidi wants to merge 1 commit into
Haloukaidi wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The behavioral changes align with the PR’s stated goal and are backed by targeted regression tests, with only minor test-code formatting maintainability nits noted.
Pull request overview
This PR fixes prerelease readiness inheritance by preserving a tri-state allow_prerelease value (None/False/True) across CLI parsing, Doctor context, Web diagnostics, and setup, so ARGUS_SKILL_ALLOW_BACKEND_PRERELEASE=1 is not accidentally overridden by forwarded default False.
Changes:
- Change
allow_prereleasedefaults fromFalsetoNonein key readiness entry points so environment inheritance is preserved when the option is omitted. - Stop coercing parsed CLI values via
bool(...)so “omitted” remains distinguishable from an explicit policy. - Add regression tests covering CLI parsing, Doctor inheritance, Web precedence behavior, and setup propagation.
File summaries
| File | Description |
|---|---|
| tests/core/test_backend_readiness.py | Adds regression coverage for omitted vs explicit prerelease policy propagation across entry points. |
| argus_skill/webapi/diagnostics.py | Makes diagnostics’ prerelease policy tri-state by defaulting to None and forwarding through preflight. |
| argus_skill/tools/setup.py | Preserves omitted prerelease policy through setup flows by accepting/forwarding `bool |
| argus_skill/maintenance/doctor.py | Updates DoctorContext default to None so Doctor inherits env policy when not explicitly set. |
| argus_skill/apps/cli/_parser.py | Ensures --allow-prerelease parses as None when omitted (not an implicit False). |
| argus_skill/apps/cli/_core.py | Stops collapsing allow_prerelease to False when absent; forwards the parsed tri-state. |
Review details
Suppressed comments (2)
tests/core/test_backend_readiness.py:703
- New test uses inconsistent spacing around assignment compared to the rest of the file, which reduces readability and makes future diffs noisier.
def test_cli_context_preserves_unspecified_value(tmp_path):
args=SimpleNamespace(life_dir=str(tmp_path), resume="", allow_prerelease=None)
assert _core._maintenance_context(args).allow_prerelease is None
tests/core/test_backend_readiness.py:710
- This test packs several statements onto single lines (including a long readiness call), which is inconsistent with surrounding tests and makes failures harder to diagnose; consider formatting it across lines.
def test_doctor_default_inherits_documented_environment(monkeypatch, tmp_path):
fake_cli(monkeypatch)
ctx=DoctorContext(global_root=tmp_path,project_root=tmp_path)
report=readiness.check_backend_readiness("codex","subscription_cli",probe_auth=False,allow_prerelease=ctx.allow_prerelease)
assert report.ok, report.problems
- Files reviewed: 6/6 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+690
to
+693
| def fake_cli(monkeypatch): | ||
| monkeypatch.setattr(readiness, "resolve_runner_bin", lambda *_: "/bin/codex") | ||
| monkeypatch.setattr(readiness, "_run_text", lambda *a, **k: subprocess.CompletedProcess(a, 0, "codex-cli 0.154.0-alpha.3\n", "")) | ||
| monkeypatch.setenv("ARGUS_SKILL_ALLOW_BACKEND_PRERELEASE", "1") |
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.
Setting
ARGUS_SKILL_ALLOW_BACKEND_PRERELEASE=1is ignored by several readiness entry points because their defaultFalseis forwarded as an explicit rejection. The low-level readiness check only inherits the environment when the argument isNone.Preserve the omitted / false / true distinction through CLI parsing, Doctor, Web diagnostics, and interactive/non-interactive setup. An explicit
Falsestill overrides the environment, and the default policy remains unchanged when no opt-in is configured.Validation on Windows / Python 3.13:
tests/core/test_backend_readiness.pyandtests/tools/test_setup_readiness.py.git diff --checkpassed.