Portal
Portal moves a local coding session to a paired computer while keeping the
relay as the control plane and the paired computer as the execution residence.
The Code Agents chat list supports moving one local chat or all eligible local
and worktree chats in one handoff.
Workflow
- Select
Portal for the coding session and keep the source folder as a Git
repository with an origin remote.
- Snapshot the current working tree, including dirty tracked and untracked
code, into a unique
portal/<timestamp>-<id> branch. Do not switch, reset,
stash, or overwrite the source checkout.
- Queue the run for a paired active host. The run metadata must identify the
host, handoff id, branch, commit, and
envPolicy: "load-local".
- On the paired host, fetch the exact commit into a detached Portal worktree
under its local Agent-Native store. Preserve an existing dirty worktree and
create a new one instead of overwriting it.
- Load the paired host's current local environment files immediately before
starting the runner. Never put environment values, tokens, or secrets in
relay metadata, prompts, transcripts, or status messages.
Existing chat transfer
Use Move to Portal for one chat or Move local chats to Portal for the bulk
handoff. The transfer stops a local runner before snapshotting, pushes the
current worktree without changing the source checkout, and imports the full
text transcript into the same run id on the paired computer. The target gets a
continuation turn rather than replaying the original prompt. Chats waiting for
local approval are skipped because approval state is computer-local and cannot
be reconstructed safely.
Binary attachment bodies are not relayed. Their names, text, and an explicit
omission marker remain in the transcript context. Oversized or otherwise
unsafe context fails visibly so the source chat can be retried instead of being
silently truncated.
Execution residence
Treat metadata.executionResidence as authoritative for where the run is
executing. It should report kind: "portal", host id and label, handoff id,
source commit, remote workspace path once prepared, and environment file names
without values. Follow-ups and stops must target the same host and remote run.
Verification
Before saying Portal is ready, verify the relay has a paired host, the host is
heartbeating, the exact handoff commit was fetched, the detached worktree is
clean, and the run metadata reports the remote workspace. For an existing chat,
also verify the target transcript contains the imported event count and the
continuation turn. A queued command is not proof that the remote runner
started; inspect the remote result or event readback.
Operator recovery
When a host is present but a handoff stalls:
- Confirm the connector's
relayUrl is the same deployment origin used for
pairing. A device paired against another origin can return 401 with a
fresh-looking token because the row is in a different database.
- After repairing a pairing, restart the connector. It reads
remote-device.json once at startup and will not adopt a new token or relay
URL in an existing process.
- Confirm the host is heartbeating and connected, then retry one bounded run.
Read the remote result and transcript; enqueue success alone is not proof.
- Keep tokens and environment values out of logs, prompts, metadata, and
transcripts. Report source, published-runtime, and live-relay evidence
separately.
Don't
- Do not copy
.env contents or credentials to the source branch or relay.
- Do not treat the primary laptop's cwd or environment as the remote cwd.
- Do not report Portal complete from a local push alone; confirm remote
execution residence and runner state.
Related skills
external-agents - relay and external-agent boundaries.
a2a-protocol - idempotent cross-agent task lifecycle.
concurrent-agents - preserve shared checkouts and peer work.
reliable-mutations - verify durable handoff state.
1---2name: portal3description: Continue a coding session on a paired always-on computer. Use when work must survive closing the primary laptop, needs remote computer-use testing, or should run on a scheduled/self-hosted execution host.4---56# Portal78Portal moves a local coding session to a paired computer while keeping the9relay as the control plane and the paired computer as the execution residence.10The Code Agents chat list supports moving one local chat or all eligible local11and worktree chats in one handoff.1213## Workflow14151. Select `Portal` for the coding session and keep the source folder as a Git16 repository with an `origin` remote.172. Snapshot the current working tree, including dirty tracked and untracked18 code, into a unique `portal/<timestamp>-<id>` branch. Do not switch, reset,19 stash, or overwrite the source checkout.203. Queue the run for a paired active host. The run metadata must identify the21 host, handoff id, branch, commit, and `envPolicy: "load-local"`.224. On the paired host, fetch the exact commit into a detached Portal worktree23 under its local Agent-Native store. Preserve an existing dirty worktree and24 create a new one instead of overwriting it.255. Load the paired host's current local environment files immediately before26 starting the runner. Never put environment values, tokens, or secrets in27 relay metadata, prompts, transcripts, or status messages.2829## Existing chat transfer3031Use `Move to Portal` for one chat or `Move local chats to Portal` for the bulk32handoff. The transfer stops a local runner before snapshotting, pushes the33current worktree without changing the source checkout, and imports the full34text transcript into the same run id on the paired computer. The target gets a35continuation turn rather than replaying the original prompt. Chats waiting for36local approval are skipped because approval state is computer-local and cannot37be reconstructed safely.3839Binary attachment bodies are not relayed. Their names, text, and an explicit40omission marker remain in the transcript context. Oversized or otherwise41unsafe context fails visibly so the source chat can be retried instead of being42silently truncated.4344## Execution residence4546Treat `metadata.executionResidence` as authoritative for where the run is47executing. It should report `kind: "portal"`, host id and label, handoff id,48source commit, remote workspace path once prepared, and environment file names49without values. Follow-ups and stops must target the same host and remote run.5051## Verification5253Before saying Portal is ready, verify the relay has a paired host, the host is54heartbeating, the exact handoff commit was fetched, the detached worktree is55clean, and the run metadata reports the remote workspace. For an existing chat,56also verify the target transcript contains the imported event count and the57continuation turn. A queued command is not proof that the remote runner58started; inspect the remote result or event readback.5960## Operator recovery6162When a host is present but a handoff stalls:63641. Confirm the connector's `relayUrl` is the same deployment origin used for65 pairing. A device paired against another origin can return `401` with a66 fresh-looking token because the row is in a different database.672. After repairing a pairing, restart the connector. It reads68 `remote-device.json` once at startup and will not adopt a new token or relay69 URL in an existing process.703. Confirm the host is heartbeating and connected, then retry one bounded run.71 Read the remote result and transcript; enqueue success alone is not proof.724. Keep tokens and environment values out of logs, prompts, metadata, and73 transcripts. Report source, published-runtime, and live-relay evidence74 separately.7576## Don't7778- Do not copy `.env` contents or credentials to the source branch or relay.79- Do not treat the primary laptop's cwd or environment as the remote cwd.80- Do not report Portal complete from a local push alone; confirm remote81 execution residence and runner state.8283## Related skills8485- `external-agents` - relay and external-agent boundaries.86- `a2a-protocol` - idempotent cross-agent task lifecycle.87- `concurrent-agents` - preserve shared checkouts and peer work.88- `reliable-mutations` - verify durable handoff state.