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): item-envelope detail decode + provision-timeout orphan guidance
Two bugs from the live durability sweep.
BUG 1 (silent): `instant resource <token>` printed an all-empty object.
runResourceDetail only unwrapped a bare object or a `"resource"` envelope,
but prod GET /api/v1/resources/:token wraps the object under `"item"`
({"item":{...},"ok":true}) — neither branch matched, so every field but the
path-token fallback rendered empty with exit 0. Teach the decoder the "item"
key (preferred), keeping "resource" + bare-object fallbacks for back-compat.
BUG 2 (durability UX): on a provision timeout the CLI exited 1 with a bare
"context deadline exceeded" — but provisioning is synchronous server-side, so
the resource may have already landed as an orphan the user can't see. The 60s
default timeout is intentional (TestBugHunt_T16_P2_2) and unchanged; instead,
detect the client/context-deadline timeout in provisionResource and surface
actionable recovery guidance (run `instant resources` / `instant resource
delete <token> --yes`) via a named const, preserving the cause with %w.
Tests: TestRunResourceDetail_ItemEnvelopeRenders (decodes {"item":{...}} and
asserts fields render), TestProvisionTimeout_SurfacesOrphanGuidance (forces a
real client timeout, asserts the guidance). Both proven red-without-fix /
green-with-fix. Gate green: go build/vet/test -short, gofmt, golangci-lint 0.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* test(cli): pin every isTimeoutErr branch for 100% patch coverage
The diff-cover gate flagged cmd/monitor.go 297-298 (nil-error guard) and
304-305 (net.Error Timeout()==true branch) as uncovered: the existing
provision-timeout regression test only reaches the errors.Is(DeadlineExceeded)
path because http.Client.Timeout errors match DeadlineExceeded first.
Add TestIsTimeoutErr — a table-driven unit test with a synthetic net.Error
(fakeNetTimeoutErr, message via named const) covering nil, bare/wrapped
DeadlineExceeded, bare/wrapped timeout net.Error, non-timeout net.Error,
and plain errors. isTimeoutErr is now 100% covered.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments