MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / stripLeakedToolJson

Function stripLeakedToolJson

src/cli/ui.tsx:884–929  ·  view source on GitHub ↗

* Strip leaked tool-call JSON from streamed text before showing to the user. * * Some local models (notably Qwen 2.5 Coder in Ollama) emit tool calls as literal * JSON in their text stream. The agent loop's text-tool-recovery extracts them as * proper ToolCall objects — but in the meantime, the

(text: string)

Source from the content-addressed store, hash-verified

882 {!pendingPrompt && liveShell.length > 0 && (
883 <Box flexDirection="column" paddingLeft={2}>
884 {liveShell.map((line, i) => (
885 <Text key={i} color={line.startsWith('!') ? 'red' : undefined} dimColor={!line.startsWith('!')}>
886 {line.slice(0, Math.max(20, cols - 4))}
887 </Text>
888 ))}
889 </Box>
890 )}
891
892 <SideRunDock lanes={lanes} expanded={dockOpen} width={cols} />
893
894 {pendingPrompt && (
895 <Box flexDirection="column">
896 {pendingPrompt.diff && (
897 <DiffViewer
898 path={pendingPrompt.diff.path}
899 before={pendingPrompt.diff.before}
900 after={pendingPrompt.diff.after}
901 />
902 )}
903 <Confirmation
904 prompt={pendingPrompt.prompt}
905 options={pendingPrompt.options}
906 onAnswer={(a) => {
907 const p = pendingPrompt;
908 setPendingPrompt(null);
909 p.resolve(a);
910 }}
911 />
912 <Box paddingX={1}>
913 <Text dimColor>Shift+Tab cycles approval · now {APPROVAL_MODE_META[approvalMode].label}</Text>
914 </Box>
915 </Box>
916 )}
917
918 {!pendingPrompt && (
919 <Box flexDirection="column" marginTop={1}>
920 {/* Persistent shimmering wordmark — the signature gradient keeps running. */}
921 <LiveHeader width={cols} mode={mode} approvalMode={approvalMode} busy={busy} thinkingChars={thinkingChars} motion={motion} />
922 {/* Input lives in its own bordered box, visually detached from the transcript above. */}
923 <Box
924 width={cols}
925 borderStyle="round"
926 borderColor={mode === 'plan' ? 'yellow' : 'cyan'}
927 paddingX={1}
928 >
929 <ChatInput
930 value={input}
931 onChange={setInput}
932 onSubmit={handleSubmit}

Callers 1

AppFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected