mirror of
https://github.com/OpenHands/OpenHands.git
synced 2026-03-22 13:47:19 +08:00
[bugfix] browse actions shouldn't change url and screenshot, only observations (#2311)
* browse related actions shouldn't change url and screenshot, only the observations should * fix linting * fix integrat * update integration test --------- Co-authored-by: Xingyao Wang <xingyao6@illinois.edu>
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { setScreenshotSrc, setUrl } from "#/state/browserSlice";
|
||||
import { addAssistantMessage, addUserMessage } from "#/state/chatSlice";
|
||||
import { setCode, setActiveFilepath } from "#/state/codeSlice";
|
||||
import { appendInput } from "#/state/commandSlice";
|
||||
@@ -13,18 +12,14 @@ import { getRootTask } from "./taskService";
|
||||
|
||||
const messageActions = {
|
||||
[ActionType.BROWSE]: (message: ActionMessage) => {
|
||||
const { url, screenshotSrc } = message.args;
|
||||
store.dispatch(setUrl(url));
|
||||
store.dispatch(setScreenshotSrc(screenshotSrc));
|
||||
store.dispatch(addAssistantMessage(message.message));
|
||||
},
|
||||
[ActionType.BROWSE_INTERACTIVE]: (message: ActionMessage) => {
|
||||
if (message.args.thought) {
|
||||
store.dispatch(addAssistantMessage(message.args.thought));
|
||||
} else {
|
||||
store.dispatch(addAssistantMessage(message.message));
|
||||
}
|
||||
const { url, screenshotSrc } = message.args;
|
||||
store.dispatch(setUrl(url));
|
||||
store.dispatch(setScreenshotSrc(screenshotSrc));
|
||||
},
|
||||
[ActionType.WRITE]: (message: ActionMessage) => {
|
||||
const { path, content } = message.args;
|
||||
|
||||
@@ -118,11 +118,10 @@ RootWebArea 'The Ultimate Answer', focused
|
||||
[8] heading 'The Ultimate Answer'
|
||||
[9] paragraph ''
|
||||
StaticText 'Click the button to reveal the answer to life, the universe, and everything.'
|
||||
[10] button 'Click me'
|
||||
[10] button 'Click me', clickable
|
||||
|
||||
# Previous Actions
|
||||
goto('http://localhost:8000')
|
||||
|
||||
noop()
|
||||
|
||||
Here is an example with chain of thought of a valid action when clicking on a button:
|
||||
"
|
||||
|
||||
@@ -118,14 +118,13 @@ RootWebArea 'The Ultimate Answer', focused
|
||||
[8] heading 'The Ultimate Answer'
|
||||
[9] paragraph ''
|
||||
StaticText 'Click the button to reveal the answer to life, the universe, and everything.'
|
||||
[10] button 'Click me', focused
|
||||
[10] button 'Click me', clickable, focused
|
||||
StaticText 'The answer is OpenDevin is all you need!'
|
||||
|
||||
# Previous Actions
|
||||
goto('http://localhost:8000')
|
||||
noop()
|
||||
click("10")
|
||||
|
||||
|
||||
Here is an example with chain of thought of a valid action when clicking on a button:
|
||||
"
|
||||
In order to accomplish my goal I need to click on the button with bid 12
|
||||
|
||||
Reference in New Issue
Block a user