Skip to content

fix(web): edit and recover refusals reach the caller - #341

Merged
cvince merged 1 commit into
feat/portabilityfrom
claude/web-refusal-edit
Aug 28, 2026
Merged

fix(web): edit and recover refusals reach the caller#341
cvince merged 1 commit into
feat/portabilityfrom
claude/web-refusal-edit

Conversation

@cvince

@cvince cvince commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Five more guards in the refusal class.

Neither file has an enclosing try, so these call displayErrorAndExit directly rather than throwing — the same shape editCommand already uses a few lines below its own guards for the local-key failure. Same single ending either way: terminal still gets its text, browser gets the command-error page, process still exits 1.

file refusal code
editCommand could not read keep.lock NO_KEEP_FILE
no active branch NO_ACTIVE_BRANCH
authentication failed AUTH_FAILED (with project/branch context this file already threads to the screen)
recoverCommand sign-in failed AUTH_FAILED
no organizations NO_ORGANIZATIONS (minted)

NO_ORGANIZATIONS is minted rather than reused: the account belongs to none, so re-authenticating cannot help — distinct from a permission refusal or a missing project.

Only two of recover's seven exits are here

The other five sit after if (options.web) { ... return; }, so they are unreachable under --web by construction. Converting them would change terminal-only paths for no gain. The two included run before that branch.

Also checked, per the pattern that has now bitten three times: none of the remaining files carries a stale "not reachable from argv" docblock. That class is closed at kick, org, invite.

Suite: 1851 pass, 0 fail.

Five more guards. Neither file has an enclosing try, so these call
displayErrorAndExit directly rather than throwing — the same shape editCommand
already uses a few lines below its own guards for the local-key failure. Same
single ending either way: the terminal still gets its text, the browser gets
the command-error page, the process still exits 1.

  editCommand     could not read keep.lock      NO_KEEP_FILE
                  no active branch              NO_ACTIVE_BRANCH
                  authentication failed         AUTH_FAILED (with project and
                                                branch context, which this file
                                                already threads to the screen)

  recoverCommand  sign-in failed                AUTH_FAILED
                  no organizations              NO_ORGANIZATIONS (minted: the
                                                account belongs to none, so
                                                re-authenticating cannot help —
                                                distinct from a permission
                                                refusal or a missing project)

ONLY TWO OF recoverCommand'S SEVEN EXITS ARE INCLUDED, and the reason is worth
recording. The other five sit AFTER `if (options.web) { ... return; }`, so they
are unreachable under --web by construction and converting them would change
terminal-only paths for no gain. The two here run before that branch.

Suite: 1851 pass, 0 fail.
@cvince
cvince merged commit f3e43ec into feat/portability Aug 28, 2026
2 checks passed
@cvince
cvince deleted the claude/web-refusal-edit branch August 28, 2026 21:27
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