fix: align headless interactive tool behavior with bidirectional parity (#894)
This commit is contained in:
@@ -161,9 +161,16 @@ export function SlashCommandAutocomplete({
|
||||
|
||||
// Manually manage active state to include the "no matches" case
|
||||
useLayoutEffect(() => {
|
||||
const isActive = matches.length > 0;
|
||||
const queryLength = queryInfo?.query.length ?? 0;
|
||||
const isActive =
|
||||
!hideAutocomplete && (matches.length > 0 || queryLength > 0);
|
||||
onActiveChange?.(isActive);
|
||||
}, [matches.length, showNoMatches, onActiveChange]);
|
||||
}, [
|
||||
hideAutocomplete,
|
||||
matches.length,
|
||||
onActiveChange,
|
||||
queryInfo?.query.length,
|
||||
]);
|
||||
|
||||
// Don't show if input doesn't start with "/"
|
||||
if (!currentInput.startsWith("/")) {
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
* Centralizes tool name remapping logic used across the UI.
|
||||
*/
|
||||
|
||||
import { isInteractiveApprovalTool } from "../../tools/interactivePolicy";
|
||||
|
||||
/**
|
||||
* Maps internal tool names to user-friendly display names.
|
||||
* Handles multiple tool naming conventions:
|
||||
@@ -132,11 +134,7 @@ export function isFancyUITool(name: string): boolean {
|
||||
* Other tools (bash, file edits) should respect yolo mode and auto-approve.
|
||||
*/
|
||||
export function alwaysRequiresUserInput(name: string): boolean {
|
||||
return (
|
||||
name === "AskUserQuestion" ||
|
||||
name === "EnterPlanMode" ||
|
||||
name === "ExitPlanMode"
|
||||
);
|
||||
return isInteractiveApprovalTool(name);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user