Skip to content

Fix/post v0.7 review#22

Open
synacktraa wants to merge 4 commits into
masterfrom
fix/post-v0.7-review
Open

Fix/post v0.7 review#22
synacktraa wants to merge 4 commits into
masterfrom
fix/post-v0.7-review

Conversation

@synacktraa

Copy link
Copy Markdown
Owner

Post-v0.7 review pass. Three Codex findings + a template rename that became too coupled to split cleanly.

Summary

  • P1 — completion race on operator arrival. Detection listeners (framenavigated, DOM mutations) only fire on new events. Any transition into the completion state between session registration and first-connect was lost — the handoff would sit waiting for a future event that never came and time out on completion_timeout. Fires in practice on redirect chains (OAuth /callback, meta-refresh) or any autonomous navigation during the operator-arrival window. Re-probe on connect (LLM included now that the wrapper is loaded) and short-circuit if the state is already reached.

  • P2 — viewer keeps live focus after completion. In passthrough, the substrate iframe kept accepting keystrokes for as long as focus stayed there, even after the completion card appeared. In screencast mode the last frame lingered as a stale reference. Fix: defocus the iframe immediately so pending keystrokes stop hitting the substrate, hold the underlying frame for the ~300ms overlay fade-in so the page fades under the card instead of snapping to black, then blank the iframe (about:blank) or drop the last frame (revoke object URL, clear has-frame). Applied symmetrically to both templates.

  • Template rename by mode + move under server/. intervention.html and proxy_intervention.html are now screencast-mode.html and passthrough-mode.html under browser_handoff/server/templates/. "Intervention" was a generic verb; "proxy" was misleading (passthrough iframes a substrate viewer, it doesn't proxy). Naming by mode makes the two-mode design visible in the tree. Terminology swept across handoff.py, session.py, streaming.py, the templates' internal cross-references, tests, README, and example smoke tests. StreamingServer and server/streaming.py keep their names — the server hosts both modes.

  • P3 — remove the get_stream_url deprecated shim. Its docstring said "Removed in v0.7" while its warning said "Will be removed in v0.7" — self-contradictory in v0.7.x. Resolving toward the docstring. Callers were migrated to get_operator_url before v0.7.

Test plan

  • Local pytest — all suites green.
  • Manual smoke: passthrough shopping demo, confirm the fade-in reads as a smooth handoff-complete and the substrate iframe stops accepting input the moment the card appears.
  • Manual smoke: screencast-mode Heroku login, confirm the last frame drops after the completion card fades in (no broken-image flash).
  • Watch for the race fix in a real OAuth flow — pause with a /callback-URL completion condition, delay opening the operator link until after the redirect chain settles, confirm the handoff closes on connect instead of timing out.

🤖 Generated with Claude Code

synacktraa and others added 4 commits July 9, 2026 15:01
Detection listeners (framenavigated, DOM mutations) only fire on new
events, so any transition into the completion state between session
registration and first-connect was lost — the handoff would then wait
for a future event that never came and time out on completion_timeout.
Re-check on connect (LLM included now that the wrapper is loaded) and
short-circuit if the state is already reached.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Previously the substrate iframe (passthrough) kept live focus and
accepted keystrokes after completion, and the last stream frame
lingered in memory (streaming). Now: defocus the iframe immediately
so pending keystrokes stop hitting the substrate, keep the underlying
frame visible for the ~300ms fade-in so the page fades under the card
instead of snapping to black, then blank the iframe / drop the last
frame. Applied symmetrically to both templates.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- proxy_intervention.html -> server/templates/passthrough-mode.html
- intervention.html        -> server/templates/screencast-mode.html

The old names ("intervention" as a generic verb; "proxy" f
actually an iframe of a substrate viewer) obscured what each template
is for. Naming them by mode makes the two-mode design visi
tree. Living under server/ also disambiguates them from the top-level
package — they're a server-owned rendering detail.

Terminology harmonized across handoff.py, session.py, stre
the templates' internal cross-references, tests, README, and example
smoke tests. StreamingServer keeps its name — it hosts bot

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Its docstring said "Removed in v0.7" while the warning said "Will be
removed in v0.7" — self-contradictory in v0.7.x. Resolving toward the
docstring: it's gone. Callers were migrated to get_operator_url before
v0.7, so no live consumers remain.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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