Fixed stdout

This commit is contained in:
2024-11-11 13:51:27 +01:00
parent 0e1a0407d0
commit 3a1d8a449c
5 changed files with 36 additions and 4 deletions

View File

@@ -42,7 +42,7 @@ const App = () => {
setValidationError(message.validation_error);
break;
case ServerMessageType.OUTPUT_UPDATE:
setOutput(prev => prev + message.data);
setOutput(message.output);
break;
}
});
@@ -72,6 +72,12 @@ const App = () => {
}
};
const handleClearOutput = () => {
sendMessage({
"type": ClientMessageType.CLEAR_OUTPUT
});
};
useEffect(() => {
if (agentState === AgentState.APPROVE_RESPONSE) {
sendMessage({
@@ -151,7 +157,7 @@ const App = () => {
onApprove={handleApprove}
onToggleDiff={() => setShowDiff(!showDiff)}
onSendInput={handleSendInput}
onClearOutput={() => setOutput('')}
onClearOutput={handleClearOutput}
/>
<FloatingButton onClick={() => setShowSidebar(!showSidebar)} />

View File

@@ -23,6 +23,7 @@ export const ClientMessageType = {
MODIFY_RESPONSE: 'MODIFY_RESPONSE',
APPROVE_RESPONSE: 'APPROVE_RESPONSE',
SEND_INPUT: 'SEND_INPUT',
CLEAR_OUTPUT: 'CLEAR_OUTPUT',
};
export const ServerMessageType = {