Skip to content

Item 46 Bucket A slice 1: skip redundant fallback-chain retry on conda-create exhaustion - #439

Merged
mixmansoundude merged 1 commit into
mainfrom
claude/batch-crlf-strategy-pdi9h5
Aug 17, 2026
Merged

Item 46 Bucket A slice 1: skip redundant fallback-chain retry on conda-create exhaustion#439
mixmansoundude merged 1 commit into
mainfrom
claude/batch-crlf-strategy-pdi9h5

Conversation

@mixmansoundude

Copy link
Copy Markdown
Owner

Summary

  • First slice of CLAUDE.md Active Backlog Item 46's "Bucket A" (the remaining genuinely-doomed :die call sites, tracked separately from Item 45 and Bucket B which are already merged). :conda_create_failed's call :die previously fell through into :conda_create_done, which unconditionally set HP_PY to a path that provably does not exist, re-detected that via its own if not exist guard, and called :handle_conda_failure a second time -- replaying the just-failed embed download and venv creation attempts, and asking the REQ-014 system-Python consent prompt twice, for a genuine (non-cascade) total-tier-exhaustion failure.
  • Fix: add goto :after_env_mode_selection right after that call :die line, mirroring the already-shipped :hp_test_conda_fail test-bypass sibling a few thousand lines below, which has carried the identical goto since before this change.
  • Honest scope note, caught during implementation via careful control-flow re-tracing (not by review): this does not reduce total pause count to one. :after_env_mode_selection has its own if not defined HP_PY guard that now fires instead (previously masked, because :conda_create_done used to leave HP_PY defined-but-broken, which that specific check doesn't catch). The genuine win is skipping the second :handle_conda_failure call and its embed/venv-attempt + system-consent-prompt replay -- not cutting pause count to one. All updated docs (CLAUDE.md, a new docs/agent-interconnect.md section, the regression test header, and docs/agent-ndjson.md) describe this accurately rather than overclaiming.
  • Regression test (tests/selfapps_entrysmoke_no_interpreter.ps1, conda-full lane) updated: asserts [ERROR] python.exe missing from conda environment. is now absent (proving the second :handle_conda_failure call is skipped) and the new [ERROR] Active Python interpreter not resolved. line is present (proving the fall-through lands at :after_env_mode_selection's own guard rather than being silently swallowed).

Test plan

  • python tools/check_delimiters.py run_setup.bat -- clean
  • tools/run_sanity_sweep.sh (compileall, pyflakes, delimiter check, CRLF check, markdownlint, yamllint, actionlint, ASCII sweep, PowerShell AST parse sweep, full pytest suite) -- all green, 528 passed / 3 skipped
  • python tools/check_ndjson_registry.py -- PASS, no doc/code registry mismatches
  • Confirmed via grep that only tests/selfapps_entrysmoke_no_interpreter.ps1 references the two message strings this change affects; tests/selfapps_cascade_conda_create_fail.ps1 is structurally unaffected (its scenarios always branch away via the pre-existing cascade-re-entry check before reaching the modified line)
  • Full CI matrix (gated real/conda-full lanes especially) -- pending this PR's own run

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_017SQ1rvJxDbE71pTXJ4QvLV


Generated by Claude Code

…ine conda-create exhaustion

:conda_create_failed's call :die previously fell through into :conda_create_done, which
unconditionally set HP_PY to a nonexistent path and called :handle_conda_failure a second
time -- replaying the just-failed embed/venv attempts and asking the REQ-014 system-Python
consent prompt twice for a genuinely exhausted, non-cascade first attempt. Adds a goto
straight to :after_env_mode_selection (mirroring the already-shipped :hp_test_conda_fail
sibling), skipping that replay.

Does not reduce total pause count to one: :after_env_mode_selection's own "if not defined
HP_PY" guard now fires instead (previously masked because :conda_create_done left HP_PY
defined-but-broken). Documented honestly in CLAUDE.md, the new interconnect.md section, and
the updated regression test/NDJSON docs -- the real win is skipping the second fallback-chain
attempt, not cutting pause count.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017SQ1rvJxDbE71pTXJ4QvLV
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: f84c60f1-7e3b-437b-8a14-3fc2523a7adb

📥 Commits

Reviewing files that changed from the base of the PR and between dd89157 and d5ce8e0.

📒 Files selected for processing (5)
  • CLAUDE.md
  • docs/agent-interconnect.md
  • docs/agent-ndjson.md
  • run_setup.bat
  • tests/selfapps_entrysmoke_no_interpreter.ps1

Included review availability: Your plan includes up to 1 review per rolling hour; 0 remain after this review.

📜 Recent review details
⏰ Context from checks skipped due to timeout. (4)
  • GitHub Check: Batch syntax/run check (real)
  • GitHub Check: Batch syntax/run check (cache)
  • GitHub Check: Batch syntax/run check (uv)
  • GitHub Check: Batch syntax/run check (conda-full)
🧰 Additional context used
📓 Path-based instructions (13)
**/*.{md,bat,cmd,ps1,py,sh,yml,yaml,json}

📄 CodeRabbit inference engine (AGENTS.md)

Keep text ASCII-only and do not manually change line endings; follow .gitattributes.

Files:

  • docs/agent-ndjson.md
  • tests/selfapps_entrysmoke_no_interpreter.ps1
  • run_setup.bat
  • docs/agent-interconnect.md
  • CLAUDE.md
**/*.md

📄 CodeRabbit inference engine (AGENTS.md)

Cite run_setup.bat locations by stable label or subroutine name rather than exact line number in documentation.

Files:

  • docs/agent-ndjson.md
  • docs/agent-interconnect.md
  • CLAUDE.md
**/*.ps1

📄 CodeRabbit inference engine (AGENTS.md)

**/*.ps1: Prepend the TLS 1.2 SecurityProtocol assignment and retain -UseBasicParsing on every PowerShell 5.1 Invoke-WebRequest call.
Before system-wide installation, silently check elevation with fsutil dirty query %systemdrive% >nul 2>&1; on failure, use the per-user fallback.

Files:

  • tests/selfapps_entrysmoke_no_interpreter.ps1
**/*.{ps1,psm1,psd1}

📄 CodeRabbit inference engine (AGENTS.md)

Validate modified PowerShell files with the .NET AST parser or tools/ps-compileall.ps1; do not skip validation on Linux, and directly invoke modified scripts after installing pwsh where practical.

Files:

  • tests/selfapps_entrysmoke_no_interpreter.ps1
**/*.{bat,cmd,ps1,py,yml,yaml,json}

📄 CodeRabbit inference engine (AGENTS.md)

Run tools/check_delimiters.py to validate paired delimiters and quotes while respecting language-specific comments and escaping.

Files:

  • tests/selfapps_entrysmoke_no_interpreter.ps1
  • run_setup.bat
**/*.{yml,yaml,bat,ps1,py}

📄 CodeRabbit inference engine (AGENTS.md)

Enforce conda-forge only: add conda-forge and remove defaults before updates or installs, and always install with --override-channels -c conda-forge.

Files:

  • tests/selfapps_entrysmoke_no_interpreter.ps1
  • run_setup.bat
**/*.{bat,cmd,ps1,py,yml,json}

📄 CodeRabbit inference engine (CLAUDE.md)

ASCII only -- no emojis, curly quotes, em-dashes

Files:

  • tests/selfapps_entrysmoke_no_interpreter.ps1
  • run_setup.bat
**/*.{bat,cmd,ps1,py}

📄 CodeRabbit inference engine (CLAUDE.md)

Tag non-obvious constraints: # derived requirement: <why>

Files:

  • tests/selfapps_entrysmoke_no_interpreter.ps1
  • run_setup.bat
**/*.{py,ps1}

📄 CodeRabbit inference engine (CLAUDE.md)

Python unit tests: tests/test_<topic>.py

Files:

  • tests/selfapps_entrysmoke_no_interpreter.ps1
tests/selfapps_*.ps1

📄 CodeRabbit inference engine (CLAUDE.md)

PowerShell scenario tests: tests/selfapps_<scenario>.ps1

Files:

  • tests/selfapps_entrysmoke_no_interpreter.ps1
run_setup.bat

📄 CodeRabbit inference engine (AGENTS.md)

run_setup.bat: run_setup.bat must function as a single bootstrapper when dropped beside the application, without requiring committed helper files.
Every branch added to run_setup.bat or its related helpers must have a CI test, including feature flags, fallbacks, recovery paths, and fast/full paths.
Keep bootstrapper log messages synchronized with CI parsers; update workflow checks whenever messages or status summaries change.
All embedded helpers must remain base64-encoded under :define_helper_payloads; changing one requires synchronizing the matching HP_* line and rerunning delimiter checks.
Do not remove tilde prefixes from runtime artifact paths such as ~bootstrap.status.json, ~setup.log, ~environment.lock.txt, and ~env.state.json.

run_setup.bat: 1. Self-contained: no committed helper files; all helpers are base64-encoded inside
the batch file under :define_helper_payloads. To refresh a helper with a canonical
tools/ source, use python tools/sync_payload.py HP_VARNAME tools/the_file.py -- do not
hand-roll the encode/splice/write sequence (see docs/agent-lessons-learned.md's "Embedded
Helper Update Workflow" and the near-miss that motivated automating it).
2. Delimiter-check after every edit:

Files:

  • run_setup.bat
**/*.{bat,cmd}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{bat,cmd}: For batch assignments, use set "VAR=value"; do not use set VAR="value". Quote variables at every filesystem command call site, except NSIS /D= parameters, which must remain unquoted.
Avoid unscoped EnableDelayedExpansion, preserve correct escaping of special characters, and use ASCII plain text.
Run tools/check_delimiters.py and apply its batch heuristics, including caret escaping, quoted filesystem variables, escaped pipes, PowerShell operator placement, and spacing after rem.
Use tools/sync_payload.py as the only sanctioned method for re-encoding embedded HP_* payloads in run_setup.bat; never hand-roll the splice process.

**/*.{bat,cmd}: .bat/.cmd use CRLF (byte-uniform, -text); .ps1 uses CRLF (normalized eol=crlf); everything else LF
call "%CONDA_BAT%" ... for all conda invocations
--override-channels -c conda-forge on all installs
Avoid EnableDelayedExpansion; if needed, wrap tightly
Tilde-prefix temp files (~setup.log, etc.)
Bootstrap must fail fast and explicitly -- no silent fallbacks unless explicitly logged.
All execution must be interpreter-anchored: every tool invocation roots in an explicit
Python executable path (%HP_PY% or %CONDA_PREFIX%\python.exe), never PATH/activation.
Never depend on console scripts during bootstrap (pipreqs, pytest, etc. all require
Scripts/ on PATH and activation state neither is guaranteed) -- use explicit interpreter
paths or direct Python APIs instead.

Files:

  • run_setup.bat
CLAUDE.md

📄 CodeRabbit inference engine (AGENTS.md)

Run markdownlint-cli2 CLAUDE.md; only MD029 is intentionally enforced, and new Active Backlog entries must use bullets with the identifier in prose rather than literal ordered-list markers.

Files:

  • CLAUDE.md
🧠 Learnings (4)
📚 Learning: 2026-08-09T04:42:17.730Z
Learnt from: mixmansoundude
Repo: mixmansoundude/Python_vs_Windows PR: 426
File: tests/selftest.ps1:79-124
Timestamp: 2026-08-09T04:42:17.730Z
Learning: For PowerShell scenario tests in tests/, use tests/selfapps_<scenario>.ps1 with tests/harness.ps1 and CI registration for standalone full-bootstrap scenarios. Keep closely related extensions of flows already covered by tests/selftest.ps1—including empty-folder and shared stub-flow scenarios—in tests/selftest.ps1, reusing its Invoke-Setup helper and scratch-directory infrastructure instead of adding separate harness or CI wiring.

Applied to files:

  • tests/selfapps_entrysmoke_no_interpreter.ps1
📚 Learning: 2026-08-14T16:04:24.941Z
Learnt from: mixmansoundude
Repo: mixmansoundude/Python_vs_Windows PR: 434
File: tests/selfapps_lineending_check.ps1:0-0
Timestamp: 2026-08-14T16:04:24.941Z
Learning: PowerShell scripts named selfapps_*.ps1 that must remain compatible with Windows PowerShell 5.1 should not rely on the automatic $IsWindows variable, which is unavailable there. Use a compatible operating-system check such as [System.Environment]::OSVersion.Platform instead. CI invokes these scripts with pwsh, where $IsWindows is available, so ensure the chosen check works across both environments.

Applied to files:

  • tests/selfapps_entrysmoke_no_interpreter.ps1
📚 Learning: 2026-08-01T03:14:00.725Z
Learnt from: mixmansoundude
Repo: mixmansoundude/Python_vs_Windows PR: 408
File: run_setup.bat:1017-1019
Timestamp: 2026-08-01T03:14:00.725Z
Learning: In `run_setup.bat`, `:die` intentionally returns to its caller after setting `HP_BOOTSTRAP_STATE=error`, writing an error status, and releasing the bootstrap lock. The repository currently treats `~bootstrap.status.json` field `state=error` as the authoritative failure signal even when later flow writes `exitCode` 0. Do not request a call-site-specific hard exit without addressing this repository-wide convention.

Applied to files:

  • run_setup.bat
📚 Learning: 2026-08-09T04:21:52.930Z
Learnt from: CR
Repo: mixmansoundude/Python_vs_Windows PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-08-09T04:21:52.930Z
Learning: Applies to CLAUDE.md : Run `markdownlint-cli2 CLAUDE.md`; only MD029 is intentionally enforced, and new Active Backlog entries must use bullets with the identifier in prose rather than literal ordered-list markers.

Applied to files:

  • CLAUDE.md
🔇 Additional comments (5)
run_setup.bat (1)

1125-1143: LGTM!

tests/selfapps_entrysmoke_no_interpreter.ps1 (1)

10-25: LGTM!

Also applies to: 142-149, 169-191

docs/agent-interconnect.md (1)

984-1021: LGTM!

docs/agent-ndjson.md (1)

984-1003: LGTM!

CLAUDE.md (1)

1002-1043: 📐 Maintainability & Code Quality

Run the required CLAUDE.md validation.

Confirm that markdownlint-cli2 CLAUDE.md passes and that the new Active Backlog entry uses a bullet with the identifier in prose, not a literal ordered-list marker. The selected snippet does not include the parent list marker, so verify this in the full file.

As per coding guidelines: CLAUDE.md requires markdownlint-cli2 CLAUDE.md; only MD029 is intentionally enforced. Based on learnings: new Active Backlog entries must use bullets with the identifier in prose rather than literal ordered-list markers.

Sources: Coding guidelines, Learnings


📝 Walkthrough

Summary by CodeRabbit

  • Bug Fixes

    • Fixed failed Conda environment setup so fallback handling does not run twice.
    • Prevented invalid interpreter selection and duplicate error prompts.
    • Ensured users receive the correct final message when no Python interpreter is available.
  • Tests

    • Expanded regression coverage for failed Conda setup and interpreter resolution.
  • Documentation

    • Documented the corrected failure flow and expected error handling.

Walkthrough

The Conda creation failure path now jumps directly to :after_env_mode_selection. This prevents fall-through into :conda_create_done. Regression tests and documentation now verify the skipped fallback handling and the final interpreter-resolution error.

Changes

Conda failure flow

Layer / File(s) Summary
Redirect failed Conda creation
run_setup.bat
Failed Conda creation now jumps to :after_env_mode_selection instead of entering :conda_create_done.
Update regression coverage and documentation
tests/selfapps_entrysmoke_no_interpreter.ps1, docs/agent-ndjson.md, docs/agent-interconnect.md, CLAUDE.md
Regression checks and documentation now verify that duplicate fallback handling is skipped and that “Active Python interpreter not resolved.” is reported. The remaining non-halting :die path is documented.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to d5ce8

The change skips a redundant fallback retry after conda creation is exhausted and preserves the intended failure handling path; no actionable merge-blocking risk remains beyond completing normal documentation validation.

Possibly related PRs

Suggested reviewers: claude

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the change and the specific conda-create exhaustion behavior it fixes.
Description check ✅ Passed The description accurately explains the fix, scope, regression coverage, and test results.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/batch-crlf-strategy-pdi9h5

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mixmansoundude
mixmansoundude enabled auto-merge (squash) August 17, 2026 21:25

Copy link
Copy Markdown
Owner Author

@coderabbitai review


Generated by Claude Code

@coderabbitai

coderabbitai Bot commented Aug 17, 2026

Copy link
Copy Markdown

@mixmansoundude: I will review pull request #439.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@mixmansoundude
mixmansoundude merged commit 4fd7229 into main Aug 17, 2026
17 checks passed
@mixmansoundude
mixmansoundude deleted the claude/batch-crlf-strategy-pdi9h5 branch August 17, 2026 23:29
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.

2 participants