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
{{ message }}
Repository navigation
routine update: false NETWORK_ERROR — update response returns routine as an array #6
hevycli routine update <id> --file r.json exits non-zero with a misleading error even when the update succeeds server-side:
failed to update routine: NETWORK_ERROR: failed to update routine: json: cannot unmarshal array into Go struct field RoutineResponse.routine of type api.Routine
Cause
The Hevy API's PUT /v1/routines/{routineId} response wraps the routine in an array:
while RoutineResponse.routine is typed as a single api.Routine, so unmarshalling fails after the write has already been applied.
Repro
hevycli routine get <id> -o json > r.json, reshape to the update format {"routine": {...}}
hevycli routine update <id> --file r.json
Observe the NETWORK_ERROR — then routine get <id> shows the update was applied.
Verified on v0.3.0 (Homebrew cask, macOS arm64).
Impact
Scripts can't trust the exit code for updates — success is indistinguishable from failure without a follow-up get. A union/array-tolerant unmarshal (or decoding into []api.Routine for this endpoint) would fix it.
Thanks for the tool — it's genuinely useful for driving Hevy from scripts/agents.
Activity