Skip to content

Commit

Permalink
Fix issue #6262: Add success/failure indicators for file read/edit op…
Browse files Browse the repository at this point in the history
…erations
  • Loading branch information
openhands-agent committed Feb 7, 2025
1 parent 37ddc56 commit e3eb7e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions frontend/src/components/features/chat/messages.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from "react";
import type { Message } from "#/message";
import { ChatMessage } from "#/components/features/chat/chat-message";
import { ConfirmationButtons } from "#/components/shared/buttons/confirmation-buttons";
import { ImageCarousel } from "../images/image-carousel";
Expand Down
5 changes: 5 additions & 0 deletions frontend/src/state/chat-slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ export const chatSlice = createSlice({
causeMessage.success = !ipythonObs.content
.toLowerCase()
.includes("error:");
} else if (observationID === "read" || observationID === "edit") {
// For read/edit operations, we consider it successful if there's content and no error
causeMessage.success =
observation.payload.content.length > 0 &&
!observation.payload.content.toLowerCase().includes("error:");
}

if (observationID === "run" || observationID === "run_ipython") {
Expand Down

0 comments on commit e3eb7e3

Please sign in to comment.