Repository navigation
Conversation
* fix(inference): expose empty response metadata * fix(inference): classify empty responses Add a machine-readable category (provider_blocked, truncated, tool_calls_only, thinking_only, blocks_without_text, empty_stream, empty_content, no_response, no_message), read finish_reason from LiteLLM choices[0] / Gemini candidates[0] and pydantic raw payloads, and cover the handout's test cases (empty, safety, thinking-only, tool-only, empty stream, redaction, completion, structured). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(inference): trim diagnostics Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * fix(inference): classify adapter empties * fix(inference): classify responses truncation Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * refactor(inference): trim diagnostics and tests Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * fix(inference): keep str enum reasons Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Drop stale UI state after failed state reads, stop implying screenshot access when vision is off, treat empty WebViews as unread content, and require observed values or an explicit 'could not be read' with success=false in fast-agent and manager prompts.
lutz-grex
left a comment
There was a problem hiding this comment.
Thanks for the detailed write-up. Removing screenshot instructions when vision is off and invalidating stale UI evidence both address the reported problem.
Two test issues need fixing before merging:
tests/test_vision_off_grounding_prompt.py:48–63requires vision-on output to matchorigin/developexactly, but this PR also adds a Reading Values section for vision-on mode in the fast-agent and four manager templates. Please assert the intended prompt content instead of comparing against a moving Git ref. The current test also depends on historical prompt blobs being available in the checkout.tests/test_reasoning_state_grounding.py:47–58constructsManagerAgentwithobject.__new__without settingagent.vision, then calls a method that reads it atmobilerun/agent/manager/manager_agent.py:236. Please initialize that field in the fixture or remove the redundant new dictionary entry. Both managers already supplyvisionlater in the same dictionary (manager_agent.py:247andstateless_manager_agent.py:112).
A couple of follow-ups within this change:
- After
mobilerun/agent/fast_agent/fast_agent.py:375clearsaction_ctx.ui, UI-dependent actions should return an explicit unavailable-state/retry result.clickstill dereferences it atmobilerun/agent/utils/actions.py:264, and coordinate actions can reachctx.ui.convert_pointat:182. Please cover an attempted action after a failed state read, including a vision-on step with a fresh screenshot. - The Reading Values section is repeated in five templates and overlaps the new vision-off include. Could the common guidance use a shared include too?
- The supplied diff also changes
mobilerun/agent/utils/inference.pyandtests/test_inference_retries.py, which account for about half the changed lines. Could those diagnostics changes be split out so this PR stays focused on screen-state grounding?
The write-up correctly separates prompt guidance from an enforced guarantee. The reported model-specific reproduction still needs the matching verification run before claiming the behavior is fixed.
…ctions on missing state, split out inference diagnostics (DRO-3714)
…d-screen-values # Conflicts: # mobilerun/agent/fast_agent/fast_agent.py
lutz-grex
left a comment
There was a problem hiding this comment.
Thanks, everything from the last round landed: the prompt test asserts the intended content, the manager fixture no longer reads vision, UI actions after a failed state read return an explicit retry result with tests for all of them, Reading Values is one shared include, and the inference changes are split out. Approving.
|
Closing: this change already landed in another merged PR. |
Fixes DRO-3714: the task agent reports values that were never on screen, and the task still succeeds.
Root cause (reproduced on a real cloud phone)
5 of 5 real tasks (
mobilerun/mobile-agent-fast, vision off, FastAgent) readhttps://ipinfo.io/jsonin Chrome and returnedsucceeded: truewith invented values. The values the agent reported (city, country, ASN/org) did not match what the page actually showed.Web View, with no JSON. A later snapshot did contain the JSON, so this is a timing delay.fast_agent/system.jinja2said "Analyze the current device state and screenshot" even with vision off. The model then wrote "Looking at the screenshot, the JSON displays…" and invented plausible values.complete()is self-reported. The answer and the success flag are accepted without any check.Changes
fast_agent/system.jinja2)Web Viewis not page content: wait, re-read, or report that the value could not be read.success=falsewhen a requested value was not read.complete()tool description (signatures.py): the same grounding rules.visionto prompt rendering.fast_agent.py): after a failedget_state(), the stale UI state is dropped and the model gets an "unavailable" notice instead of the previous screen.tests/test_fast_agent_state_grounding.pyandtests/test_reasoning_state_grounding.py.Verification
pytest -q: 1625 passed, 41 subtests passed.ruff checkon the changed files andgit diff --checkare clean.Not yet verified
success=truewhen no readable page content was observed.reasoning=falseeven whenreasoningwas omitted. The local tasks-api default istrue, so this needs checking separately.