-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix up conversation initialization #6430
base: main
Are you sure you want to change the base?
Changes from 24 commits
a619a8c
e60d483
265af6c
460a490
b0c94cb
c69ffd2
4771497
fa14a4e
7661c6e
8c8372b
95ff885
57b87ef
c2c7ee7
0652f49
16ecdf0
741aba7
4d9a10b
8b7ad01
4920c29
546e37b
8c13c6e
9a46dd7
ecd3438
2f96f68
af7e33b
ad72f8e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
import { describe, it, expect } from "vitest"; | ||
import store from "../src/store"; | ||
import { | ||
setInitialQuery, | ||
clearInitialQuery, | ||
setInitialPrompt, | ||
clearInitialPrompt, | ||
} from "../src/state/initial-query-slice"; | ||
|
||
describe("Initial Query Behavior", () => { | ||
it("should clear initial query when clearInitialQuery is dispatched", () => { | ||
it("should clear initial query when clearInitialPrompt is dispatched", () => { | ||
// Set up initial query in the store | ||
store.dispatch(setInitialQuery("test query")); | ||
expect(store.getState().initialQuery.initialQuery).toBe("test query"); | ||
store.dispatch(setInitialPrompt("test query")); | ||
expect(store.getState().initialQuery.initialPrompt).toBe("test query"); | ||
|
||
// Clear the initial query | ||
store.dispatch(clearInitialQuery()); | ||
store.dispatch(clearInitialPrompt()); | ||
|
||
// Verify initial query is cleared | ||
expect(store.getState().initialQuery.initialQuery).toBeNull(); | ||
expect(store.getState().initialQuery.initialPrompt).toBeNull(); | ||
}); | ||
}); |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,10 +6,6 @@ class AgentState(str, Enum): | |
"""The agent is loading. | ||
""" | ||
|
||
INIT = 'init' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think INIT exists in the event stream, at least as value of an agent change observation. It might be worth to test restoring a session, to see if we can recreate the events. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ooh good point There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It works! |
||
"""The agent is initialized. | ||
""" | ||
|
||
RUNNING = 'running' | ||
"""The agent is running. | ||
""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that we marked this function async, shouldn't this now be:
return await OpenHands.createConversation(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Otherwise the result will be a promise wrapped in a promise?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this works just fine--promises are pretty intelligent about nesting IIRC.