Protect stdout and stderr so JavaScript code can't accidentally write to stdout corrupting ink rendering (#13247)

Bypassing rules as link checker failure is spurious.
This commit is contained in:
Jacob Richman
2025-11-20 10:44:02 -08:00
committed by GitHub
parent e20d282088
commit d1e35f8660
82 changed files with 1523 additions and 868 deletions
@@ -68,7 +68,6 @@ export function useReactToolScheduler(
onComplete: (tools: CompletedToolCall[]) => Promise<void>,
config: Config,
getPreferredEditor: () => EditorType | undefined,
onEditorClose: () => void,
): [
TrackedToolCall[],
ScheduleFn,
@@ -83,7 +82,6 @@ export function useReactToolScheduler(
// Store callbacks in refs to keep them up-to-date without causing re-renders.
const onCompleteRef = useRef(onComplete);
const getPreferredEditorRef = useRef(getPreferredEditor);
const onEditorCloseRef = useRef(onEditorClose);
useEffect(() => {
onCompleteRef.current = onComplete;
@@ -93,10 +91,6 @@ export function useReactToolScheduler(
getPreferredEditorRef.current = getPreferredEditor;
}, [getPreferredEditor]);
useEffect(() => {
onEditorCloseRef.current = onEditorClose;
}, [onEditorClose]);
const outputUpdateHandler: OutputUpdateHandler = useCallback(
(toolCallId, outputChunk) => {
setToolCallsForDisplay((prevCalls) =>
@@ -158,7 +152,6 @@ export function useReactToolScheduler(
() => getPreferredEditorRef.current(),
[],
);
const stableOnEditorClose = useCallback(() => onEditorCloseRef.current(), []);
const scheduler = useMemo(
() =>
@@ -168,7 +161,6 @@ export function useReactToolScheduler(
onToolCallsUpdate: toolCallsUpdateHandler,
getPreferredEditor: stableGetPreferredEditor,
config,
onEditorClose: stableOnEditorClose,
}),
[
config,
@@ -176,7 +168,6 @@ export function useReactToolScheduler(
allToolCallsCompleteHandler,
toolCallsUpdateHandler,
stableGetPreferredEditor,
stableOnEditorClose,
],
);