Correct a model the Autohand cloud gateway cannot serve back to Fantail - #586
Merged
Conversation
…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.
…import during setup
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.
…Enter inserts a newline in iTerm2
…import their data during setup
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.
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.
Summary
Fixes #584. A model left over from another provider (the report shows
anthropic/claude-5-sonnet) could stay selected under theautohandaiprovider.auto,fantail, ormoa".Change
resolveAutohandAIModelForTiernow resolves everyautohandaicloud selection to the model the gateway will actually serve (auto,fantail,moa; anautohandai/prefix is stripped), then applies the existing free-tier Moa → Fantail rule on top. Local plans and other providers still pass through.normalizeAutohandAIStartupModelapplies that policy as soon as the CLI loads its config, in interactive, auto-mode and patch flows, and corrects a--modeloverride the same way. The entitlement refresh keeps persisting the correction, as before.resolveAutohandAICloudModelis 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/moa→moa, Moa left alone at startup (tier unknown), other providers and local plans untouchedanthropic/claude-5-sonnetunderautohandaistarts with(Autohand AI, fantail)and never prints the foreign modeltests/core/agent,tests/providers— 1,529 testsbun run lint,bun run typecheckbun run proofon CI