Repository navigation
fix(cli): say doctor auth --fix has nothing to repair in an open space's root - #7113
Merged
davidfarah-dev merged 1 commit intoNov 17, 2026
Merged
Conversation
…e's root doctor auth already reported an open space's root as a no-op, but --fix skipped that check and refused AUTH_REQUIRED with a next step that named the command that had just failed. Run the check for --fix too: an open space issues no credentials, so the repair is requested and not attempted, and the result is a no-op (exit 0). Fixes Cotal-AI#7092
Contributor
|
Thanks. I reproduced the refusal on 0.165.1 ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #7092. In the root of a space registered as open,
cotal doctor authis a no-op, butcotal doctor auth --fixrefused withAUTH_REQUIRED, and its next step named the command that had just failed.Problem
In the root of an open space (
cotal up --open),cotal doctor auth --space sp2reports "No credentials to check" and exits 0.cotal doctor auth --space sp2 --fixin the same folder refuses:(exit 2). The user is already in that root, so following the step gives the same refusal again. The two runs differ only in the flag.
Root cause
In
implementations/cli/src/commands/doctor.ts, the open-space check is skipped when--fixis passed:With
openundefined,--fixfalls through to thevalues.fix || values.spacerefusal. The skip came in with the check itself in 2f76fd7 ("say doctor auth has nothing to check in an open space's root"). That commit, its changeset, its docs and #4538, which merged it, only describe the plain diagnosis and give no reason to keep--fixout.Fix
Run the open-space check for
--fixas well. On an open space,--fixnow returns the same no-op report and exits 0, withrepair.requested: trueandrepair.attempted: falsein the JSON.A no-op is the right result here. An open space issues no credentials, so
--fixhas nothing to re-sign or migrate, and on a static space--fixwith nothing to repair is already reported as a no-op (noOp: values.fix === true && !repair.attempted && ...). The check itself is unchanged:recordedOpenSpaceresolves read-only and returns a space only when its registration saysmode: "open"and this folder is its registered root. Missing signing trust is still not read as an open space, and--fixin a folder with no space, or for a space whose trust this root does not hold, still refuses as before.docs/cli-auth.mdxnow says the open-space no-op holds with or without--fix. There is also a@cotal-ai/clipatch changeset.Testing
implementations/cli/smoke/no-space-next.smoke.ts(broker-free). In the root of a space registered as open, it runsdoctor auth --fix --jsonwith and without--space. Each run must be ano-opthat names the space, has theopen-spacescope, has repair requested and not attempted, and exits 0.pnpm smoke:no-space-next, exit 1): the first--fixrun throws the issue's refusal,CommandFailure: no validated signing trust for the named local diagnostic scope is present; no open mode or broader authority was inferred(code: 'AUTH_REQUIRED', remedyrun `cotal doctor auth --fix` in a space's root folder; `cotal space` lists each space's root).COTAL_SMOKE_SENTINEL cells=40 passed=40 failed=0(30 before).COTAL_HOME, an open registration forsp2, and the CLI rebuilt, I rantsx bin/cotal.ts doctor auth --space sp2 --fixin that root. Before the fix it printed the refusal above (exit 2). After the fix it printed "No credentials to check ... Mode: open, as registered" (exit 0).--jsongives"outcome":"no-op"with"repair":{"requested":true,"attempted":false,...}.pnpm --filter @cotal-ai/cli typecheck(source and smoke tree),pnpm check:docs-voice,pnpm check:docs-literalsandpnpm changeset status --since=upstream/mainpass.pnpm smoke:cigate (it needsnats-server).