mirror of
https://github.com/qwibitai/nanoclaw.git
synced 2026-06-12 18:11:51 +08:00
0435736314
The not-signed-in message hardcoded both a local and a hosted OneCLI dashboard URL because the container can't tell which gateway it's behind. But the gateway already tells us: a credential-less proxied request comes back with the right URL in its error body — - credential_not_found → secret_url (pre-filled "new secret" form) - access_restricted → manage_url (grant this agent access) - app_not_connected → connect_url Capture whoami's body + status (drop -f so the JSON survives the 401), extract that URL, and present it. It's always the correct gateway, local or hosted, with zero extra wiring. The secret_url's pre-filled `path` defaults to the failing request path (/api/whoami-v2), so broaden it to /* — otherwise the created secret wouldn't cover the upload endpoints. Falls back to generic text when there's no gateway JSON to read. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>