Skip to content

Support accessibility-mode model-switch confirmations #670

Description

@gtapps

Context

Follow-up from the review of #669.

The cached-context /model confirmation path in plugins/claude-code-hermit/scripts/stop-pipeline.ts recognizes the graphical choice prompt and sends a bare Enter, relying on the selected Yes option.

Claude Code also supports an accessibility confirmation UI when started with --ax-screen-reader or CLAUDE_CODE_ACCESSIBILITY. The reported prompt requires an explicit y or n; sending only Enter can leave the pane at Please answer y or n.

Current failure mode

  • drainHarnessCommand() clears the pending-command marker immediately after delivering /model.
  • isModelSwitchConfirmation() can still match the accessibility prompt text.
  • The confirmation path calls sendEnter() and logs the switch as confirmed when tmux accepts the key, without verifying that Claude Code accepted the choice.
  • In accessibility mode, the session can therefore remain stalled with no marker left to retry.

Acceptance criteria

  • Detect the accessibility confirmation variant separately from the graphical choice widget.
  • Submit an explicit y for that variant while preserving Enter for the graphical default-selection prompt.
  • Do not report a confirmed model switch merely because tmux accepted the confirmation keystroke.
  • Preserve a bounded retry or recovery path when confirmation is not accepted.
  • Add regression coverage for both graphical and accessibility confirmation flows.
  • Empirically verify the accessibility flow against a real Claude Code session before closing.

This is a deferred compatibility follow-up and is not intended to block #669.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions