Repository navigation
Description
Status: fix implemented in #193 — checked/enabled state now renders for labeled controls; absent/invalid attributes render as ? (unknown, not implicitly OFF).
Problem
format_minimal_list_with_elements() produces a compact UI observation with
the element's label and bounds, but does not expose explicit XML checked
and enabled values for labeled controls.
Consequently, an ON and an OFF switch with the same label and location can
produce identical model-facing text, despite Android providing the state.
This is a general observation-formatting issue, independent of model provider
or execution profile, and should be addressed separately from local-model
integration in #176.
Minimal Reproduction
No device or model call is needed:
from artemis.utils.visualization import format_minimal_list_with_elements
def render(checked):
node = {
"class": "android.widget.Switch",
"content-desc": "Dark theme",
"resource-id": "com.android.settings:id/switchWidget",
"checkable": "true",
"checked": checked,
"enabled": "true",
"bounds": "[901,1661][1038,1787]",
}
return format_minimal_list_with_elements([node], 1080, 2400)[0]
print(render("true"))
print(render("false"))
assert render("true") == render("false")The compact output in both cases is:
[1] Text: 'Dark theme' | Bounds: [834,692][961,744]
The omission is present in the formatter at the current PR base,
351ca8422f7b5b54e80a9c1ce03a222e02415b6b, and was reproduced on a branch
based on that revision. The same difference was confirmed using captured
Android Settings XML.
Expected Behavior
- Preserve relevant explicit control state in the compact model observation,
including labeled switches/checkboxes, not just label/bounds. - Keep
checked(current checked state) distinct fromenabled
(whether the control is enabled). - Treat absent or invalid attributes as unknown, not implicitly OFF/false.
- Preserve element identities, indices, coordinate conventions and OCR
provenance. - Add regression coverage for true, false, missing/invalid state, and disabled
controls.
This issue does not propose automatic task completion, coordinate snapping,
or a change to the agent's decision policy. Exposing the missing evidence is
the first step; any task-success improvement still needs live validation.
Activity
guP0an commentedon Oct 21, 2026
I'd like to take this on. I reproduced the identical ON/OFF/disabled observations on current main (
351ca842). I'll preserve explicitcheckedandenabledstates in the compact observation and structured element metadata, keep missing/invalid values unknown, and add regression tests for state parsing, identity/coordinates, and OCR provenance.banggaoo commentedon Oct 23, 2026
Addressed in #193.
format_minimal_list_with_elements()now renders explicitchecked/enabledstate for checkable controls on the compact observation line, so an ON and an OFF labeled Switch no longer produce identical text. The issue's minimal repro now yields:Behavior details:
checkedandenabledare rendered as separate fields.?— unknown, not implicitly OFF.enabled:falsewhen explicitly disabled; plain enabled elements get no annotation.Regression coverage in
tests/unit/utils/test_compact_control_state.py(9 tests: true, false, missing→?, invalid→?, disabled checkable and non-checkable, no-noise baseline, element-dict carrying, identity/index/bounds preservation). Fulltests/unit/utils+test_hierarchy_fidelity.py: 153 passed.Live task-success impact is not claimed here — per the issue's note, that needs a device sweep.