Skip to content

fix(app)!: name herdr as down instead of blaming the connection - #167

Merged
keinstn merged 1 commit into
mainfrom
fix/herdr-server-unreachable
Aug 12, 2026
Merged

fix(app)!: name herdr as down instead of blaming the connection#167
keinstn merged 1 commit into
mainfrom
fix/herdr-server-unreachable

Conversation

@keinstn

@keinstn keinstn commented Aug 12, 2026

Copy link
Copy Markdown
Owner

Closes #160.

What was wrong

When herdr's background server isn't running on the host, herdr agent list fails — but SSH is fine. drover surfaced that as a raw technical string, and on herdr 0.7.x that string was Error: Os { code: 61, kind: ConnectionRefused, ... } — the same errno and wording dartssh2 raises for a failed TCP connect. Users reasonably concluded the network or SSH was broken when it wasn't.

What changed

Verified against herdr 0.8.0 (HERDR_SOCKET_PATH=/tmp/nope.sock herdr agent list): the server-down case returns exit 1 with an empty stdout and a server_not_running error envelope on stderr. HerdrClient._exec already probes both channels, so herdr_client.dart is unchanged — the only gap was classification.

  • AppErrorKind.herdrServerUnreachable, matched on HerdrException.code == 'server_not_running' before any cause inspection, so the cause != null -> hostConnection fallback can't shadow it.
  • New localized copy (en/ja) that states the host was reached and herdr is what's down — deliberately not confusable with errorHostConnection / errorHostConnectionLost. The raw herdr message stays available in the Details expander via the existing errorDetail path.
  • No parsing of raw Rust Error: Os { ... } output anywhere.

Minimum herdr version raised to 0.8.0

This is a deliberate diagnosability floor, not a command-shape requirement — on 0.7.x every drover command still works, it just reports a server-down host with the misleading string above. Requested explicitly; docs/, site/support/ and the demo backend's self-reported version all moved with it.

⚠️ docs/app-store-submission.md holds the App Store listing copy. This PR updates the file, but the live App Store Connect description still says "Herdr 0.7.5 or newer" and needs the same edit at the next submission.

Verification

  • fvm flutter analyze --no-pub — clean
  • fvm flutter test --no-pub796 tests, all passing (full suite)
  • New tests: server_not_running classification with and without a cause; the headline is distinct from both host-connection strings; the real exit-1/stderr envelope shape surfaces the right code; the version-floor tests updated for the bump.

Review notes

/code-review caught three real defects in the first draft, all fixed here: the docs note and the new client test claimed the envelope arrives on stdout (it's stderr — re-verified live), the new strings used backticks that render literally in a plain Text widget, and the version-bump rationale overstated its own necessity in both the code comment and the public support page.

🤖 Generated with Claude Code

When herdr's background server isn't running on the host, herdr 0.8.0
returns a `server_not_running` error envelope on stderr with exit 1.
`HerdrClient._exec` already parsed that envelope, but `classifyError`
routed the resulting `HerdrException` to `AppErrorKind.unknown`, which
renders the raw technical string as the headline. On herdr 0.7.x the same
failure printed a bare `Error: Os { code: 61, kind: ConnectionRefused,
... }`, which reads exactly like the SSH-level refusal dartssh2 raises for
a failed TCP connect — so users diagnosed a network problem that did not
exist while SSH was in fact fine.

Classify `server_not_running` into a new `AppErrorKind.herdrServerUnreachable`
before any `cause` inspection, and give it copy that says the host was
reached and herdr is what is down. `HerdrClient` itself is unchanged.

Raise `kMinHerdrVersion` to 0.8.0: this diagnosis only exists from 0.8.0,
and drover deliberately does not parse the older bare Rust error string.
Docs and the support page state the new floor.

Closes #160

BREAKING CHANGE: hosts running herdr 0.7.x are no longer supported. drover
shows its version warning and blocks launching agents on them; update herdr
on the host to 0.8.0 or newer.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@keinstn
keinstn merged commit 4ecab59 into main Aug 12, 2026
3 checks passed
@keinstn
keinstn deleted the fix/herdr-server-unreachable branch August 12, 2026 22:52
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.

fix(app): distinguish 'herdr server unreachable' from SSH connection failure in error messages

1 participant