Skip to content

fix(config): preserve inherited prerelease readiness settings - #105

Open
Haloukaidi wants to merge 1 commit into
lbx154:devfrom
Haloukaidi:fix/prerelease-setting-inheritance
Open

Haloukaidi wants to merge 1 commit into
lbx154:devfrom
Haloukaidi:fix/prerelease-setting-inheritance

Conversation

@Haloukaidi

@Haloukaidi Haloukaidi commented Sep 7, 2026

Copy link
Copy Markdown

Setting ARGUS_SKILL_ALLOW_BACKEND_PRERELEASE=1 is ignored by several readiness entry points because their default False is forwarded as an explicit rejection. The low-level readiness check only inherits the environment when the argument is None.

Preserve the omitted / false / true distinction through CLI parsing, Doctor, Web diagnostics, and interactive/non-interactive setup. An explicit False still overrides the environment, and the default policy remains unchanged when no opt-in is configured.

Validation on Windows / Python 3.13:

  • 73 tests passed across tests/core/test_backend_readiness.py and tests/tools/test_setup_readiness.py.
  • The 20 new regression cases cover omitted CLI options, Doctor inheritance, Web policy precedence with environment unset/0/1, and both setup paths.
  • Ruff passed for the modified Python files; git diff --check passed.
  • The regression cases are in the existing backend readiness module, already selected by Windows CI and included by the Linux suite. Remote CI has not yet run.

Copilot AI lite review requested due to automatic review settings September 7, 2026 14:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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_prerelease defaults from False to None in 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")
@lbx154 lbx154 closed this Sep 14, 2026
@lbx154 lbx154 reopened this Sep 14, 2026
@lbx154
lbx154 changed the base branch from main to dev September 14, 2026 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants