Skip to content

Correct a model the Autohand cloud gateway cannot serve back to Fantail - #586

Merged
igorcosta merged 11 commits into
mainfrom
fix/autohandai-foreign-model
Sep 11, 2026
Merged

Correct a model the Autohand cloud gateway cannot serve back to Fantail#586
igorcosta merged 11 commits into
mainfrom
fix/autohandai-foreign-model

Conversation

@igorcosta

Copy link
Copy Markdown
Contributor

Summary

Fixes #584. A model left over from another provider (the report shows anthropic/claude-5-sonnet) could stay selected under the autohandai provider.

  • On 0.9.6 the model reached the gateway, which rejected the turn with "Use model auto, fantail, or moa".
  • On current main the request-level guard from 10631df already maps it to Fantail, but silently: the welcome banner, the status line, the session record and auto-reports still named the foreign model, which is what the issue's "Model" field shows.

Change

  • resolveAutohandAIModelForTier now resolves every autohandai cloud selection to the model the gateway will actually serve (auto, fantail, moa; an autohandai/ prefix is stripped), then applies the existing free-tier Moa → Fantail rule on top. Local plans and other providers still pass through.
  • normalizeAutohandAIStartupModel applies that policy as soon as the CLI loads its config, in interactive, auto-mode and patch flows, and corrects a --model override the same way. The entitlement refresh keeps persisting the correction, as before.
  • resolveAutohandAICloudModel is exported from the provider so the policy and the request path share one definition of "served model".

Test plan

  • tests/core/agent/AutohandAIModelTierPolicy.test.ts — foreign model → Fantail on every tier, autohandai/moamoa, Moa left alone at startup (tier unknown), other providers and local plans untouched
  • Tuistory: config with anthropic/claude-5-sonnet under autohandai starts with (Autohand AI, fantail) and never prints the foreign model
  • tests/core/agent, tests/providers — 1,529 tests
  • bun run lint, bun run typecheck
  • Full bun run proof on CI

…line in iTerm2

The composer already understood every encoded form of a shifted Enter, and Ink parses the kitty CSI u form natively, but nothing in the Ink runtime ever asked the terminal to encode modified keys: the only code that did, ProcessTerminal, has no callers. Terminals such as kitty and Ghostty send CSI u for Shift+Enter on their own, which is why the shortcut worked there and in the Tuistory harness, while iTerm2 sends a plain carriage return and Shift+Enter submitted the message.

The Ink renderer now pushes the kitty keyboard protocol's disambiguate flag when it starts and pops it when it stops. Only keys without a legacy encoding change shape, plain keys keep their bytes, and terminals without the protocol ignore the request. Ctrl+C, Esc and Shift+Tab were exercised in their encoded forms through the built CLI: they clear, cancel and cycle modes as before, and the flag is popped on exit so the shell is left in legacy mode.
Add ui.keybindingProfile to the config reference and describe the profile
table, the Claude Code and Codex remap files Autohand honours, the terminal
requirements for each newline chord, and the memories/sessions/skills import
offered during setup. The same section is added to all sixteen translated
references.
A model left over from another provider, such as anthropic/claude-5-sonnet,
could stay selected under the autohandai provider. Releases before the
request-level guard sent it to the gateway, which rejected the turn with
"Use model auto, fantail, or moa" (issue #584); newer builds silently ran
Fantail while the banner, status line, session record and error reports still
named the foreign model.

The tier policy now resolves every autohandai cloud selection to the model the
gateway will actually serve, keeping the free-tier Moa downgrade on top. The
CLI applies that policy as soon as the config is loaded, so the welcome line
and the first request agree, and the entitlement refresh persists the
correction as before.

Fixes #584.
@igorcosta
igorcosta merged commit 610601a into main Sep 11, 2026
9 of 10 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.

[Auto] session_failure: The request was malformed and could not be processed. Use model auto, `fantail

1 participant