Skip to content

Commit

Permalink
fix: Set success property for all handled actions in chat slice
Browse files Browse the repository at this point in the history
  • Loading branch information
openhands-agent committed Dec 9, 2024
1 parent df49c68 commit 3c7bd3f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/state/chat-slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,16 @@ export const chatSlice = createSlice({
return;
}
causeMessage.translationID = translationID;
// Set success property for all handled actions
causeMessage.success = observation.payload.success;

if (observationID === "run" || observationID === "run_ipython") {
let { content } = observation.payload;
if (content.length > MAX_CONTENT_LENGTH) {
content = `${content.slice(0, MAX_CONTENT_LENGTH)}...`;
}
content = `\`\`\`\n${content}\n\`\`\``;
causeMessage.content = content; // Observation content includes the action
causeMessage.success = observation.payload.success;
}
},

Expand Down

0 comments on commit 3c7bd3f

Please sign in to comment.