Skip to content

fix: improve novice error messages, gated by automated smoke - #40

Merged
EitanWong merged 1 commit into
mainfrom
fix/40-novice-error-paths
Aug 4, 2026
Merged

fix: improve novice error messages, gated by automated smoke#40
EitanWong merged 1 commit into
mainfrom
fix/40-novice-error-paths

Conversation

@EitanWong

@EitanWong EitanWong commented Aug 4, 2026

Copy link
Copy Markdown
Owner

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

    • Improved error messages for failed session joins, including clearer operator-facing details.
    • Added actionable guidance when no healthy gateway routes are available.
    • The serve command now clearly reports when a join code is missing instead of displaying misleading status output.
    • Improved handling and messaging for invalid join codes, unreachable gateways, and port conflicts.
  • Tests

    • Expanded smoke-test coverage for common command and connection error scenarios.

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.
@coderabbitai

coderabbitai Bot commented Aug 4, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The 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.

Changes

CLI Error Guidance

Layer / File(s) Summary
Error messages and smoke coverage
internal/hostcmd/exitcode.go, internal/hostcmd/hostcmd.go, internal/hostcmd/route_pool.go, scripts/ux-smoke.sh
Join failures prefer UserSummary and fall back to Message. Missing join codes now return usage guidance. No-healthy-route errors include gateway and network guidance. UX smoke tests cover the updated error paths.

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

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: improving novice-facing error messages and adding automated smoke coverage.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/40-novice-error-paths

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 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.

🧹 Nitpick comments (1)
scripts/ux-smoke.sh (1)

162-166: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Assert the gateway user_summary, not a generic keyword.

Line 163 accepts any output containing invalid or no longer active. The terse protocol message can contain the same text, so this test passes even if NewJoinSessionResponseError stops selecting UserSummary. Configure distinct message and user_summary values in the fixture, then assert the exact user_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

📥 Commits

Reviewing files that changed from the base of the PR and between 5398c23 and b3bb543.

📒 Files selected for processing (4)
  • internal/hostcmd/exitcode.go
  • internal/hostcmd/hostcmd.go
  • internal/hostcmd/route_pool.go
  • scripts/ux-smoke.sh

@EitanWong EitanWong changed the title fix: make novice error paths human-readable, gated by smoke fix: humanize novice error paths, gated by automated smoke Aug 4, 2026
@EitanWong EitanWong changed the title fix: humanize novice error paths, gated by automated smoke fix: improve novice error messages, gated by automated smoke Aug 4, 2026
@EitanWong
EitanWong merged commit 098e7b8 into main Aug 4, 2026
7 of 10 checks passed
@EitanWong
EitanWong deleted the fix/40-novice-error-paths branch August 4, 2026 06: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