Repository navigation
fix(computer): harden benchmark harness seams and scorer gates - #1196
jeffrey-bin wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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_bindingshort-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 (deskorlong-desk) wherefixture-events.jsonlrecords aconfirm/clickevent, completed wrong-window activity such asui.app("Calculator")orget_window_state({ pid: 99999 })still returnsTrue(test_benchmarks.py:1542-1563only checks failed-only activity againstinteractive_dir). Movestring_candidates,numeric_ids,_collect_window_binding_evidence, and the_targets_other_windowguard ahead ofif _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—buildIsolatedCodexConfigTomlresolvesextracted.profileProvidersByModel[effectiveModel]beforeextracted.rootModelProvider(line 1892) and even whenhasAuthJsonistrue, allowing any inactive[profiles.<name>]entry to override the active top-level configuration (unlike Codex's actual precedence inapps/computer/local-daemon/internal/provider/context_length.go:190-195). If~/.codex/config.tomlsets top-levelmodel_provider = "primary"(or uses default OAuth withauth.jsonand no rootprofile/model_provider) alongside an inactive[profiles.backup]declaringmodel = "gpt-6.2-sol"andmodel_provider = "backup",buildIsolatedCodexConfigToml({ model: "gpt-6.2-sol", ... })routes the run to"backup", violating the OAuth-preservation invariant intest_real_app_eval.mjs:2974-2975. Checkextracted.rootModelProviderahead ofprofileProvidersByModel, and gate inactive-profile fallback on!hasAuthJson(or drop it so only activerootProfile,rootModelProvider, explicitprovider/model, or single-provider!hasAuthJsonselects 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+)\bonly matches unquoted decimal integers, whereas_parse_positive_int_token(lines 1836-1850) supports both quoted strings and0xhex handles for structured arguments. Inui_execcode onshort-desk-read, a valid hex handle (get_window_state({ hwnd: "0x21c0" })forwindow_id: 8640) fails to bind (False), while a wrong-window hex or quoted ID (get_window_state({ hwnd: 0x9999 })or{ pid: "99999" }) combined withget_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.
74217fc to
1fb4cef
Compare
There was a problem hiding this comment.
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 passingwindow_idfail window-binding checks, including interactive trials- Problem: On Linux,
tier1/gtk_fixture.py:93emits onlypidandfixture_pidinready_info(nowindow_idorhwnd), whereaslocaltools/linux.go:38-48returns{ window_id, pid }fromlist_windowsand instructs the agent to passwindow_id(and optionalpid) toget_window_state,focus_window, andbring_to_front. Meanwhile_collect_window_binding_evidencegroups positionalui.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, orlong-desk) where the model callsget_window_state({ pid: <fixture_pid>, window_id: <x11_wid> })orget_window_state({ window_id: <x11_wid> })(viaui_execor a direct MCP tool call) produces a standalone[<x11_wid>]group that is not innumeric_ids([<fixture_pid>]). Because_targets_other_windownow runs ahead of_has_fixture_interaction(trial_dir)(run_ab.py:2036-2039),_verify_window_bindingreturnsFalseeven whenpidmatches andfixture-events.jsonlrecorded genuineconfirm/clickinteractions on the fixture window, causingtier1/score.pyto reject the trial. - Fix: Group
_WINDOW_ID_KEYSappearing together in the same JSON dict or JS{ ... }object literal into a single group (consistent withui.window(pid, wid)), and havetier1/gtk_fixture.pyemit the X11window_idinready_infosowindow_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.
- Problem: On Linux,
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.
Summary
run_ab.py, reject failed or wrong-window activity ahead of fixture-journal and candidate checks, and acceptfixture_pid,window_id,hwnd,app_pathstems, and active-window reads on zero-clickshort-desk-readtrials.max(1, eligible - 1)wheneligible >= 2,1wheneligible == 1, fail-closed when0) intier1/score.py.maxRetries: 5, retryDelay: 100) on temporary benchmark directory cleanup, forward incomingAuthorization,x-api-key, andAcceptheaders instartModelSpy, propagate quote-safe custom[model_providers.*]blocks and profile providers from regular~/.codex/config.tomlfiles into isolated Codex configs, and support validated--engineand--quantizationflags inrun_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 checkmake check-repository-gate BASE=origin/main