feat: tangent - remote agent for runview and editor - #2728
Open
maxy-shpfy wants to merge 1 commit into
Open
maxy-shpfy wants to merge 1 commit into
maxy-shpfy wants to merge 1 commit into
Conversation
This was referenced Sep 17, 2026
🎩 PreviewA preview build has been created at: |
This was referenced Sep 17, 2026
Collaborator
Author
This was referenced Sep 17, 2026
maxy-shpfy
force-pushed
the
09-16-refactor_tangent_-_structured_workarea_target
branch
from
September 18, 2026 18:52
f8a57e6 to
b53519b
Compare
maxy-shpfy
force-pushed
the
09-16-feat_tangent_-_remote_agent_for_runview_and_editor
branch
from
September 18, 2026 18:52
c6bc6c4 to
4da5bd3
Compare
maxy-shpfy
force-pushed
the
09-16-refactor_tangent_-_structured_workarea_target
branch
from
September 18, 2026 19:13
b53519b to
5add1e9
Compare
maxy-shpfy
force-pushed
the
09-16-feat_tangent_-_remote_agent_for_runview_and_editor
branch
2 times, most recently
from
September 18, 2026 19:18
23b692a to
168c361
Compare
maxy-shpfy
force-pushed
the
09-16-feat_tangent_-_remote_agent_for_runview_and_editor
branch
from
September 18, 2026 19:28
168c361 to
593b8ab
Compare
maxy-shpfy
marked this pull request as ready for review
September 18, 2026 19:34
This was referenced Sep 18, 2026
Draft
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
Introduces the remote sub-agent runtime for Tangent, enabling Prime to spawn editor and run-inspector agents directly into embedded pipeline and run-view tabs. Each spawned agent runs in a dedicated Web Worker (
remoteEnvWorker.ts) backed bycreateRemoteEnvWorkerApi, which hosts multiple isolatedMemorySessioninstances and serializes turns per agent. The agent worker is wired to the tab's liveToolBridgeApivia Comlink, so CSOM mutations are undoable canvas edits visible in real time.Key additions:
remoteEditorAgent— a flat (non-routing) agent that receives a resolved CSOM tool allowlist and system prompt from Prime, selects the permitted tools from a mode-aware registry (full mutating surface foreditor, read-only inspect surface forrunView), and appends a tool-availability section and optional task-specific instructions to its base prompt.createRemoteEnvWorkerApi— the worker-side API:init,setAiConfig,setContext,spawnAgent,runTurn,abortAgent,killAgent. Turns are serialized per agent; overlapping turns for the same agent are rejected. Respawn correctly isolates old abort controllers from new ones.remoteEnvHost— upgraded from a pure tool-catalog host to a full spawn/message/kill orchestrator. Turns are chained peragentId, kill/disconnect abort in-flight turns without surfacing them as errors, and lifecycle events (start,activity,end,error) are streamed back to Prime viaagentEvent.connectRemoteEnvWithRefresh— extracted token-refresh loop with exponential back-off on failure,onConnectedcallback fired only after the socket resolves, and a stop function for clean teardown.TangentRemoteEnvProvider— shared transport component for any spawnable tab: boots the worker, connects with token refresh, pushes AI config and context changes into the worker without rebuilding the connection.TangentEditorAgentProvider/TangentRunAgentProvider— thin wrappers that build the appropriateToolBridgeApi(editor with live CSOM mutations, run view with read-only fetches) and hand it toTangentRemoteEnvProvider.EmbeddedPipelineEditorandEmbeddedRunView— extended withsessionId,environmentId, and environment/bridge lifecycle callbacks so the workarea shell can wire each tab into the project-level environment registry.TangentProjectContext— adds per-tab environment and bridge registries (registerTabEnvironment,waitForTabEnvironment,registerTabBridge,getActiveTabBridge) backed by refs so the routing bridge and workarea tools can read live state outside React's render cycle.createActiveTabRoutingBridge— aToolBridgeApithat forwards every call to whichever pipeline tab is currently active, giving the project-level editor agent a stable target as the user switches tabs.createWorkareaRemoteTools— extended with run-inspect tools (get_run_status,debug_pipeline_run,get_execution_details,get_execution_state,get_container_state,get_container_log) backed by a project-level backend bridge, andopen_workarea_targetnow waits for the tab's environment to connect before returning so Prime receives theenvironmentIdit needs to spawn into that tab.useLazyBridgeAuth— extracted hook providing stable lazy getters for backend URL and auth token, used by both the editor and run-view bridge builders.remoteEditor.md) and run inspector (remoteRun.md) agents.tangent-shellfeature flag now also enables the AI settings sidebar item.validatePipelineis now individually exported fromcreateCsomToolsalongsideallTools.Screenshots (if applicable)
Test Instructions
tangent-shellflag enabled.list_workarea_tabs/open_workarea_targetresponses.debug_pipeline_runand the fine-grained execution tools without being able to mutate the spec.Additional Comments
@tangent/remote-subagenthas been removed from the knip ignore list as it is now a direct runtime dependency ofremoteEnvHost. TheremoteEnvWorker.tsentry point has been added to knip so dead-code analysis covers the worker build.