Repository navigation
fix(browser): fit reflex dropdowns by offered options, pin the 512 total - #36729
Conversation
A reflex target head holds at most TARGET_CAP options, and a dropdown that does not fit is skipped whole. The fit check counted every option the row has, before the offer filter dropped the risky and withdrawn ones, so a dense page could hide a dropdown whose few offered options would have fit. The check now counts only what the row will offer; a row that still does not fit is skipped whole and its new moves are not kept. A whole request must stay within Laya's 100 options per Choice and 512 per request. That held only because separate constants add up (40 moves, WAIT and 4 targeted operations, 20 values, 4 heads of 100), and the test that checked it built a fixed 40 keys and 20 values, so it kept passing whatever the caps said. The values cap is named (MAX_VALUES) and the test builds the largest request the caps allow, from MAX_ACTIONS, MAX_VALUES, TARGET_CAP and TARGETED, so raising any of them past Laya's limits turns it red. Closes #32573
UX Review (Opus 5.5) — ⏭️ skippedRevision |
First Principles Review (Opus 5.5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Nothing blocks. The fit check now counts only the options the loop will offer, which fixes the cause. The rewritten test is built from the caps themselves, so raising any cap past Laya's limits turns it red. What this change shipsInventory (5 items) — 4 justifiedIntent: let the reflex loop offer every dropdown whose offerable options fit the 100-option head, and make the 512-total test fail when a cap is raised past Laya's limits. This is a FIX.
[FIRST-PRINCIPLES-REVIEWED] 3cf0c37 Description read[DESCRIPTION-READ] 5fc4f45223c2723afb0a194f4e23f4bab69d61391f0a4e0d449efac093c98353 That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the fit check now counts the same options the request sends, and the limit test is built from the caps themselves. Notes
[DESIGN-REVIEWED] 3cf0c37 Description read[DESCRIPTION-READ] 3239b53ee43aae3ab14f38e4f358de6fa24470f93153b58bfa30402bc41c7316 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findingsGPT 6.1 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
buluoray
left a comment
There was a problem hiding this comment.
Approve on 3cf0c37. The reflex loop now checks whether a dropdown fits its target head by counting only the options it will actually offer, so a mostly withdrawn dropdown on a long form stays reachable. A dropdown that still does not fit is skipped whole and none of its new moves are kept. The largest-request test is now built from the caps themselves, so raising the moves cap or the values cap past 512 options turns it red. Each guard has a test that fails without it. Nothing reads page text into a selector: a select target is still a ref plus an integer option index, and the executor re-checks the guard before input. One backend shard lost its runner and produced no test result, so the coverage gate failed closed; that shard needs a rerun before merge. Decisive lines: src/kiro_crew/browser_harness/reflex_space.py:154-173, test/test_browser_reflex.py:700-710, test/test_browser_reflex.py:667-698
|
[operator: bolichen97] The one blocking readiness item on
A red that is also red on |
Problem / Motivation
Goal: A reflex decision request offers every dropdown whose offered options fit in its target head, and the test that guards Laya's option limits fails as soon as a cap that sizes the request is raised past them.
The browser
reflexloop asks the model to pick a target from a head of at most 100 options, and a dropdown that does not fit is skipped whole. The fit check counted all of a dropdown's options, including the ones the loop had already withdrawn or judged risky and would never offer. So with 90 options in the head, a 50-option dropdown with 45 options withdrawn was hidden, although its 5 remaining options fit.Separately, a whole request must stay within Laya's 100 options per question and 512 per request. That held only because separate caps add up to 465, and the test that checked it used a fixed 40 keys and 20 values, so it would keep passing if any cap were raised.
Why it matters
On a dense page, such as a long form, the model can lose a dropdown it could still use, so the loop cannot reach that choice and ends early. And if someone raises a cap (more moves, more values, bigger heads), Laya starts refusing every reflex request again, the failure #32246 fixed, while the test stays green.
Not a goal
MAX_ACTIONS, the values cap,TARGET_CAP) or Laya's limits.What changed (motivation → approach → change)
reflex_space.buildfilters a row's options throughofferfirst, then checks the fit on what will be offered; a row that still does not fit is skipped whole and its new moves are not keptMAX_VALUESinreflex.py, and the largest-request test builds the largest request the caps allow and checks its exact size against themThe fit check now sees the same options the request sends. An option the loop withdrew, or judged too risky to offer, takes no room, so a mostly withdrawn dropdown on a long form stays reachable. An element the loop already knows is still refreshed before the filter, and its risk judged again when its words changed; that now also happens in a row the head then skips, which is safe because an answer is checked against the guard its own request saw.
The largest-request test asks for
MAX_ACTIONSmoves, WAIT, every targeted operation andMAX_VALUESvalues, on a page that fills every target head toTARGET_CAP. It checks that the request has exactly the sizes those caps allow, then that it fits Laya's 100 and 512. Raising any cap grows the request, and past Laya's limits the test fails. The reflex Request row indocs/system-specs/modules/browser.mdsays the fit counts only offered options.Backwards compatibility
Compatible: a request gains only the dropdowns whose offered options fit; every cap, the request's shape and the 465-option bound are unchanged.
Removes nothing: the values cap keeps its value of 20 under a name, and the fit check only lets through rows the old check skipped.
Tests
test_a_dropdown_fits_by_the_options_it_offers(new): with 90 options in the head, a dropdown with 45 of its 50 options withdrawn offers its other 5; the next dropdown, which does not fit, adds no moves to the loop's memory.test_the_largest_request_keeps_within_laya_s_option_limits(rewritten): builds the request fromMAX_ACTIONS,MAX_VALUES,TARGET_CAPandTARGETED, asserts the exact sizes, then Laya's 100 per question and 512 per request.test_a_dropdown_that_does_not_fit_does_not_hide_the_ones_after_it: unchanged behaviour, now using the shared_dropdownhelper.Proof: PROVEN test/test_browser_reflex.py::test_a_dropdown_fits_by_the_options_it_offers (head 3cf0c37)
Determinism:
test/test_browser_reflex.py(49 tests) passed 20 runs in a row with-n0, once with-n 4 --dist loadgroup, and once in a shuffled order (seed 30892, node ids passed in that order).Manual verification
Reproduced and smoke-tested on Linux (Ubuntu 24.04, x86_64). The product path needs a live decision provider, but the request is built by pure code, so the runs drive
reflex_space.buildand the largest-request test directly.buildoffered none of that dropdown (e3 offered: []). WithMAX_ACTIONSraised to 90, or the values cap raised to 70, the old largest-request test still passed although the request would carry 515 options.e3:45toe3:49(95 options) and the next 50-option dropdown is skipped whole with none of its moves kept. The rewritten test fails withMAX_ACTIONS = 90and withMAX_VALUES = 70(515 > 512), passes withMAX_ACTIONS = 50(475) and unchanged (465).test/test_browser_reflex.pypass, including the unchanged dropdown-skip test.Screenshots / video
N/A — no frontend or user-visible UI change.
Related Issues
Closes #32573
Builds on #32246.
Sibling sweep
Swept: git grep -nE "TARGET_CAP|MAX_OPTIONS|_space.build" -- src/kiro_crew/browser_harness/
Sibling: src/kiro_crew/browser_harness/decide.py:152 -- not affected --
_prefilterkeeps the best-matching options and filters nothing after its countPattern harvest
Rule candidate: review-prompt
Pattern: a test that pins a limit derived from several caps builds its inputs from literals instead of those caps, so raising a cap keeps it green
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)