Skip to content

fix(agent): pass --url to the agent prompt - #144

Merged
kalil0321 merged 4 commits into
mainfrom
kalil0321/fix-issue-140
Oct 29, 2026
Merged

kalil0321 merged 4 commits into
mainfrom
kalil0321/fix-issue-140

Conversation

@kalil0321

@kalil0321 kalil0321 commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Fixes #140

Why

In agent mode, --url was validated and stored, but it never reached the agent. The agent only saw --prompt, so it did not know where to start unless the prompt named the site.

What

  • The 4 agent engines (Claude, OpenCode, Copilot, Cursor) now accept start_url, and run_auto_capture passes it to them.
  • When a URL is given, the user message gets a <start_url> block right after <mission>. The text comes from the new prompts/auto/start_url.md.
  • When no URL is given, the message is unchanged.

Verification

  • New tests:
    • the block is rendered for each of the 3 templates;
    • without a URL, the template output is unchanged;
    • OpenCode renders the block;
    • -u reaches the engine for all 4 SDKs.
  • The new tests fail without the fix.
  • pytest (1038 passed), ruff check.
  • Real run with the issue's command (sdk: claude, chrome-mcp, --headless):
    • the agent's first navigation was to https://jobs.ashbyhq.com/openai;
    • the generated client returned 794 postings.

Out of scope

Reporting status: "ok" when no client is written. That is handled separately.

RetriggerView in GreptileConfidence Score: 5/5

Safe to merge within the reviewed scope. The URL reaches the final user prompt for all four engines, and omitting it preserves existing prompt output.

Summary

Passes --url into the agent message for Claude, OpenCode, Copilot, and Cursor.

  • Agent prompts now start at the supplied URL.

Acknowledged scope: kalil0321 explicitly deferred reporting success when no client is written to separate work.

No blocking issues were found; this change is safe to merge within the reviewed scope.

Reviews (1) · Last reviewed commit: "fix(agent): pass --url to the agent prom..." · Reviewed by Greptile

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-10-29T03:31:50.571714Z 90af85b New commits
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 11 files

Tip: Get a Slack DM when cubic finishes reviewing your PRs. Connect Slack

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread src/reverse_api/cli.py
Comment thread src/reverse_api/prompts/auto/user_agent_browser.md

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 6 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src/reverse_api/prompts/auto/user_agent_browser.md">

<violation number="1" location="src/reverse_api/prompts/auto/user_agent_browser.md:62">
P2: This code-fenced command is not valid shell: Bash parses `<target-url>` as redirection and fails before `agent-browser` runs. Render the URL from `<start_url>` as a quoted argument, or use a shell-safe placeholder and explicitly tell the agent to substitute it.</violation>
</file>

Reply with feedback, questions, or to request a fix.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread src/reverse_api/cli.py
Comment thread src/reverse_api/cli.py
{agent_browser_shell} network har start
# verify exit code 0; if non-zero, diagnose with `{agent_browser_shell} doctor` and stop
{agent_browser_shell} open https://example.com
{agent_browser_shell} open <target-url>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This code-fenced command is not valid shell: Bash parses <target-url> as redirection and fails before agent-browser runs. Render the URL from <start_url> as a quoted argument, or use a shell-safe placeholder and explicitly tell the agent to substitute it.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At src/reverse_api/prompts/auto/user_agent_browser.md, line 62:

<comment>This code-fenced command is not valid shell: Bash parses `<target-url>` as redirection and fails before `agent-browser` runs. Render the URL from `<start_url>` as a quoted argument, or use a shell-safe placeholder and explicitly tell the agent to substitute it.</comment>

<file context>
@@ -59,7 +59,7 @@ Start HAR recording **before** navigation and confirm it succeeded (abort if thi
 {agent_browser_shell} network har start
 # verify exit code 0; if non-zero, diagnose with `{agent_browser_shell} doctor` and stop
-{agent_browser_shell} open https://example.com
+{agent_browser_shell} open <target-url>
 {agent_browser_shell} snapshot -i --json
 # … iterate …
</file context>

Comment thread tests/test_manual_browser_startup_failure.py Outdated
@kalil0321
kalil0321 merged commit c644f8a into main Oct 29, 2026
15 checks passed

This branch was successfully deployed

1 active deployment
preview — 90af85b0 Deployed Oct 29, 2026 by github-actions[bot]
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.

Agent mode ignores --url: start URL never reaches the agent prompt

1 participant