Skip to content

Add option to await browser tasks via env var #19

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

Merged
merged 10 commits into from
Mar 27, 2025

Conversation

samanthavbarron
Copy link
Contributor

First off, after trying a bunch of similar tools, this is the best I've found for my use case so far. Great job! 🎉

This PR adds an environment variable option to wait for API calls to complete before returning the task. There's probably a better way of doing this.

My motivation for doing this is that I'm using this MCP server in an n8n workflow, however in n8n there's not a way to insert a delay between tool calls when using the agent node (AFAIK).

@hashkode
Copy link
Contributor

Hey @samanthavbarron,

thanks for the kudos and playing with this mcp server! Sounds great, especially your deployment in a n8n environment.

We didn't settle for a license of this repo and a related contribution handling, so please bear with us to figure this out in the next days. We'll check your implementation and your hint regarding possibly more elegant options on this behavior. The flag is certainly a valid option, another one might be a parameter to the mcp call or another mcp tool altogether, let's see.

If you have further remarks or concerns, feel free to comment over here or shoot us an email to info at cobrowser.xyz.

@michiosw
Copy link
Contributor

Hey @samanthavbarron, thanks for the PR and the suggestion! The flag is a great idea—In addition I’d recommend adding it as a parameter to the existing mcp tool rather than creating a new tool. This approach offers greater flexibility on the client side, accommodating various integration scenarios depending on the specific MCP client used (e.g., cursor, MCP inspector), since each provides different interactions with MCP servers.

@michiosw michiosw self-assigned this Mar 24, 2025
@hashkode hashkode mentioned this pull request Mar 25, 2025
@wtberry
Copy link

wtberry commented Mar 26, 2025

Hey, sorry to comment in the middle.
Thanks for this awesome PR @samanthavbarron :)
Would it be more useful to make a modifications to return the result from browser_use tool, when PATIENT option is enabled, instead of returning the task status and id like before??

@michiosw
Copy link
Contributor

Hey @wtberry — I think you made a great call. When we're awaiting the browser_use task itself, the response shouldn't include the job ID. Since there are no further updates at that point, the job ID doesn't really serve a purpose.

That said, I do think keeping the status field is still useful and makes sense.

@wtberry
Copy link

wtberry commented Mar 27, 2025

@michiosw Sounds good, I can create a PR to make that change once this PR is approved and merged.
Any idea when it might be approved?

@michiosw
Copy link
Contributor

Hey @wtberry probably today or tomorrow. I will need to add some adjustments but then it should be ready to go so you can create your PR. Make sure to check our contribution docs.

@michiosw
Copy link
Contributor

Hey @wtberry and @samanthavbarron , I added necessary changes and will merge the PR later today. Thank you for your contribution!

@michiosw michiosw requested a review from hashkode March 27, 2025 20:46
@michiosw michiosw added the enhancement New feature or request label Mar 27, 2025
samanthavbarron and others added 6 commits March 27, 2025 15:13
Implemented PATIENT mode that allows browser tasks to complete synchronously, with proper error handling and configuration. When enabled, browser_use tool returns complete results directly. Updated tool descriptions to clearly indicate behavior in each mode.
@hashkode hashkode assigned hashkode and unassigned michiosw Mar 27, 2025
@hashkode hashkode self-requested a review March 27, 2025 22:22
@michiosw michiosw merged commit 9b9581e into co-browser:main Mar 27, 2025
2 of 3 checks passed
@wtberry
Copy link

wtberry commented Mar 28, 2025

@michiosw Thanks! I will go ahead and create PR when ready!

@michiosw
Copy link
Contributor

@wtberry I think this PR covers all the features you suggested. However, feel free to review and open another PR if you see any room for improvement!

@michiosw
Copy link
Contributor

michiosw commented Apr 9, 2025

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants