Skip to content

Hard-fail failproofai config on unsupported platforms - #664

Merged
hermes-exosphere merged 2 commits into
mainfrom
luv-legion-664
Aug 7, 2026
Merged

Hard-fail failproofai config on unsupported platforms#664
hermes-exosphere merged 2 commits into
mainfrom
luv-legion-664

Conversation

@NiveditJain

@NiveditJain NiveditJain commented Aug 7, 2026

Copy link
Copy Markdown
Member

Summary

  • failproofai config now refuses setup outright on non-linux/darwin platforms (Windows, today), before drawing a single prompt, instead of completing in a degraded state with no daemon and no fail-closed guarantee.
  • Wires the new unsupported_platform abort reason into the onboarding-attempt memory so an unsupported machine gets a one-line hint instead of relaunching (and re-failing) the wizard on every command; the hint's suggested action is version-specific rather than the generic failproofai config retry, since that would just hit the same hard-fail again.
  • Extracts the wizard's completion summary into a pure, exported buildCompletionSummary() that bounds the custom/daemon/reporting notes into a single grouped clause, so the true worst case (every policy, every CLI, all three notes present) still fits an 80-column terminal — not just the case that happened to be covered before.
  • Updates CLAUDE.md's daemon-fallback documentation and adds a CHANGELOG.md entry (with the real PR number).

Test plan

  • bun run test -- run __tests__/hooks/configure-wizard.test.ts (65/65 passing)
  • bun run test -- run __tests__/hooks/onboarding-attempt.test.ts (22/22 passing)
  • bun run test -- run __tests__/hooks/daemon-service.test.ts (confirmed unaffected)
  • bun run test:run (full suite — no new failures; one pre-existing, unrelated failure suite left untouched)
  • bunx tsc --noEmit (clean)
  • bun run lint (clean, only pre-existing warnings)
  • Addressed all 3 CodeRabbit review comments (changelog placeholder, summary-line column budget for the true worst case, onboarding hint wording)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added clearer onboarding guidance for unsupported platforms, including update recommendations.
    • Setup can be retried after upgrading to a newer CLI version.
    • Improved completion summaries with clearer status details and optional notes.
  • Bug Fixes

    • Unsupported platforms now stop setup before prompts or configuration changes.
    • Enforced required daemon setup on supported platforms.
    • Improved onboarding behavior and status reporting for failed setup attempts.

isDaemonSupportedPlatform() previously let setup skip the daemon
requirement and complete anyway on Windows, leaving the machine
reading as configured while enforcing in-process with no fail-closed
guarantee. Setup now refuses outright before drawing a single prompt,
writing nothing. Also wires the new abort reason into the onboarding
memory so an unsupported machine gets a one-line hint instead of
relaunching (and re-failing) on every command, and tightens the outro
summary line so the now-mandatory daemon note still fits in 80 columns
on the widest real case.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The configure wizard now rejects unsupported platforms before prompts or writes. It returns unsupported_platform, emits telemetry, and exits with status 1. Onboarding retries after a CLI upgrade. Tests and documentation reflect mandatory daemon setup on supported platforms.

Changes

Unsupported Platform Setup

Layer / File(s) Summary
Platform guard and setup flow
src/hooks/configure-wizard.ts
The wizard aborts unsupported platforms before rendering or prompting. Supported platforms require daemon support. Completion messaging uses the exported buildCompletionSummary helper.
Onboarding retry handling
src/hooks/onboarding-attempt.ts
unsupported_platform blocks repeated onboarding on the same CLI version and provides platform-specific update guidance.
Behavior validation and release documentation
__tests__/hooks/configure-wizard.test.ts, __tests__/hooks/onboarding-attempt.test.ts, CLAUDE.md, CHANGELOG.md
Tests cover abort timing, first-run suppression, completion summaries, daemon defaults, and retry behavior. Documentation and the changelog describe the new setup behavior.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant ConfigureWizard as configure-wizard
  participant Onboarding as onboarding-attempt
  User->>ConfigureWizard: run failproofai config
  ConfigureWizard->>ConfigureWizard: check platform support
  alt unsupported platform
    ConfigureWizard-->>User: explain unsupported platform
    ConfigureWizard->>Onboarding: record unsupported_platform
  else supported platform
    ConfigureWizard-->>User: continue daemon-backed setup
  end
  Onboarding->>Onboarding: compare recorded and current CLI version
  Onboarding-->>User: suppress or re-offer onboarding
Loading

Possibly related PRs

Suggested labels: bug

Suggested reviewers: chhhee10

Poem

A rabbit checks the platform gate,
No prompts or files can pass the slate.
The daemon guards the supported trail,
Upgrade the CLI to retry the tale.
“Unsupported,” says Bun, “means stop!” 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
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.
Title check ✅ Passed The title clearly and concisely describes the main change: making configuration fail on unsupported platforms.
Description check ✅ Passed The description clearly explains the changes and provides detailed test results, but it omits the template's Type of Change and build checklist items.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@coderabbitai coderabbitai Bot added the bug Something isn't working label Aug 7, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@CHANGELOG.md`:
- Line 6: Replace the unreplaced (`#PR`) placeholder in the changelog entry with
the actual PR identifier (`#664`), or remove the parenthetical reference if this
changelog does not include PR numbers.

In `@src/hooks/configure-wizard.ts`:
- Around line 1438-1447: The completion summary assembled near customNote can
exceed 80 columns for the longest combination of assistants and enabled optional
notes. Update the summary formatting to ensure the final rendered line,
including customNote, daemon status, and reporting status, stays within 80
columns without hard truncation; add coverage for the maximum-output combination
with customEnabled, daemonInstalled, and connected enabled.

In `@src/hooks/onboarding-attempt.ts`:
- Line 176: Update the recovery instruction associated with the
`unsupported_platform` reason in the onboarding attempt handling so it does not
use the generic `failproofai config` retry guidance. Provide a version-specific
action that remains appropriate when `blockerCleared` suppresses onboarding
until `cliVersion` changes, while preserving the existing behavior for other
reasons.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: b8b27d22-157b-4271-923b-993ce15b7e0b

📥 Commits

Reviewing files that changed from the base of the PR and between 9a51e57 and 914461a.

📒 Files selected for processing (6)
  • CHANGELOG.md
  • CLAUDE.md
  • __tests__/hooks/configure-wizard.test.ts
  • __tests__/hooks/onboarding-attempt.test.ts
  • src/hooks/configure-wizard.ts
  • src/hooks/onboarding-attempt.ts

Comment thread CHANGELOG.md Outdated
Comment thread src/hooks/configure-wizard.ts Outdated
Comment thread src/hooks/onboarding-attempt.ts
- CHANGELOG.md: fill in the real PR number instead of the (#PR) placeholder.
- configure-wizard.ts: extract the completion summary into a pure,
  exported buildCompletionSummary() that bounds custom/daemon/reporting
  into one grouped note. The previous fix only covered the
  customEnabled===false case; the true worst case (custom on, daemon on,
  reporting on, every CLI) still overflowed 80 columns. Added direct unit
  tests for the worst case rather than relying on driving the full wizard
  through a real chdir + on-disk custom-policy fixture.
- onboarding-attempt.ts: give unsupported_platform its own hint action
  instead of "Run `failproofai config`" — blockerCleared only re-offers
  that reason on a CLI version bump, so the generic retry would just hit
  the same hard-fail again in the meantime.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@NiveditJain

Copy link
Copy Markdown
Member Author

@hermes-exosphere review

@hermes-exosphere
hermes-exosphere merged commit 822022f into main Aug 7, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants