Skip to content

fix(computer): harden benchmark harness seams and scorer gates - #1196

Open
jeffrey-bin wants to merge 1 commit into
mainfrom
fix/cua-eval-harness-scorer-seams
Open

jeffrey-bin wants to merge 1 commit into
mainfrom
fix/cua-eval-harness-scorer-seams

Conversation

@jeffrey-bin

Copy link
Copy Markdown
Contributor

Summary

  • Decode nested JSON tool arguments before evaluating Tier 1 window binding in run_ab.py, reject failed or wrong-window activity ahead of fixture-journal and candidate checks, and accept fixture_pid, window_id, hwnd, app_path stems, and active-window reads on zero-click short-desk-read trials.
  • Scale Tier 1 speed parity thresholds across eligible reference cases (max(1, eligible - 1) when eligible >= 2, 1 when eligible == 1, fail-closed when 0) in tier1/score.py.
  • Add bounded retry options (maxRetries: 5, retryDelay: 100) on temporary benchmark directory cleanup, forward incoming Authorization, x-api-key, and Accept headers in startModelSpy, propagate quote-safe custom [model_providers.*] blocks and profile providers from regular ~/.codex/config.toml files into isolated Codex configs, and support validated --engine and --quantization flags in run_small_model.mjs.

Verification

  • python3 -m unittest discover -s apps/computer/benchmarks/ui-benchmark -p "test_*.py" -v (17 passed)
  • node apps/computer/benchmarks/real-app-eval/test_real_app_eval.mjs (14 passed)
  • VITEST_MAX_WORKERS=1 pnpm --filter @linger/computer check
  • make check-repository-gate BASE=origin/main

@linger-review linger-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Request changes (2 P1, 1 P2) · merge base 13ebbbe · 1 commit, 10 files

Findings

