fix: improve novice error messages, gated by automated smoke - #40
Conversation
Simulated a non-technical user hitting every common failure and found two
defects plus a test-script bug:
- rdev-host serve without --join-code printed a developer leftover
('rdev-host foreground placeholder') instead of actionable guidance
- host join errors ignored the gateway's user_summary field and showed
terse protocol text; now prefer the human-readable summary
- unreachable-gateway error reworded from 'no healthy gateway routes:
probes did not find a reachable candidate' to plain guidance
ux-smoke.sh now exercises five novice error paths (unknown command,
missing --join-code, bad join code, unreachable gateway, port in use)
and asserts each message is human-readable and actionable.
📝 WalkthroughWalkthroughThe CLI now reports actionable guidance for missing or invalid join codes, unreachable gateways, unavailable routes, unknown commands, and port conflicts. UX smoke tests cover these error paths. ChangesCLI Error Guidance
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
scripts/ux-smoke.sh (1)
162-166: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAssert the gateway
user_summary, not a generic keyword.Line 163 accepts any output containing
invalidorno longer active. The terse protocolmessagecan contain the same text, so this test passes even ifNewJoinSessionResponseErrorstops selectingUserSummary. Configure distinctmessageanduser_summaryvalues in the fixture, then assert the exactuser_summary.Suggested assertion shape
- if [[ "$OUT" =~ invalid|no\ longer\ active ]]; then + if [[ "$OUT" == *"$EXPECTED_USER_SUMMARY"* ]] && + [[ "$OUT" != *"$EXPECTED_PROTOCOL_MESSAGE"* ]]; then🤖 Prompt for 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. In `@scripts/ux-smoke.sh` around lines 162 - 166, Update the bad join-code fixture and assertion in the smoke test around the rdev-host serve invocation: configure distinct protocol message and gateway user_summary values, then assert the exact user_summary instead of matching generic “invalid” or “no longer active” keywords. Keep the failure diagnostic output for unexpected responses.
🤖 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.
Nitpick comments:
In `@scripts/ux-smoke.sh`:
- Around line 162-166: Update the bad join-code fixture and assertion in the
smoke test around the rdev-host serve invocation: configure distinct protocol
message and gateway user_summary values, then assert the exact user_summary
instead of matching generic “invalid” or “no longer active” keywords. Keep the
failure diagnostic output for unexpected responses.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: f0c8823b-a07f-4b8d-9a72-e8a70c135eea
📒 Files selected for processing (4)
internal/hostcmd/exitcode.gointernal/hostcmd/hostcmd.gointernal/hostcmd/route_pool.goscripts/ux-smoke.sh
Simulated a non-technical user hitting common failures (per the 'simulate a novice' direction):\n\n- missing --join-code printed 'rdev-host foreground placeholder' (dev leftover) -> now explains what to do\n- join failures ignored gateway user_summary -> now prefer the human-readable copy\n- unreachable gateway -> plain guidance instead of route-pool jargon\n\nux-smoke now asserts all five error paths stay readable, so regressions fail CI.
Summary by CodeRabbit
Bug Fixes
Tests