feat: add agent mode#2
Conversation
|
@cursor review |
|
@codex review |
There was a problem hiding this comment.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on January 7
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| console.print(f" [dim]starting browser with har...[/dim]") | ||
| browser = Browser( | ||
| record_har_path=str(self.har_path), | ||
| record_har_mode="full", | ||
| record_har_content="attach", |
There was a problem hiding this comment.
Honor agent start_url when launching browser
AgentBrowser accepts and records a start_url, but when the agent browser is created it is not passed through (lines 666‑670), so any URL the user enters in agent mode is ignored and the agent always starts from a blank session. Feed self.start_url into the Browser/Agent setup so autonomous runs begin at the requested page.
Useful? React with 👍 / 👎.
Implements the first two items of the agent-friendliness backlog (kalil0321#62): kalil0321#1 TTY-detect at REPL entry Without a TTY and no subcommand, the prompt_toolkit REPL would block on stdin forever. Now detects `not sys.stdin.isatty()`, prints `--help` to stderr, and exits 2 (misuse). Subcommands are unaffected. kalil0321#2 engineer --json / --no-interactive Mirrors the agent-mode contract (PR kalil0321#61): --json redirects Rich output to stderr and emits a stable JSON payload on stdout. New helper `_build_engineer_payload` produces the schema {schema_version, status, run_id, prompt, fresh, script_path, usage, error}. KeyboardInterrupt surfaces as `error: "interrupted"`. Exit codes: 0 ok, 1 runtime error. --no-interactive is reserved for symmetry (engineer mode has no questionary prompts internally). Also surfaces `--json` / `--no-interactive` in the root --help (item kalil0321#6 partial). Adds tests/test_cli_followups.py (14 tests) covering TTY-detect end-to- end via subprocess, _build_engineer_payload edge cases, and the click wiring for engineer --json (success, not-found, KeyboardInterrupt, exception, prompt-vs-fresh threading). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Note
Adds fully automated browsing and capture alongside existing manual/engineer flows.
AgentBrowserandrun_agent_browserinbrowser.pyusingbrowser-useto drive the browser and record HAR; includesparse_agent_model, API key validation, and result/metadata handling[agent]withrun_agent_capture, integrates reverse engineering option, exposes agent model via/settings, and wires version output to__version__agent_modeldefault; Session history now records runmodebrowser-use(git) andaiohttp; enable direct references; require Python >= 3.11Written by Cursor Bugbot for commit f49f124. This will update automatically on new commits. Configure here.