Repository navigation
docs(skills): catch a browser session that dies mid-flow - #12951
Conversation
|
Intent: Make an agent recognise, in one probe rather than several wasted cycles, that an authenticated browser session died while it was working, and stop reading a page still on screen as proof the session is alive. |
Opus 4.8 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: |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the documented [DESIGN-REVIEWED] 20d61a1 |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify on a real attach session that re-attach actually drops What this change shipsInventory (6 items) — 6 justifiedIntent: stop the agent misdiagnosing a browser login that expires mid-flow in attach mode — an ADDITION of guidance, grounded in a reproduced incident written in the description. FIX-vs-ADDITION gap: none; description and diff describe the same job.
[FIRST-PRINCIPLES-REVIEWED] 20d61a1 |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 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: |
7d8168d to
9465d70
Compare
|
self-added: yes
|
|
|
Driving a real internal form through attach mode lost ~28 minutes to three failure modes none of the browser skills named, and two of those minutes-long detours were spent on a hypothesis the skills would have ruled out. Root causes, in the order they were hit: 1. The SSO session expired between two commands. The page already on screen kept rendering, so both the agent and the user read a working screenshot as proof the session was alive. Only the next request redirected. 2. The first symptom was not a login page but a click that timed out on "waiting for element to be visible, enabled and stable". The locator had resolved, so the ref was right; the app's background sync was failing auth and re-rendering. Reads as a selector bug, is not one. 3. attach exposes only the tab the extension was activated on, so tab-list is not a view of the browser and the tab the user was looking at could not be driven at all. 4. A token edited in the extension after the agent process started breaks attach with a message that names the token, which is easy to misread as a missing extension. browser-auth gains a "session can die mid-flow" section: a rendered page is not proof, a one-request probe whose printed Page URL is the whole verdict, the stability-timeout symptom, and a checkpoint rule for long forms. Its attach section gains the token-mismatch error with both fixes, plus the one-tab limit. web-browse gains the one-tab limit where it already explains attach binding. The token workaround is documented for the attach command only: carrying the env-stripped form forward in a shell variable trips the shell policy floor as credential access, and attach has already bound the session by then.
9465d70 to
20d61a1
Compare
|
Rebased: main moved in The red was not this diff. |
Driving a real internal form through attach mode lost ~28 minutes to three failure modes none of the browser skills named, and two of those minutes-long detours were spent on a hypothesis the skills would have ruled out. Root causes, in the order they were hit: 1. The SSO session expired between two commands. The page already on screen kept rendering, so both the agent and the user read a working screenshot as proof the session was alive. Only the next request redirected. 2. The first symptom was not a login page but a click that timed out on "waiting for element to be visible, enabled and stable". The locator had resolved, so the ref was right; the app's background sync was failing auth and re-rendering. Reads as a selector bug, is not one. 3. attach exposes only the tab the extension was activated on, so tab-list is not a view of the browser and the tab the user was looking at could not be driven at all. 4. A token edited in the extension after the agent process started breaks attach with a message that names the token, which is easy to misread as a missing extension. browser-auth gains a "session can die mid-flow" section: a rendered page is not proof, a one-request probe whose printed Page URL is the whole verdict, the stability-timeout symptom, and a checkpoint rule for long forms. Its attach section gains the token-mismatch error with both fixes, plus the one-tab limit. web-browse gains the one-tab limit where it already explains attach binding. The token workaround is documented for the attach command only: carrying the env-stripped form forward in a shell variable trips the shell policy floor as credential access, and attach has already bound the session by then.
What changed
Two builtin skill bodies now name the failure that costs the most time in attach
mode, a login that expires while the agent is still working:
src/kiro_crew/builtin_skills/browser-auth/SKILL.mdandsrc/kiro_crew/builtin_skills/web-browse/SKILL.md.browser-authgains a session can die mid-flow section. It says a page still onscreen is not proof the session is alive, because a loaded single-page app keeps
rendering after its cookie expires and only the next request redirects. It gives a
one-request probe instead: open a known gated page in a NEW tab and read the printed
Page URL— the target means live, an identity-provider host means dead. The probeuses a new tab on purpose, because in attach mode a same-tab navigation would discard
whatever the user had half-entered in the tab being driven. It adds the
symptom that does not look like auth at all, a click timing out on
waiting for element to be visible, enabled and stablewith the locator alreadyresolved, and says to probe and read the console before touching selectors. It closes
with a checkpoint rule for long forms.
The same skill's attach section now carries the token-mismatch error text with both
fixes, and says the extension link is the wrong answer to it. The token workaround is
scoped to the
attachcommand alone, because carrying the env-stripped form forwardin a shell variable is refused by the shell policy floor as credential access.
Both skills now state that attach exposes one tab, the one the extension was
activated on, so
tab-listis not a view of the browser and a page the user alreadyhas open needs their click on the extension icon before it can be driven.
Why
Driving a real internal form through attach mode lost about 28 minutes across five
cycles. Two of those cycles chased the wrong cause — a suspected Chrome profile or
headless problem — because nothing told the agent that a visible page proves nothing
and that a stability timeout can be an auth failure.
Backwards compatibility
No behaviour change. Documentation only, in two builtin skill bodies.
Testing
Ran the gates that cover this diff:
check_builtin_skill_scope.py,scripts/docs-lint.sh,check_brand_name.py,check_focus_cue.py,check_feature_map.py,check_changelog_history.py. All six pass. The rest of thefloor is unrelated to a markdown-only change and is left to CI.
no linked issue: this documents an incident hit while driving attach mode, not a tracked defect report.