Skip to content

fix(pilot): health check must send the token (#14 half-broken)#245

Merged
AVADSA25 merged 1 commit into
mainfrom
claude/fix-pilot
Jul 13, 2026
Merged

fix(pilot): health check must send the token (#14 half-broken)#245
AVADSA25 merged 1 commit into
mainfrom
claude/fix-pilot

Conversation

@AVADSA25

Copy link
Copy Markdown
Owner

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.

…" 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
AVADSA25 merged commit dae1ab5 into main Jul 13, 2026
1 check passed
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>
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.

2 participants