fix(onboarding): probe claude-session via filesystem, not a worker-image container (closes #37) #40
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/onboarding"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes #37 — onboarding blocking on the credentials step when the worker image is missing or tagged differently than the
worker_imagesetting.The
needs-claude-sessionphase was gated byprobeClaudeSession, which spun up an ephemeral container from the configured worker image just totest -ftwo files on theclaude-sessionvolume. If that image wasn't present locally under the exact configured tag,docker.createContainerthrewno such image: …, the error was swallowed into an opaqueprobe error: …hint, and the phase stuck atneeds-claude-sessionforever — even though the real problem had nothing to do with credentials.Nexus already bind-mounts the whole
claude-sessionvolume at/shared-config(SHARED_CONFIG_DIR=/shared-config/dot-claude), so the probe can read the two files directly off its own filesystem. This decouples claude-session bootstrap from the worker image entirely.Changes
nexus/src/lib/server/workers/session-probe.ts— rewrite tofs.stat${SHARED_CONFIG_DIR}/.credentials.jsonand${SHARED_CONFIG_DIR}/../account.json. New signatureprobeClaudeSession(config); removed the worker-image container, thedocker/dbparams, the in-memory cache +TTL_MS, theopts.forceflag, and theinvalidateProbeexport. Behavior-preserving (existence-only). Distinct hints for volume not mounted vs files missing.nexus/src/routes/api/state/+server.ts&.../claude-session/recheck/+server.ts— updated the two call sites; dropped now-unused imports.nexus/src/lib/server/workers/session-probe.test.ts— new unit test (the probe was previously untestable without real Docker): both-present → ok; each file missing → bootstrap hint; volume root absent → not-mounted hint.Design spec + implementation plan are included under
docs/superpowers/specs/anddocs/superpowers/plans/.Follow-up (not in this PR): #38 tracks pull-on-demand of the worker image at spawn time with SSE progress in the create UI — the only place the worker image still needs to be present.
Test Plan
pnpm test— 536/536 pass (includes 4 newsession-probetests)pnpm typecheck— cleanpnpm lint— only 2 pre-existingscripts/gen-migrations.mjserrors (untouched by this change)