Skip to content

fix(cli): reject unknown profile use instead of poisoning the default - #367

Merged
ankitranjan7 merged 1 commit into
mainfrom
fix/profile-use-membership
Aug 19, 2026
Merged

fix(cli): reject unknown profile use instead of poisoning the default#367
ankitranjan7 merged 1 commit into
mainfrom
fix/profile-use-membership

Conversation

@ankitranjan7

Copy link
Copy Markdown
Contributor

webcmd profile use __audit_nope__ wrote that string as the default Cloak profile and exited 0. Later browser commands then ran against a profile that does not exist.

After

$ webcmd profile use __audit_nope__
# stderr, exit 2
ok: false
error:
  code: ARGUMENT
  message: No profile matches "__audit_nope__". Valid profiles: work, ctx_live
  help: |
    usage: webcmd profile use <alias|contextId>
    example: webcmd profile use work

Membership is the same set profile list shows: connected daemon profiles, saved aliases, and the current default. A saved alias still works when the daemon is down. Unknown names no longer persist.

Hosted impact

Hosted impact: A — no hosted impact
Trigger: none
Why: local Cloak `profile use` only. Hosted already rejects use/rename and exposes list/delete via /v1/profiles.
Sequencing: none

Verification

  • npx tsc --noEmit — clean
  • npx vitest run --project unit src/browser/profile.test.ts src/cli.test.ts — 146 passed

profile use now checks membership against the same set as profile list
and exits 2 with the valid aliases and contextIds enumerated.
@github-actions

Copy link
Copy Markdown
Contributor

🟠 Maintainer review suggested — low confidence

The automated review could not reach a fully supported conclusion.

Limitations

  • The automated review returned an invalid structured result.

This review is advisory and does not block merging.

@ankitranjan7
ankitranjan7 merged commit 2419b01 into main Aug 19, 2026
53 of 54 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant