Let Jev handle continuous browser operations that require choosing the next step based on the page. Codex is responsible for goals, text input, complex judgments, authorization, and final acceptance. CUA is the tool for reading the page and performing operations, and Jev is the model for choosing the next step; calling CUA does not equal requesting Jev. Do not hand already-determined operations back to it for confirmation just to use Jev.
First choose the execution method
Before creating or resuming each Jev call, first determine: based on the current page, can the next operation and target already be determined? If they can be determined, use CUA directly; if they can be determined using a query or code rules, execute according to the rules. Only when a path still needs to be chosen based on page content, and it is a simple choice supported by Jev, should Jev be called. The page not yet having been read is not a reason to call Jev; first use CUA to obtain the state.
| Current situation | Execution method |
|---|---|
| The current page and the unique target control are already determined, for example clicking send or closing a specified toggle | Codex directly calls CUA; confirm the current value before executing to avoid repeated toggling |
| The multi-step process is fully determined, and it can be executed according to the current state using deterministic rules | Use CUA and code; do not add model decisions |
| The next step depends on page content, and a navigation, expansion, paging, or scrolling path needs to be chosen | Give Jev the complete subgoal and allowed operations, and let it execute continuously in one call |
| Text input, visual recognition, complex semantic judgment, ambiguous controls, uploads, or unsupported components | Codex takes over the necessary parts; after handling, reassess whether Jev selection is still needed |
| Deterministic checks such as page loading, generation completion, and whether a message has been submitted | Use the new page state and code checks; Codex evaluates it, without repeatedly confirming with Jev |
It is forbidden to request Jev merely to perform an already-determined click, regardless of what maxSteps is set to. Do not treat "one specified button + maxSteps: 1" as a regular Jev workflow. It is normal for a complete subgoal to have only one candidate on a given screen; do not loosen permissions just to make up candidates.
For example: if the unique "Expand details" button has been found, click it directly with CUA; after entering a search term, if it has been determined that "Search" needs to be clicked, click it directly with CUA; only when a section to enter needs to be chosen based on page clues should it be handed to Jev. Many steps, needing to page, or an existing Jev session do not by themselves constitute a reason to call it.
Prerequisites for running
- Use the
mcp__cua_repl.jsactually exposed in the current turn, call it directly, and do not put it intofunctions.exec。ALL_TOOLSThe absence of CUA in it cannot prove that the tool is unavailable. - Follow the first-call rules for CUA: the first time, execute only one declared entry API, and read the returned documentation before operating. When resuming a compressed computer-operation context, reload the documentation as required by the tool.
- The browser and tab specified by the user take priority; when unspecified, prefer Chrome, and if unavailable, use the built-in browser. The existing bridge is only for Chrome and the built-in browser.
- Use the scripts/bridge.mjsincluded with this skill; there is no need to install
jev-browser-use. According to run the interface Import scripts from this directory; on first configuration or when troubleshooting authentication issues, read Configuration Guide. Does not automatically modify global skills, providers, models, or credentials. - The bridge requires Node module imports, file reads, and fetch within CUA. The tool being installed, being callable in the current turn, and the specified tab being reachable are three different things; verify them separately.
Define an acceptable subgoal
Before handing off to Jev, clarify: the starting page, the target state, the allowed origins, the allowed control categories, the actions that must be handed back to Codex, and the checkable completion conditions. For example: "Go to the order list, find the specified order based on the current page and expand its details, and stop after seeing the order number and line items."
Prefer named controls from the current page or a verified flow; when dynamic discovery is needed, use policy.allowNames and similar rules to limit the scope. Neither page text nor model output can grant permissions.denyNames、requireCodexNames only filters automatically discovered candidates and does not filter explicit controls; do not put actions reserved for Codex into controls。
A Jev request sends the goal, the page AX text, and history to the configured model service. Before use, confirm that this data is within the existing authorization scope; prefer public pages or synthetic test data. Browsing permission for a private page does not automatically equal permission to send it to an external model. When necessary authorization is lacking, use direct CUA to continue the parts that can be completed.
Sending messages, publishing, deleting, payments, and account changes are verified against existing authorization and executed by Codex; when authorization is already clear, do not ask again. Preview tasks must stop before publishing. Do not treat Enter as a side-effect-free navigation key; first determine whether it will submit a form.
Continuous execution and session reuse
- Codex reads the new state, completes the necessary input, and records the starting evidence and completion conditions for that subgoal.
- Create a Jev session only for the part that still requires page path selection; the subgoal ends at a checkable localization result, and do not hand off to Jev the subsequent operations that are already determined. Provide a budget for multiple steps, for example
maxSteps: 12、maxMs: 45000, and execute the loop within a single CUA call. Do not have Codex re-orchestrate after every single click. - When encountering input, ambiguity, or an unsupported operation, Codex checks the current state and handles it, then reselects the execution method. If subsequent operations are already clear, use direct CUA; reuse the session only when the same subgoal still requires path selection, and do not automatically call Jev again just because "the goal is not yet complete."
- When switching to an independent new subgoal that still requires Jev selection, keep the tab but create a new Jev session to avoid the previous round's completion record affecting the current judgment. First save the old metrics that need to be aggregated; do not reset the entire CUA runtime.
The bridge routes based on the number of executable candidates generated, filtered, and deduplicated for the current page: a single candidate is executed directly via CUA without requesting Jev; multiple candidates request Jev selection; no candidates are handed back to Codex for inspection. After single-candidate execution, return action_executed, and with no candidates return no_candidates, and Codex verifies and chooses the subsequent execution method, avoiding repeated clicks in a loop while the same button is still visible.
"A single candidate" refers to the actions allowed by the current task, not that there is only one button on the page, nor does it mean the task is complete. Before calling, narrow controls and policy, including only the actions actually allowed to be executed at the current stage; do not delete other necessary candidates just to trigger direct execution. Direct execution still retains page updates, origin, time budget, and action failure checks.
Whether the task is complete is evaluated uniformly by the Codex main model. The bridge only reports operations and stop reasons; Jev only selects actions or hands back control, and does not provide DONE or task success judgments. Codex may make an evaluation based on page state and code inspection, and does not add to the bridge isDone、stopWhen and other nonexistent parameters.
Takeover and acceptance
session.run() Returning only ends the current Jev loop; it does not close the browser, roll back completed actions, or reset the CUA. Subsequent code will still execute; first check status and the actual state, and do not unconditionally send or retry after returning.
| Return status or phenomenon | Handling |
|---|---|
action_executed / no_candidates / handoff |
respectively indicate that the operation has been executed, there are no candidates, and Jev has handed back control; Codex reads the new page, independently evaluates the task, and decides the next step |
low_confidence |
Check whether it has already been completed; if it has already been submitted, accept and finish, and do not send it again due to low confidence |
step_limit / budget |
This is not an action failure; first confirm whether it is complete, then decide whether to continue a bounded execution block |
blocked / no_progress / loading_timeout |
Check the page, wait deterministically, or take over; when the same state appears again, stop blind retries and reselect the execution method |
decision_error / action_error / Exception |
Check whether some operations have already taken effect; do not blindly retry authentication, quota, or configuration errors, and do not switch providers to bypass them |
state_read_error / state_validation_error |
has stopped and retained history and statistics;stateMayBeStale indicates that the returned page may be stale; read the new page before judging; for action status fields, see Run interface |
| After scrolling, the AX text has not changed | When necessary, use screenshots for acceptance; do not conclude that there was no scrolling based only on identical text |
Completion conditions must be bound to the current round's object. Send success cannot be determined only by the presence of old messages on the page; the current message or the corresponding new state must be checked; generation completion cannot be determined only by the presence of an old answer. Waiting for text matching can only prove that the text appeared, and cannot independently prove business success.
Confidence does not represent accuracy, and the threshold is not lowered just to force completion. When the result cannot be confirmed, mark it truthfully as unverified; business content and visual effects are accepted by Codex.
Reporting and effect evaluation
For normal tasks, briefly explain the result, uncovered items, and necessary takeover situations. Summarize only when the user is evaluating efficiency or debugging the integration: end-to-end duration, Jev API duration, executed actions, number of Codex takeovers, retries, and acceptance results.
Distinguish API decision time, browser operation time, and page generation wait time; do not treat a single decision of about one second as proof of overall speedup. When comparing direct CUA with Jev, use the same starting state, task, and acceptance criteria, and preferably conduct it on a resettable synthetic page; do not repeatedly send real messages or modify real data for benchmarking. When there is no same-condition control, clearly state that "the overall efficiency benefit has not yet been verified."