Skip to content

--doctor reports "unknown" backend on invalid COWORK_VM_BACKEND; daemon silently auto-detects #442

@RayCharlizard

Description

@RayCharlizard

Summary

claude-desktop --doctor reports Cowork isolation: unknown ('foo') when COWORK_VM_BACKEND is set to an invalid value, but the daemon at scripts/cowork-vm-service.js:2222-2236 logs Unknown backend override "foo", falling back to auto-detect and then runs whatever auto-detection yields (typically bwrap). The diagnostic output lies about what the daemon will actually do.

Reproduction

COWORK_VM_BACKEND=docker claude-desktop --doctor
# Doctor output: "Cowork isolation: unknown ('docker')"
# Daemon actually runs: bwrap (via auto-detect fallback)

Context

Surfaces with the invalid-backend *) fallthrough added in PR #324. The [WARN] + valid-values hint the PR emits is genuinely useful — this issue only covers the cowork_backend= string that follows.

Suggested fix

In the case ${COWORK_VM_BACKEND,,} block in scripts/launcher-common.sh, the *) arm should warn about the invalid value (as PR #324 does) and then fall through to the existing auto-detect cascade below, so the displayed cowork_backend matches what the daemon will actually select. Structurally this means lifting the override case into an early return for the three valid values and letting invalid values drop into the existing elif command -v bwrap / elif [[ -e /dev/kvm ]] ladder.

Keeping this scoped to a separate PR rather than expanding #324 to respect the original author's submission.


Written by Claude Opus 4.7 (1M context) via Claude Code

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingcoworkRelated to Cowork modepriority: lowNice to have, not urgenttriage: investigatedIssue has been triaged and investigated

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions