Skip to content

πŸ™Œ OpenHands: AI-Driven Development

frontend: Display think action as action rather than text (#7852)

Xingyao Wang49c515b2528d
diff --git a/frontend/src/services/actions.ts b/frontend/src/services/actions.ts
index e9d6b8fd0b..75883854cf 100644
--- a/frontend/src/services/actions.ts
+++ b/frontend/src/services/actions.ts
@@ -104,7 +104,12 @@ export function handleActionMessage(message: ActionMessage) {
}
if (message.source === "agent") {
- if (message.args && message.args.thought) {
+ // Only add thought as a message if it's not a "think" action
+ if (
+ message.args &&
+ message.args.thought &&
+ message.action !== ActionType.THINK
+ ) {
store.dispatch(addAssistantMessage(message.args.thought));
}
// Need to convert ActionMessage to RejectAction
diff --git a/frontend/src/state/chat-slice.ts b/frontend/src/state/chat-slice.ts
index 023e75f6bc..0d70005ec0 100644
--- a/frontend/src/state/chat-slice.ts
+++ b/frontend/src/state/chat-slice.ts
@@ -24,6 +24,7 @@ const HANDLED_ACTIONS: OpenHandsEventType[] = [
"browse_interactive",
"edit",
"recall",
+ "think",
];
function getRiskText(risk: ActionSecurityRisk) {