Delegate a task to another environment you've connected (Tailscale, LAN, or T3 Connect) #15819
shootingallday
started this conversation in
Ideas
Replies: 1 comment
|
Too similar to #6935. This can be added to the discussion as a comment. |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
The gap
delegate_taskruns children only on the parent's own environment. I run T3 Code on a Mac and a Windows PC and want a thread on either one to hand work to the other, with the result coming back like a local child's. #6935 asks for this; @rabesss sketched thedelegate_taskshape there. This is a concrete scope for it.Why the server can't do it today
Saved environments live only on clients (desktop
saved-environments.jsonunder safeStorage, web IndexedDB, mobile storage). No server holds a list of peers or calls another server.Proposed direction
t3 environment add <url> --pairing-code <code>exchanges the code at the target's/oauth/token(the existingbootstrapRemoteBearerSessionpath). It stores{id, label, httpBaseUrl, wsBaseUrl}in server settings and the token inServerSecretStore. Each connection mints a fresh WebSocket ticket.t3 connect, it re-resolves a Connect peer's hostname throughGET /v1/environmentswhen the tunnel is reprovisioned.delegate_tasktakes optionaltarget.environmentIdandtarget.projectId. The orchestrator records the task and turn item as it does now but skips the local provider. A small bridge callsorchestration.launchThreadon the target and follows it withorchestration.subscribeThread. When the run settles, it feeds the result into the existing completion-delivery path, so the parent wakes without polling.delegationsession kind. It can launch, read, and interrupt delegated threads, has a runtime-mode ceiling, and is listed and revocable in Settings → Connections. It is not a full client session./.well-known/t3/environmentrefuses incompatible peers up front.Out of scope
/connectflow, which would need a serverclient_idand DPoP on the relay.Why not the MCP sign-in stack
#15219 → #15222 lets outside agents use
/mcp, but its OAuth flow needs a browser on a loopback redirect, which a headless server can't complete, and itsmcp-clientsessions can't use the WebSocket RPC. I'd borrow its runtime-mode ceiling for thedelegationsession.Size and proof
Estimate: 900–1,300 lines including tests, mostly server and contracts, plus one CLI command. I'd test Mac ↔ Windows over Tailscale and over T3 Connect, with focused tests for settle, cancel, unreachable target, restart, and version mismatch.
Happy to build it as one PR, or hand over the design if you'd rather fold it into V2 yourselves.
Drafted with Opus 5.5 in Claude Code.
All reactions