-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix browser system prompt inclusion rules #1556
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 browser system prompt inclusion rules #1556
Conversation
|
| const systemPrompt = await SYSTEM_PROMPT( | ||
| this.context, | ||
| cwd, | ||
| apiConfiguration.openRouterModelInfo?.supportsComputerUse ?? false, |
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.
Wow, that is a good find / what was I thinking? 😂
Browser Tool Setting Bug AnalysisAfter examining the code, I've identified the root cause of the bug: The Issue
Why It FailsThe bug occurs because:
|
|
created #1754 to fix this, draft |
@hannesrudolph Does it really fix it though? It needs to follow this behavior: Browser Enabled + Model supports computer use --> include browser prompt did you test all cases? |
Context
the browser_action instructions were included in system prompt even when Browser usage was turned off in the settings. This PR makes sure that they are only included in system prompt if the browser usage is enabled and the model is supporting computer use.
Implementation
Passing in
browserUseEnabledand the actualsupportsComputerUsevalues inClineProvider.tsdid the trick.How to Test
Use a mode that supports computer use, turn Browser tool usage off in the settings, preview system prompt => it should not contain browser_tool instructions.
Use a mode that doesn't support computer use, turn Browser tool usage on in the settings, preview system prompt => it should not contain browser_tool instructions.
Use a mode that supports computer use, turn Browser tool usage on in the settings, preview system prompt => it should contain browser_tool instructions.
Notes
This is my second attempt. My first attempt #1514 was not that elegant.
Important
Fix browser instructions inclusion in system prompt to depend on both browser tool setting and model support in
ClineProvider.ts.ClineProvider.ts.browserToolEnabledis true and model supports computer use.browserToolEnabledandsupportsComputerUsechecks inClineProvider.ts.SYSTEM_PROMPTcall to usecanUseBrowserTool.ClineProvider.test.tsto verify browser tool inclusion logic.browserToolEnabledand model support.This description was created by
for a9773b7. It will automatically update as commits are pushed.