P1

  • apps/computer/benchmarks/ui-benchmark/run_ab.py:2022 — _verify_window_binding short-circuits on _has_fixture_interaction(trial_dir) before running _targets_other_window(...) (line 2034), which contradicts the PR description and commit message ("reject failed or wrong-window activity ahead of fixture-journal and candidate checks"). In an interactive native trial (desk or long-desk) where fixture-events.jsonl records a confirm/click event, completed wrong-window activity such as ui.app("Calculator") or get_window_state({ pid: 99999 }) still returns True (test_benchmarks.py:1542-1563 only checks failed-only activity against interactive_dir). Move string_candidates, numeric_ids, _collect_window_binding_evidence, and the _targets_other_window guard ahead of if _has_fixture_interaction(trial_dir): return True, and add a regression test with wrong-window completed activity and an interactive fixture journal.

  • apps/computer/benchmarks/real-app-eval/lib/remote_lib.mjs:1889 — buildIsolatedCodexConfigToml resolves extracted.profileProvidersByModel[effectiveModel] before extracted.rootModelProvider (line 1892) and even when hasAuthJson is true, allowing any inactive [profiles.<name>] entry to override the active top-level configuration (unlike Codex's actual precedence in apps/computer/local-daemon/internal/provider/context_length.go:190-195). If ~/.codex/config.toml sets top-level model_provider = "primary" (or uses default OAuth with auth.json and no root profile/model_provider) alongside an inactive [profiles.backup] declaring model = "gpt-6.2-sol" and model_provider = "backup", buildIsolatedCodexConfigToml({ model: "gpt-6.2-sol", ... }) routes the run to "backup", violating the OAuth-preservation invariant in test_real_app_eval.mjs:2974-2975. Check extracted.rootModelProvider ahead of profileProvidersByModel, and gate inactive-profile fallback on !hasAuthJson (or drop it so only active rootProfile, rootModelProvider, explicit provider/model, or single-provider !hasAuthJson selects a custom provider) with unit tests covering both cases.

P2

  • apps/computer/benchmarks/ui-benchmark/run_ab.py:1972 — Inside _collect_window_binding_evidence, the JS code regex \b(?:pid|fixture_pid|window_id|windowid|hwnd)\s*['"]?\s*:\s*(\d+)\b only matches unquoted decimal integers, whereas _parse_positive_int_token (lines 1836-1850) supports both quoted strings and 0x hex handles for structured arguments. In ui_exec code on short-desk-read, a valid hex handle (get_window_state({ hwnd: "0x21c0" }) for window_id: 8640) fails to bind (False), while a wrong-window hex or quoted ID (get_window_state({ hwnd: 0x9999 }) or { pid: "99999" }) combined with get_window_state({}) bypasses _targets_other_window (True). Match ['"]?(0x[0-9a-f]+|\d+)['"]? and normalize each captured token through _parse_positive_int_token(raw) or raw.

Checked: Codex profile precedence (context_length.go:190-195) · Tier 1 ready metadata (fixture.py:39) · parity gate consumer (summarize_3os.mjs:206)

Unverified: product_chain test and @linger/computer check

CI: 5 checks passed; benchmark suites and @linger/computer checks do not run in CI


Automated review of 74217fc by Antigravity.

Decode nested JSON tool arguments before evaluating Tier 1 window binding,
reject failed or wrong-window activity prior to fixture-journal and candidate
checks, and accept fixture_pid, window_id, hwnd, app_path stems, and
active-window reads on zero-click short-desk-read trials.

Scale Tier 1 speed parity thresholds across eligible reference cases
(max(1, eligible - 1) when eligible >= 2, 1 when eligible == 1) so web-only
reference runs do not fail a 9-case constant.

Add bounded retry options on temporary benchmark directory cleanup, forward
incoming Authorization and x-api-key headers in startModelSpy, propagate
quote-safe custom [model_providers.*] blocks and profile providers from
regular ~/.codex/config.toml files into isolated Codex configs, and support
validated --engine (including strata alias) and --quantization flags in
run_small_model.mjs.
@jeffrey-bin
jeffrey-bin force-pushed the fix/cua-eval-harness-scorer-seams branch from 74217fc to 1fb4cef Compare December 5, 2026 15:47

@linger-review linger-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Request changes (1 P1) · follow-up on 74217fc · merge base 13ebbbe · 1 commit, 10 files

Resolved: wrong-window before fixture interaction (run_ab.py:2036) · root provider precedence (remote_lib.mjs:1889) · hex/quoted JS window IDs (run_ab.py:1968, 1975)

Findings

P1

  • apps/computer/benchmarks/ui-benchmark/run_ab.py:1974 (also lines 1901–1903, 1917–1921, 1937–1938, 2009–2011) — Linux calls passing window_id fail window-binding checks, including interactive trials
    • Problem: On Linux, tier1/gtk_fixture.py:93 emits only pid and fixture_pid in ready_info (no window_id or hwnd), whereas localtools/linux.go:38-48 returns { window_id, pid } from list_windows and instructs the agent to pass window_id (and optional pid) to get_window_state, focus_window, and bring_to_front. Meanwhile _collect_window_binding_evidence groups positional ui.window(pid, wid) arguments together (run_ab.py:1968-1973), but emits every key in a JSON object (walk, lines 1901–1938) or JS object literal (run_ab.py:1974-1979) as a separate single-element group [[pid], [window_id]].
    • Failure scenario: Any Linux Tier 1 native trial (short-desk-read, desk, or long-desk) where the model calls get_window_state({ pid: <fixture_pid>, window_id: <x11_wid> }) or get_window_state({ window_id: <x11_wid> }) (via ui_exec or a direct MCP tool call) produces a standalone [<x11_wid>] group that is not in numeric_ids ([<fixture_pid>]). Because _targets_other_window now runs ahead of _has_fixture_interaction(trial_dir) (run_ab.py:2036-2039), _verify_window_binding returns False even when pid matches and fixture-events.jsonl recorded genuine confirm/click interactions on the fixture window, causing tier1/score.py to reject the trial.
    • Fix: Group _WINDOW_ID_KEYS appearing together in the same JSON dict or JS { ... } object literal into a single group (consistent with ui.window(pid, wid)), and have tier1/gtk_fixture.py emit the X11 window_id in ready_info so window_id-only Linux calls can be verified directly against the fixture metadata. Add unit tests covering Linux { pid, window_id } and { window_id } calls on both read-only and interactive tasks.

Checked: Linux fixture ready payload (gtk_fixture.py:93) · Codex config file guard (remote_lib.mjs:1980) · Tier 1 parity gate consumers (summarize_3os.mjs:206)

Unverified: live multi-OS benchmark runs · product_chain prompt export test (no local node_modules)

CI: 5 triggered checks passed; CI does not run computer benchmark unit tests


Automated review of 1fb4cef by Antigravity.

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.

1 participant