fix: align headless interactive tool behavior with bidirectional parity (#894)

This commit is contained in:
Charles Packer
2026-02-10 15:20:37 -08:00
committed by GitHub
parent bfd9a1ec56
commit b0783ef195
8 changed files with 178 additions and 37 deletions

View File

@@ -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("/")) {

View File

@@ -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);
}
/**