fix(pilot): health check must send the token (#14 half-broken)#245
Merged
Conversation
…" symptom Root cause (systematic debugging): Pilot appeared dead — every teach/replay/ navigate command returned "Pilot Runner is not running" even though the pilot-runner was ONLINE and healthy. The runner requires x-pilot-token on EVERY endpoint, /health included (verified: 401 without the token, 200 with). But _pilot_up() sent no header, so it always got 401 → returned False → run() short-circuited to the "not running" branch before doing anything. Fix: _pilot_up() now sends x-pilot-token like _get/_post do. One-line cause, one-line fix — confirmed by curling /health with and without the token first. Also stripped all pictographic emoji from pilot's user-facing output (⏳⚠️ 📄📊📋📸🤖 → gone; no-emoji rule). Kept typographic → ─ │ framing. Verified END TO END against the live pilot-runner: _pilot_up() → True; "pilot status" → "Pilot Runner online"; "pilot navigate https://example.com" → "Navigated to https://example.com" (all previously "not running"). 5 new tests (token sent, fail-closed on 401/outage, no-emoji guard). D-1 manifest regenerated. Live-test (#14): "pilot navigate https://example.com" then "pilot snapshot" now work; teach/replay a task and replay it — the runner is reachable again. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
AVADSA25
added a commit
that referenced
this pull request
Jul 14, 2026
…k/run (beat 14) (#251) The Pilot tab's _pilotFetch() bypasses the global fetch wrapper (that wrapper E2E-encrypts POST bodies → runner 422), but in doing so it dropped the x-csrf-token header the dashboard AuthMiddleware requires on every POST/PUT/ DELETE. Result: every Pilot ACTION (navigate, click, type, record, start-run, all HITL controls) 403'd, while GETs (status, live stream, snapshots) passed — the exact "half-broken, nothing happens when I click Go" symptom. Worse, pilotNavigate() never checked r.ok and showed a false "Navigated" toast on the 403, so it failed silently. Fix: add ONLY the x-csrf-token header in _pilotFetch (keep the body plain JSON to avoid the 422), and make pilotNavigate surface real failures. The runner and the /api/pilot proxy were both fine. Separate path from #245 (that was x-pilot-token to the runner on the chat/voice path). Co-authored-by: Mickael Farina <farina.mickael@gmail.com> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pilot appeared dead — every command returned 'Pilot Runner is not running' though the runner was online. Root cause: the runner requires x-pilot-token on /health (401 without, 200 with), but _pilot_up() sent no token → always False. Fixed (send the token), verified end-to-end against the live service (navigate works now). Also stripped pictographic emoji. 5 tests.