Skip to content

fix(web): isolate same-origin agent view lifecycles - #144

Merged
tusharbhardwaj-bk merged 2 commits into
expbkmainfrom
t3code/nassau
Aug 29, 2026
Merged

fix(web): isolate same-origin agent view lifecycles#144
tusharbhardwaj-bk merged 2 commits into
expbkmainfrom
t3code/nassau

Conversation

@tusharbhardwaj-bk

@tusharbhardwaj-bk tusharbhardwaj-bk commented Aug 29, 2026

Copy link
Copy Markdown

What Changed

  • Coordinate URL-backed agent views by normalized origin so only one inline or expanded iframe is live at a time.
  • Switch ownership through an empty commit, then mount a fresh iframe from the exact stored URL.
  • Add Chromium credentialless isolation to cross-origin URL frames while preserving the opaque self-origin sandbox.
  • Make Node, Vite, hosted web, and desktop HTML shells unframeable to close redirect-based sandbox escapes.
  • Document browser support and authenticated-app limitations.

Why

Two immutable agent-view renders can point at different fragment-addressed rooms on one origin. Keeping both iframes mounted lets the apps share origin storage and collaboration channels, so a later card can display stale state from the earlier room even though its render ID and stored URL are correct.

The lifecycle is now serialized by origin and tested at the DOM-node boundary. credentialless adds an ephemeral Chromium partition for the top-level T3 document; it is intentionally documented as defense in depth, not per-render storage isolation. Firefox and Safari retain the exclusive remount lifecycle.

UI Changes

Historical same-origin URL cards remain visible but inactive cards show Open this view. Selecting one disconnects the current iframe before mounting a new node. The focused DOM suite records detach-before-attach and exact src values for A → B → A and expanded/pending switches.

Deployed screenshots and an interaction recording will be attached from the experimental environment during the required post-merge verification; no room fragments or keys will be captured.

Verification

  • apps/web: 16 focused agent-view unit/DOM tests passed.
  • apps/server: 147 focused Agent UI and static-router tests passed.
  • Hosted/desktop framing tests: 9 passed.
  • Web, server, and desktop package typechecks passed.
  • Fork marker check passed.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Written by GPT-5.6-Sol in T3 Code (Codex harness).


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Serialize URL frames by normalized origin, remount through an empty committed state, and use Chromium credentialless storage without weakening the self-origin sandbox. Make every T3 HTML shell unframeable so redirected embeds cannot escape the sandbox.

Cover exact fragment preservation, same-origin A-to-B-to-A DOM replacement, expanded handoffs, hosted and desktop framing headers, and browser fallback behavior.

Written by GPT-5.6-Sol in T3 Code.
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Aug 29, 2026
@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown

Thread transfer impact

✅ Thread transfer remains within every enforced ceiling.

ℹ️ No successful main baseline artifact is available yet. This run establishes the initial measurement.

Provider Metric Main baseline This PR Impact PR ceiling
Codex Total thread wire 13.5 KiB 15.1 KiB
Codex Thread snapshot wire 7.2 KiB 7.3 KiB
Codex Live turn WebSocket wire 6.4 KiB 7.8 KiB
Codex Live turn WebSocket decoded 55.6 KiB 66.4 KiB
Codex Live turn messages 10 21
Claude Total thread wire 13.5 KiB 15.1 KiB
Claude Thread snapshot wire 7.2 KiB 7.3 KiB
Claude Live turn WebSocket wire 6.4 KiB 7.8 KiB
Claude Live turn WebSocket decoded 56.5 KiB 66.4 KiB
Claude Live turn messages 10 21

Baseline: unavailable · PR result: 9472e8d · Source CI: success

Scenario and decoded snapshot size

10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.

  • Codex decoded thread snapshot: 110.4 KiB
  • Claude decoded thread snapshot: 111.1 KiB

Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed.

Keep the fake browser globals installed until React's development scheduler drains its queued Immediate. This prevents CI teardown from surfacing window-is-undefined errors after every assertion already passed.

Written by GPT-5.6-Sol in T3 Code.
@tusharbhardwaj-bk
tusharbhardwaj-bk merged commit 7a248a3 into expbkmain Aug 29, 2026
22 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant