Skip to content

fix: ensure Rust recipe runner on startup, add cargo to prerequisites#2957

Merged
rysweet merged 4 commits intomainfrom
fix/rust-runner-startup-dependency
Mar 9, 2026
Merged

fix: ensure Rust recipe runner on startup, add cargo to prerequisites#2957
rysweet merged 4 commits intomainfrom
fix/rust-runner-startup-dependency

Conversation

@rysweet
Copy link
Owner

@rysweet rysweet commented Mar 8, 2026

What

Consolidates all launcher startup initialization into a single _common_launcher_startup() function, ensuring every amplihack launcher path gets identical initialization.

Why

Previously, launch_command() had 7 init steps while copilot/codex/amplifier only had 2 (staging + rust runner). Missing from those paths:

Changes

src/amplihack/cli.py

  • New: _common_launcher_startup(args) — idempotent function with all 5 init steps
  • New: _ensure_rust_recipe_runner() — standalone helper for Rust recipe runner check
  • Refactored: launch_command() now delegates init to _common_launcher_startup()
  • Refactored: All command blocks (RustyClawd, copilot, codex, amplifier) call _common_launcher_startup() instead of duplicating _ensure_amplihack_staged() + _ensure_rust_recipe_runner()
  • Idempotency guard prevents double-init when RustyClawd delegates to launch_command()

src/amplihack/launcher/copilot.py

  • Removed duplicate ensure_rust_recipe_runner() call (now handled by _common_launcher_startup())

tests/test_common_launcher_startup.py (NEW — 19 tests)

  • Idempotency guard (double-call safe)
  • subprocess_safe skip
  • Nesting detection and auto-staging
  • Startup steps order verification
  • Non-fatal failure handling for SDK deps and power-steering
  • _ensure_rust_recipe_runner output verification
  • All 6 launcher paths verified to call _common_launcher_startup()

tests/test_cli_claude_command_guard.py

  • Fixed 6 pre-existing test failures by properly mocking _common_launcher_startup

Testing

  • 68 unit tests pass (19 startup + 15 command guard + 34 rust runner)
  • Outside-in verified: each launcher command (launch, claude, RustyClawd, copilot, codex, amplifier) shows "Rust recipe runner available" in real subprocess output

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2026

🤖 Auto-fixed version bump

The version in pyproject.toml has been automatically bumped to the next patch version.

If you need a minor or major version bump instead, please update pyproject.toml manually and push the change.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2026

Repo Guardian - Passed

All files in this PR are durable content:

  • Documentation updates for permanent prerequisites (README.md, docs/PREREQUISITES.md)
  • Version bump and dependency management (pyproject.toml, uv.lock)
  • Production code for startup checks (src/amplihack/launcher/copilot.py)

No ephemeral content detected. ✓

AI generated by Repo Guardian

@github-actions github-actions bot mentioned this pull request Mar 8, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 8, 2026

🤖 Auto-fixed version bump

The version in pyproject.toml has been automatically bumped to the next patch version.

If you need a minor or major version bump instead, please update pyproject.toml manually and push the change.

Ubuntu and others added 4 commits March 9, 2026 01:13
- Add ensure_rust_recipe_runner() call to copilot launcher startup
- Add Rust/cargo to Prerequisites in README.md and PREREQUISITES.md
- Add cargo install instructions to all platform sections (macOS, Ubuntu, Fedora, Arch)
- Add cargo --version to verification commands

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Move ensure_rust_recipe_runner() from copilot-only to a shared
_ensure_rust_recipe_runner() function called from all 6 launcher
entry points: launch, claude, RustyClawd, copilot, codex, amplifier.

Previously only copilot and install had the check, leaving 4 paths
uncovered.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Extract nesting detection, framework staging, Rust recipe runner check,
SDK dep check, and power-steering prompt into a single idempotent
function called from all 5 launcher entry points.

Before: launch_command() had 7 init steps; copilot/codex/amplifier
only had staging + rust runner. Now all paths get identical init.

Also fixes 6 pre-existing test failures in test_cli_claude_command_guard
by mocking _common_launcher_startup (staging sys.exit(1) was leaking
through the test harness).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Covers:
- Idempotency guard (double-call safe for RustyClawd → launch_command)
- subprocess_safe skip
- Nesting detection and auto-staging
- Startup steps order (staged → rust → sdk → power-steering)
- Non-fatal failure handling for SDK deps and power-steering
- _ensure_rust_recipe_runner output (success, warning, import error)
- All 6 launcher paths call _common_launcher_startup

Outside-in verified: each launcher command (launch, claude, RustyClawd,
copilot, codex, amplifier) shows 'Rust recipe runner available' in real
subprocess output.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@rysweet rysweet force-pushed the fix/rust-runner-startup-dependency branch from 5126b4d to 11e4151 Compare March 9, 2026 01:13
@rysweet rysweet merged commit ba15499 into main Mar 9, 2026
13 of 14 checks passed
@rysweet rysweet deleted the fix/rust-runner-startup-dependency branch March 9, 2026 01:13
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.

1 participant