feat: custom loading phrase when interactive shell requires input (#12535)

This commit is contained in:
Jack Wotherspoon
2025-11-21 12:19:34 -05:00
committed by GitHub
parent d72f35c2e7
commit d351f07758
13 changed files with 420 additions and 107 deletions
@@ -74,10 +74,12 @@ export function useReactToolScheduler(
MarkToolsAsSubmittedFn,
React.Dispatch<React.SetStateAction<TrackedToolCall[]>>,
CancelAllFn,
number,
] {
const [toolCallsForDisplay, setToolCallsForDisplay] = useState<
TrackedToolCall[]
>([]);
const [lastToolOutputTime, setLastToolOutputTime] = useState<number>(0);
// Store callbacks in refs to keep them up-to-date without causing re-renders.
const onCompleteRef = useRef(onComplete);
@@ -93,6 +95,7 @@ export function useReactToolScheduler(
const outputUpdateHandler: OutputUpdateHandler = useCallback(
(toolCallId, outputChunk) => {
setLastToolOutputTime(Date.now());
setToolCallsForDisplay((prevCalls) =>
prevCalls.map((tc) => {
if (tc.request.callId === toolCallId && tc.status === 'executing') {
@@ -208,6 +211,7 @@ export function useReactToolScheduler(
markToolsAsSubmitted,
setToolCallsForDisplay,
cancelAllToolCalls,
lastToolOutputTime,
];
}