Skip to content

fix(tsmd): report why Touch ID is unavailable instead of "Authenticat… - #24

Merged
tashian merged 2 commits into
mainfrom
fix/touchid-unavailable-reason
Oct 3, 2026
Merged

tashian merged 2 commits into
mainfrom
fix/touchid-unavailable-reason

Conversation

@tashian

@tashian tashian commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

When LAContext.canEvaluatePolicy fails, macOS does not show a Touch ID prompt. Before this change, tsmd returned the same error as a failed prompt (-32002, "Authentication required"), and the CLI told the user to use Touch ID.

One cause: a Magic Keyboard with Touch ID loses its pairing with the Mac while the lid is closed. macOS returns systemCancel, and its debug text says only "Touch ID is not available in closed clamshell mode." The closed lid is not the cause. A paired keyboard works with the lid closed. To pair the keyboard again, connect it with a USB cable.

This change adds VaultError.authUnavailable(reason) and RPC error -32004. TouchIDAuth gets the reason from the LAError: lockout, no fingerprints enrolled, or no login password. For other errors, it uses the debug text. For the clamshell text, it adds the instruction to pair the keyboard again. The CLI says that no prompt was shown. The credential-usage skill tells the agent not to try again.

Related: #25 (password fallback as an unlock policy setting).

…ion required"

When LAContext.canEvaluatePolicy fails, no Touch ID prompt is shown, but
tsmd returned the same -32002 "Authentication required" as a failed or
canceled prompt, and the CLI told the user to authenticate via Touch ID.
With the lid closed and no Touch ID keyboard, macOS returns systemCancel
and puts the cause only in the debug description, so the user saw no
dialog and no reason.

Add VaultError.authUnavailable(reason) and RPC error -32004. TouchIDAuth
derives the reason from the LAError (lockout, not enrolled, no password,
otherwise the debug description). The CLI says no prompt was shown and
how to make Touch ID available. The credential-usage skill tells the
agent not to retry.
macOS reports "Touch ID is not available in closed clamshell mode" when
a Magic Keyboard with Touch ID loses its pairing while the lid is
closed. A paired keyboard works with the lid closed, so the lid is not
the cause. Connecting the keyboard with a USB cable pairs it again.

- tsmd adds the pairing fix to the clamshell reason and does not repeat
  "Touch ID is not available" when macOS already says it.
- The CLI hint for -32004 no longer names a cause. The daemon's reason
  carries the fix (lockout, enrollment, or pairing).
- The credential-usage skill names the pairing cause and matches on
  "No Touch ID prompt was shown" or code -32004, not on a prefix that
  the lockout and enrollment messages do not have.
@tashian
tashian merged commit 0915cb9 into main Oct 3, 2026
1 check 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