Skip to content

Commit

Permalink
ignore agent_state_changed if first
Browse files Browse the repository at this point in the history
  • Loading branch information
SmartManoj committed Aug 18, 2024
1 parent c498085 commit 04194ab
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions frontend/src/services/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ class Session {
let data = null;
try {
data = JSON.parse(e.data);
// if first message is agent_state_changed, then we need to ignore it; happens when starting a new task
if (Session._history.length === 0 && data.observation === "agent_state_changed") {
return;
}
Session._history.push(data);
} catch (err) {
// TODO: report the error
Expand Down

0 comments on commit 04194ab

Please sign in to comment.