molecule-core/workspace-server/internal/provisioner
Hongming Wang e502003c74 fix(workspace-server): IsRunning surfaces non-2xx + JSON errors
Pre-existing silent-failure path: IsRunning decoded CP responses
regardless of HTTP status, so a CP 500 → empty body → State="" →
returned (false, nil). The sweeper couldn't distinguish "workspace
stopped" from "CP broken" and would leave a dead row in place.

## Fix

  - Non-2xx → wrapped error, does NOT echo body (CP 5xx bodies may
    contain echoed headers; leaking into logs would expose bearer)
  - JSON decode error → wrapped error
  - Transport error → now wrapped with "cp provisioner: status:"
    prefix for easier log grepping

## Tests

+7 cases (5-status table + malformed JSON + existing transport).
IsRunning coverage 100%; overall cp_provisioner at 98%.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 08:47:55 -07:00
..
cp_provisioner_test.go fix(workspace-server): IsRunning surfaces non-2xx + JSON errors 2026-04-20 08:47:55 -07:00
cp_provisioner.go fix(workspace-server): IsRunning surfaces non-2xx + JSON errors 2026-04-20 08:47:55 -07:00
isrunning_test.go chore: open-source restructure — rename dirs, remove internal files, scrub secrets 2026-04-18 00:24:44 -07:00
provisioner_test.go chore: final open-source cleanup — binary, stale paths, private refs 2026-04-18 00:38:55 -07:00
provisioner.go chore: final open-source cleanup — binary, stale paths, private refs 2026-04-18 00:38:55 -07:00