You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug] Tool approval Yes/No selector is interactive before the formatter preview has loaded, allowing blind approval #1407
The tool-approval confirmation screen shows a "Loading preview..." message while the tool's formatter builds its preview asynchronously, but the Yes/No StyledSelectInput underneath is gated only on !hasFormatterError, not on !isLoadingPreview. Both error flags default to false and only flip after the formatter settles, so the approval list is mounted, focused, and accepting input with "Yes, execute this tool" pre-highlighted as the default for the entire time "Loading preview..." is on screen.
Trigger a tool call whose formatter preview takes a moment to build (e.g. one that reads/diffs a large file, or is momentarily slow under load).
While "Loading preview..." is still visible, press Enter.
Expected Behavior
The Yes/No selector should not accept input (or should not be visible/focused) until the actual preview has rendered, so the user can't approve a tool call blind to what it will do.
Actual Behavior
Enter is accepted immediately and executes the tool via the default-highlighted "Yes, execute this tool" option, even though nothing about the tool call has been shown yet.
Root Cause
source/components/tool-confirmation.tsx:174-210:
{isLoadingPreview&&(<BoxmarginBottom={1}><Textcolor={colors.secondary}>Loading preview...</Text></Box>)}{formatterPreview&&!isLoadingPreview&&( ... )}{/* Show the approval prompt unless a formatter crash already auto-cancelled the call. */}{!hasFormatterError&&(<><BoxmarginBottom={1}><Textcolor={colors.tool}>Do you want to execute ...?</Text></Box><StyledSelectInputitems={options}onSelect={handleSelect}/>
...
isLoadingPreview (line 40) has no bearing on the !hasFormatterError condition gating the select input the two states are independent, so the approval list renders regardless of whether the preview has actually loaded.
Suggested Fix
Gate the approval block on !hasFormatterError && !isLoadingPreview so the Yes/No selector only becomes interactive once the preview has actually rendered.
Additional Context
I have searched existing issues to ensure this is not a duplicate
I can reproduce this issue consistently (verified by direct code trace against current main: the JSX conditions are unambiguous a live clip needs an artificially slow formatter to demonstrate cleanly)
Activity
addyCooks commentedon Sep 20, 2026
Hi @akramcodez,
I’ve been looking into this,
could you assign it to me?
awhite0030 commentedon Sep 21, 2026
AniketR10 commentedon Oct 16, 2026
@akramcodez would like to work on this pelase assign
puri-adityakumar commentedon Oct 19, 2026
@addyCooks Please assign this to me