You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cli): creds-recovery verb, webhook URL print, env-token 401 advice, full token in list (#33)
Four agent-DX follow-ups found in a live cohort dogfood (round 2, building on #32):
F1 (P0): add `instant resource creds <token>` (alias `credentials`) — GETs
/api/v1/resources/:id/credentials and prints the connection_url (webhook
receive_url fallback; --json for the full response). Closes the broken
first-provision recovery loop: `db new` frequently hits the 60s client
timeout and the URL — printed only by `new` — was otherwise lost forever.
Path fragment is the named const resourceCredsSuffix.
F2 (P1): `webhook new` printed a blank `url` line — the human path read
creds.ConnectionURL only, but /webhook/new returns receive_url. Fall back
to ReceiveURL like the local token-store code already does. (--json already
emits receive_url via emitProvisionJSON; verified.)
F3 (P1): a 401 with INSTANT_TOKEN set advised `instant login`, which is
useless — the env var SHADOWS any saved login. errSessionExpired() +
classifyError() now branch on token SOURCE (new authFromEnvToken helper):
an env-sourced reject tells the user to fix/unset INSTANT_TOKEN. This also
fixes the dead session_expired JSON code (a 401 was mis-coded auth_required
because errSessionExpired carries ExitAuthRequired).
F4 (P2): `instant resources` truncated the token (`d3cef90f-a75…`) — the
exact value every other command needs as an argument, so it was
un-copyable. Print the FULL token; truncate the NAME column instead
(new truncateName + nameDisplayMaxLen). --json unchanged.
Tests: cmd/agent_dx_followups_test.go covers all four (creds happy/alias/json/
webhook-fallback/unauth/missing-token/empty/parse/server-error + token
fallback; webhook receive_url human+json; env-vs-saved 401 advice + json
action + flag-over-env; full-token + name-truncation + truncateName unit).
100%-patch on the diff; make ci green (build+vet+race+lint).
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
0 commit comments