Skip to content

refactor(sandbox)!: retire terminal proxy seam (0.45.0) - #353

Merged
vutuanlinh2k2 merged 1 commit into
mainfrom
refactor/350-retire-terminal-proxy
Jul 30, 2026
Merged

refactor(sandbox)!: retire terminal proxy seam (0.45.0)#353
vutuanlinh2k2 merged 1 commit into
mainfrom
refactor/350-retire-terminal-proxy

Conversation

@vutuanlinh2k2

Copy link
Copy Markdown
Contributor

Summary

  • Removes the deprecated same-origin terminal connection handler, runtime relay,
    WebSocket upgrade relay, HMAC proxy-token module, supporting helpers, and
    their tests. The browser-direct createSandboxTerminalConnectionRoute is now
    the package's only terminal transport.
  • Preserves createWorkspaceSandboxManager and its companion types by moving
    them into workspace-sandbox-manager.ts; the ./sandbox subpath itself and
    every direct-transport export remain intact.
  • Updates the terminal ownership notes and regenerates all agent-docs
    outputs. The generated ./sandbox surface drops from 150 to 119 exports, and
    no removed proxy symbol remains in src, tests, generated docs, or the
    built declarations.
  • Bumps both package manifests from 0.44.60 to 0.45.0. This is a breaking
    removal of published exports; on a pre-1.0 package, consumers on
    ^0.44.60 will not pick up 0.45.x automatically.

Closes #350. Completes the final cleanup tracked by #343.

Zero-importer audit

All four migration gates are closed:

  • tangle-network/legal-agent#328
  • tangle-network/creative-agent#467
  • tangle-network/tax-agent#450
  • tangle-network/gtm-agent#695

I queried GitHub's org-wide code search once per deprecated export, excluding
this repository:

gh api -X GET search/code \
  -f q="$symbol org:tangle-network -repo:tangle-network/agent-app" \
  -f per_page=100

These 24 exports returned total_count: 0 outside agent-app:

TerminalProxyIdentity
mintTerminalProxyToken
verifyTerminalProxyToken
SandboxTerminalTokenOptions
SandboxTerminalTokenSubject
SandboxTerminalTokenResult
createSandboxTerminalToken
verifySandboxTerminalToken
AuthenticatedSandboxUser
WorkspaceSandboxConnectionHandlerOptions
WorkspaceSandboxConnectionArgs
sandboxSidecarProxyUrl
WorkspaceSandboxRuntimeProxyHandlerOptions
WorkspaceSandboxRuntimeProxyArgs
SandboxTerminalWsMatch
matchSandboxTerminalWsPath
isSandboxTerminalWsUpgrade
WorkspaceSandboxTerminalUpgradeHandlerOptions
TerminalUpgradeResponseLike
terminalUpgradeSubprotocolEcho
buildSandboxRuntimeProxyHeaders
encodeSandboxRuntimePath
bearerSubprotocolToken
terminalTokenFromRequest

The remaining seven names returned text matches, but none is an importer. I
fetched every hit from its repository's current default branch with the
GitHub Contents API to classify it:

Symbol Current-branch result
createWorkspaceSandboxConnectionHandler Creative/Tax matches are negative source assertions; GTM source matches were stale search-index entries and the current route imports createSandboxTerminalConnectionRoute.
createWorkspaceSandboxRuntimeProxyHandler Creative's match is a negative assertion; the current package-qualified search returns zero.
createWorkspaceSandboxTerminalUpgradeHandler GTM/Creative/Tax matches are negative assertions that worker relay wiring is absent.
selectedBearerSubprotocol GTM's match is in the same negative assertion test.
SandboxApiCredentials Matches are local getSandboxApiCredentials names or negative assertions, not imported agent-app types.
SandboxRuntimeConnection Matches are repo-local structural types/functions in GTM, Creative, and Legal; their agent-app import lists do not contain this name.
bearerToken Matches are ordinary local parameter/function names; no agent-app import list contains this export.

The original checkout and origin/main were both
9a705616821302f1458b98a98b53d04359888603; a final fetch before push still
showed the branch based directly on current origin/main.

Test plan

  • pnpm typecheck — clean
  • pnpm test — 232 files passed; 3,863 passed / 0 failed / 13 skipped
  • pnpm build — ESM and declaration builds clean; retained manager exports
    are present and all removed proxy exports are absent from
    dist/sandbox/index.d.ts
  • pnpm knip — exit 0 (configuration hints only)
  • pnpm docs:gen — 82 files / 78 entries regenerated
  • pnpm install --frozen-lockfile --ignore-scripts — clean
  • rg over all 31 removed export names in src tests docs — zero matches
  • git diff --check — clean

Local macOS note: the full test command used /private/tmp plus a test-only
shell wrapper selecting GNU base64, avoiding the machine's unrelated
.bash_profile errors and /tmp/private/tmp canonicalization mismatch.
No source or test behavior was changed for that host setup.

Remove the deprecated same-origin connection, runtime relay, WebSocket upgrade, and HMAC token exports after the fleet migrated to the browser-direct scoped-token route. Keep the generic workspace sandbox manager in its own module and regenerate the API docs.

BREAKING CHANGE: removes the deprecated terminal proxy exports from @tangle-network/agent-app/sandbox; use createSandboxTerminalConnectionRoute.

Closes #350
@vutuanlinh2k2
vutuanlinh2k2 merged commit f49e62b into main Jul 30, 2026
1 check passed
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.

[REFACTOR] Retire the deprecated terminal proxy seam after the fleet migrates (zero-importer audit)

1 participant