spawn/shared
Ahmed Abushagur 999751537d
fix: validate saved tokens + handle FlyV1 auth scheme (#1386)
* fix: validate saved API tokens before use

Tokens loaded from config files (e.g. ~/.config/spawn/fly.json) were
never validated, so expired or revoked tokens would silently pass through
and only fail at the point of use (e.g. app creation). Now the provider's
test function runs on config-file tokens too, falling through to a fresh
prompt if validation fails.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: handle FlyV1 token auth scheme for Fly.io Machines API

Fly.io dashboard tokens use the format "FlyV1 fm2_..." where "FlyV1" is
the authorization scheme itself, not a Bearer token prefix. The script was
always sending "Authorization: Bearer FlyV1 fm2_..." which the API rejects
with "token validation error". Now detects FlyV1-prefixed tokens and sends
them as "Authorization: FlyV1 fm2_..." using custom auth headers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* fix: make refactor service actually run reliably

Three fixes for the refactor workflow that was producing zero PRs:

1. community-coordinator: Gemini → Sonnet — Gemini doesn't support
   the Task tool, causing a respawn on every single cycle

2. Monitoring loop: replace "sleep 5" (which drifted to sleep 30)
   with explicit short-sleep instructions and CRITICAL rule that
   every turn must include a tool call to stay alive

3. Lifecycle management: explicit shutdown sequence with retry,
   preventing early exit that orphans teammates

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-17 04:31:46 -05:00
..
common.sh fix: validate saved tokens + handle FlyV1 auth scheme (#1386) 2026-02-17 04:31:46 -05:00
github-auth.sh refactor: decompose ensure_jq and ensure_gh_cli into focused helpers (#994) 2026-02-13 12:14:56 -08:00
key-request.sh fix: HIGH severity security issues (command injection + weak VNC password) (#1150) 2026-02-14 20:39:48 -05:00