cleanup: simplify agent mode providers#60
Conversation
Agent mode now only exposes auto (Playwright MCP) and chrome-mcp (Chrome DevTools MCP). Two legacy provider options have been retired because upstream updates made them unreliable. - Drop AgentBrowser, run_agent_browser and related agent_model parsing / API-key validation helpers from browser.py - Simplify run_agent_capture in cli.py to delegate straight to run_auto_capture; remove the now-unused settings menu entries and their handlers - Trim DEFAULT_CONFIG and silently migrate retired agent_provider values to "auto" so existing user configs keep working - Drop the now-empty [agent] optional-dependency extra - Update README install/configuration sections and add an Unreleased CHANGELOG entry; align expected_keys in test_config.py and replace the obsolete migration tests with provider-fallback coverage Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b94c847a5
ℹ️ 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".
| agent_provider = config_manager.get("agent_provider", "auto") | ||
| return run_auto_capture( | ||
| prompt=prompt, |
There was a problem hiding this comment.
Honor agent no-engineer/record-only controls
run_agent_capture now unconditionally delegates to run_auto_capture and never uses the parsed reverse_engineer/@record-only state, so agent --no-engineer and @record-only still run full auto engineering. After this commit removed the legacy providers, that means there is no remaining agent path that can skip engineering, which is a functional regression and can trigger unexpected model usage/cost for users expecting capture-only behavior.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
1 issue found across 8 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="src/reverse_api/cli.py">
<violation number="1" location="src/reverse_api/cli.py:1289">
P1: Agent-mode reverse-engineering controls are ignored: `--no-engineer` and `@record-only` no longer disable generation after this unconditional delegate to `run_auto_capture`.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Test Results🛡️ 4/6 Results
Issues FoundRuff on touched files: The requested lint validation does not pass because Live provider smoke coverage: I could confirm the refactor structurally (config migration, removed options, delegation to SummaryThe cleanup itself looks functionally sound: config migration works, legacy provider values are safely reset to
View full run details · Tested by Kind I tested |
@cubic-dev-ai — No ACK on this PR (issue is pre-existing)
I checked # main, src/reverse_api/cli.py:1378
if agent_provider in ("auto", "chrome-mcp"):
return run_auto_capture(
prompt=prompt,
url=url,
model=model,
output_dir=output_dir,
agent_provider=agent_provider,
)So @kind-agent — partial Ack
Follow-upI've filed #62 ( |
@kalil0321 You're right on both counts — thanks for digging into
Ruff W293: Also correct — those warnings are pre-existing on The rest of the analysis (config migration, test suite, docs cleanup) stands. Your reasoning is solid across the board. |
|
Thanks — that matches the evidence available from the previous run. I did not verify the
Likewise on ruff:
Given your note that both the SHA I tested and the current head SHA are identical, and since your follow-up is clarifying interpretation rather than asking for new execution, I’m treating this as:
Thanks for the clarification and for splitting the agent-flag behavior into follow-up issue #62. |
The inline @-tag syntax (@record-only, @codegen, @id, @docs, @help) was undiscoverable, drift-prone (e.g. @record-only silently ignored on the agent path), and a duplicate of existing CLI surface. Removed entirely. Surviving capabilities now live as first-class flags / arguments: @record-only -> manual --no-engineer (already existed) @id <run_id> -> engineer <run_id> (already existed) @id <run_id> <prompt> -> engineer <run_id> --prompt "..." (new) @id <run_id> --fresh -> engineer <run_id> --fresh (new) Dropped without replacement: @codegen + ActionRecorder + playwright_codegen module (low usage, superseded by the standard capture+engineer flow) @docs (will return as a dedicated `docs` subcommand in a follow-up) @help (the existing /help slash command covers it) Also removes the dead `--reverse-engineer/--no-engineer` flag from the agent command — it was parsed but never propagated to the auto path. Net -1325 / +51. 635 tests passing; the 5 remaining failures all reproduce on cleanup/agent-mode (this branch's base) — none introduced here. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
@greptile review |
…fresh When the user runs `engineer <run_id> --prompt "X"` on an existing capture *without* --fresh, the previous wiring passed X straight through as the main prompt. That bypassed the `prompt = run_data["prompt"]` fallback in run_engineer, so the captured run's original goal/context was lost and the SDK only saw the small refinement. Now --prompt is treated like the legacy `@id <run_id> <prompt>` syntax: - no --fresh: --prompt becomes additional_instructions, original goal kept - --fresh: --prompt fully replaces the original goal Adds tests/test_cli_engineer_command.py covering all four flag combinations. Reported by chatgpt-codex-connector on PR #63 (P2). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Self-audit follow-up to the tag removal: the engineer/user.md prompt template still framed the session as "Tag-Based Workflows" and printed "@id <run_id>" / "@docs" labels into the LLM context. These referenced tags that no longer exist in the CLI, would confuse the SDK's model, and could surface in user-visible LLM output. - Renamed the section to "Run Context" and dropped the @id formatting - Removed the now-unused tag_extra template variable from base_engineer and the corresponding test_prompts harness - Updated test_prompt_includes_tag_context -> test_prompt_includes_run_context - Sharpened the CHANGELOG to spell out --prompt semantics (additive without --fresh, replacement with --fresh) — matches the fix in ec9de62 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
cleanup: remove tag system, expose equivalents as CLI flags
Summary
auto(Playwright MCP) andchrome-mcp(Chrome DevTools MCP); two legacy provider options have been retiredAgentBrowserpath and its helpers frombrowser.py;run_agent_captureincli.pybecomes a thin delegate torun_auto_captureDEFAULT_CONFIGand silently migrates retiredagent_providervalues toautoso existing user configs keep working[agent]optional-dependency extra and updates README + adds an Unreleased CHANGELOG entryNet diff: +32 / −872 across 8 files.
Test plan
uv run pytest tests/test_config.py(18/18 pass, including the two new provider-fallback migration tests)uv run pytestfull suite (685 pass; 4 pre-existing failures reproduce onmain, unrelated to this change)uv run ruff checkon touched files: 1 fewer warning thanmain, no new issuesuv run reverse-api-engineer --helpstill resolves all subcommandsauto+chrome-mcp) before merge🤖 Generated with Claude Code
Summary by cubic
Simplifies agent mode to two providers —
auto(Playwright MCP) andchrome-mcp(Chrome DevTools MCP) — and removes the inline tag system in favor of clear CLI flags. Also fixes engineer prompt handling and removes dead code and the[agent]extra.Refactors
browser-useandstagehand;run_agent_capturenow delegates directly to auto and the ignored--reverse-engineer/--no-engineerflag is removed.@record-only,@codegen,@id,@docs,@help); deletedaction_recorder.py,playwright_codegen.py, and related utils/tests; droppedstagehandfromuv.lock; updated README and CHANGELOG.Migration
agent_providerset tobrowser-useorstagehandnow load asauto; obsolete keys are ignored.@record-only→manual --no-engineer;@id <run_id>→engineer <run_id>;@id <run_id> <prompt>→engineer <run_id> --prompt "...";@id <run_id> --fresh→engineer <run_id> --fresh. Additionally,engineer <run_id> --promptnow keeps the original goal unless--freshis set.Written for commit 19311d8. Summary will update on new commits.
Greptile Summary
This PR retires the
browser-useandstagehandagent providers, leaving onlyauto(Playwright MCP) andchrome-mcp(Chrome DevTools MCP). Existing configs with the old provider values are silently migrated toauto, and the associated[agent]optional-dependency extra is dropped.browser.py: ~560 lines removed —AgentBrowser,run_agent_browser, and the model/API-key helper functions are all gone.cli.py:run_agent_captureis now a thin delegate torun_auto_capture; the browser-use/stagehand settings menu entries are removed. The--reverse-engineer/--no-engineerCLI flag on theagentcommand is accepted but not forwarded torun_auto_capture(pre-existing issue, flagged in a prior review).config.py+ tests: Migration logic correctly resets retired provider values toauto; thevalid_configfilter strips obsolete keys (browser_use_model,stagehand_model) on the next save. Two new migration tests cover the fallback paths.Confidence Score: 5/5
Safe to merge — this is a focused dead-code removal with correct migration logic and full test coverage for the new paths.
The change deletes legacy code that is no longer reachable, adds a straightforward migration guard in ConfigManager.load, and updates all supporting tests. No new functional paths are introduced. The one existing gap (the --reverse-engineer flag being ignored on the agent command) predates this PR and was already noted in a previous review.
No files require special attention; cli.py carries a pre-existing cosmetic gap with the unused --reverse-engineer flag, but that is unrelated to this diff.
Important Files Changed
Comments Outside Diff (1)
src/reverse_api/cli.py, line 1171-1185 (link)--reverse-engineer/--no-engineerflag is silently ignoredThe
agentcommand still exposes--reverse-engineer/--no-engineer(defaultTrue) and passes it intorun_agent_capture, but the new simplified body ofrun_agent_capturenever forwards that value torun_auto_capture. A user who passes--no-engineerexpecting to suppress engineering will get no effect. Consider either (a) removing the flag from theagentcommand now that the legacy paths that respected it are gone, or (b) documenting in the help text that engineering always runs in auto mode.Prompt To Fix With AI
Reviews (2): Last reviewed commit: "cleanup: simplify agent mode providers" | Re-trigger Greptile