Skip AgentTips with unresolved keybinding placeholders#9509
Draft
MaggieShan wants to merge 1 commit intomasterfrom
Draft
Skip AgentTips with unresolved keybinding placeholders#9509MaggieShan wants to merge 1 commit intomasterfrom
MaggieShan wants to merge 1 commit intomasterfrom
Conversation
When a tip's description contains '<keybinding>' but no keybinding is configured (e.g. voice mode tip with voice_input_toggle_key == None), is_tip_applicable now returns false so the raw '<keybinding>' string is never shown to users. This specifically fixes the voice tip: it is added to the tips pool whenever voice input is enabled, but the keybinding is only set after the user first interacts with voice. Previously the tip could be selected and displayed with the literal text '<keybinding>'. Now it is filtered out at refresh time until a toggle key is configured. The same guard also protects all other keybinding-based tips in case a user has unbound the corresponding action. Co-Authored-By: Oz <oz-agent@warp.dev>
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.
Description
When an
AgentTipdescription contains<keybinding>but no keybinding is actually configured, the tip would be selected and shown with the literal text<keybinding>in the UI (e.g. "Hold to speak your prompt directly to the agent.").This was specifically a problem for the voice mode tip: it is added to the tips pool whenever voice input is enabled, but the
voice_input_toggle_keysetting defaults toNoneand is only set after the user first interacts with the voice button (maybe_setup_first_time_voice).Fix: Added a check in
AgentTip::is_tip_applicablethat returnsfalsefor any tip whose description contains the<keybinding>placeholder but has no resolved keybinding. This ensures such tips are filtered out duringmaybe_refresh_tipand never displayed with the raw placeholder string.The same guard also protects all other keybinding-based tips (e.g. toggle input mode, command palette, select previous block, etc.) in case a user has unbound the corresponding action.
Testing
The fix is in
is_tip_applicable, which is called every timemaybe_refresh_tipfilters the tip pool. The voice tip (and any other tip with an unresolvable<keybinding>) will now simply be absent from the pool of candidates until the keybinding is configured. Verified by reading through the full keybinding resolution path (keystroke()→VoiceInputToggleKey::keystroke()→ returnsNoneforVoiceInputToggleKey::None).No automated tests added — existing test coverage for
is_tip_applicableis limited; the logic is straightforward and the path is exercised by the existing tip selection flow.Agent Mode
CHANGELOG-BUG-FIX: Fixed AgentTips showing literal
<keybinding>when no keybinding is configured (e.g. voice tip before first voice interaction).Conversation: https://staging.warp.dev/conversation/02fcb9e5-14d7-4b23-8675-3371b438424a
Run: https://oz.staging.warp.dev/runs/019ddb4b-b9f1-7e83-9f49-eb9874ebd766
This PR was generated with Oz.