Skip to content

chore: clarify proxy usage in agent tool#83

Merged
andyMrtnzP merged 1 commit into
mainfrom
fix/clarify-proxying
May 22, 2026
Merged

chore: clarify proxy usage in agent tool#83
andyMrtnzP merged 1 commit into
mainfrom
fix/clarify-proxying

Conversation

@andyMrtnzP
Copy link
Copy Markdown
Contributor

@andyMrtnzP andyMrtnzP commented May 22, 2026

Summary by CodeRabbit

  • Documentation

    • Expanded proxy configuration guidance clarifying that settings must be provided as top-level arguments at session creation.
  • Bug Fixes

    • Added validation to detect incorrect proxy command entries with improved error messages providing explicit recovery steps.

Review Change Stack

@andyMrtnzP andyMrtnzP marked this pull request as ready for review May 22, 2026 17:02
@andyMrtnzP andyMrtnzP merged commit 0748651 into main May 22, 2026
1 of 2 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 22, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 24e794cf-833f-4926-8a71-6e96f8a1f1a1

📥 Commits

Reviewing files that changed from the base of the PR and between 44ea624 and 01f7d8f.

📒 Files selected for processing (1)
  • src/tools/agent.ts

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.


Walkthrough

This PR clarifies proxy configuration for browserless_agent and adds runtime validation that rejects commands entries with method === "proxy", emitting analytics and throwing a UserError instructing callers to close and reopen the session with proxy options passed at the top level.

Changes

Proxy Configuration Enforcement

Layer / File(s) Summary
Proxy documentation and validation
src/tools/agent.ts
Updated "Proxy (optional)" instructions to clarify proxy parameters are top-level tool arguments applied at session creation, must be set on the initial call, cannot be sent as commands mutations, and require closing/restarting if set too late. Added validation to detect commands items with method === "proxy", send failure analytics, and throw a UserError with recovery steps.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • browserless/browserless-mcp#82: Touches src/tools/agent.ts proxy instructions; this PR extends that work by adding runtime validation and error handling for invalid proxy commands entries.
  • browserless/browserless-mcp#61: Adds proxy-aware session setup via top-level args.proxy, related to enforcing top-level proxy contract here.
  • browserless/browserless-mcp#16: Implements command normalization and run flow that the new commands validation now interacts with.

Suggested reviewers

  • ashwinsingh2007
  • artiom

Poem

🐰 A proxy once confused the way,
Now docs and guards keep errors at bay,
Top-level it goes, at session's first call,
Close and reopen if you tried to stall,
Hop, retry, and let the session stand tall!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/clarify-proxying

Comment @coderabbitai help to get the list of available commands and usage tips.

@andyMrtnzP andyMrtnzP deleted the fix/clarify-proxying branch May 22, 2026 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant