开发与测试
ai-coding-agents-remote-runtime
Designs remote execution and bridge runtimes for coding agents. Use when implementing remote sessions, local-UI remote-execution, reconnect logic, or permission bridging.
vasilyu1983 · 已有 AI 审核记录
安装与使用
运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。
npx skills add vasilyu1983/AI-Agents-public --skill ai-coding-agents-remote-runtime技能说明
name: ai-coding-agents-remote-runtime description: "Designs remote execution and bridge runtimes for coding agents. Use when implementing remote sessions, local-UI remote-execution, reconnect logic, or permission bridging." compatibility: Portable core. Works on Claude Code and Codex. version: "1.1" last_validated: 2026-07-11
AI Coding Agents Remote Runtime
Use this skill to design or review coding-agent runtimes where execution happens remotely but the user still interacts through a local CLI or terminal UI.
This skill covers remote sessions, bridge transports, viewer-only clients, SSH-style local-UI remote-tool flows, and remote approval routing.
ASCII Flow
local client / terminal UI
|
v
bridge transport
WebSocket | SSE | HTTP POST | ACP stdio | SSH-like tunnel
|
v
remote runtime
agent loop + tools + sandbox + session store
|
+--> permission request -> bridge -> local owner decision -> remote execution
+--> stream events -> bridge -> local rendering
+--> reconnect -> sequence resume or replay from checkpoint
Quick Reference
| Question | Read | Outcome |
|---|---|---|
| What should the remote runtime model look like? | references/local-ui-remote-execution-model.md | Local UI, remote agent loop, viewer modes, and mode boundaries |
| How should bridge transport and approval work? | references/bridge-transport-and-permission-bridging.md | WebSocket control flow, permission bridging, reconnect, and message adaptation |
| Which transport should I use (WebSocket vs SSE vs HTTP POST vs ACP stdio)? | references/transport-selection.md | Decision tree, criteria, hybrid patterns, and anti-patterns |
| How do I build reconnect with sequence-number resume? | references/recipe-reconnect-with-sequence.md | Step-by-step resumable stream recipe with ring buffer and client reconnect loop |
| How does OpenAI Codex structure app-server and remote-control daemon lifecycle? | references/openai-codex-app-server-remote-control.md | Daemon lifecycle, JSON control output, remote host bootstrap, long-running work |
| How does OpenAI Codex keep app-server protocol clients in sync? | references/openai-codex-app-server-protocol-codegen.md | Schema-driven TypeScript/JSON artifacts, experimental filtering, fixture tests, and explicit update workflow |
How does codex mcp-server work and how does it differ from the app-server-daemon? | references/openai-codex-as-mcp-server.md | McpServer subcommand, codex-rs/mcp-server crate, approval bridging over MCP, contrast with HTTP daemon |
When To Use
- Design remote coding-agent sessions with a local CLI frontend
- Build bridge or direct-connect transport for a coding-agent runtime
- Add viewer-only remote session clients or assistant-style observers
- Route permission requests from remote execution back to local UI
- Model SSH-like “local REPL, remote tools” behavior
Use Other Skills
| Need | Use Instead |
|---|---|
| Session persistence and resume lifecycle | ../ai-coding-agents-sessions/SKILL.md |
| Tool approval system design | ../ai-coding-agents-permissions/SKILL.md |
| Plugin architecture | ../ai-coding-agents-plugins/SKILL.md |
Default Workflow
- Separate UI from execution. Decide what runs locally, what runs remotely, and what state must be mirrored between them.
- Treat remote control as a first-class mode. Viewer-only, full control, SSH proxy, and remote-creation flows should be explicit runtime modes.
- Split transcript traffic from control traffic. Keep SDK or transcript messages separate from typed control requests such as permission prompts, cancellations, reconnect notifications, and unsupported-control errors.
- Choose transport shape deliberately. Reads and writes do not need the same transport. Hybrid patterns such as WebSocket or SSE for reads plus HTTP POST for writes are often easier to recover and reason about than pretending the whole session is one bidirectional pipe.
- Bridge unknown tools safely. Remote execution may reference tools that do not exist in the local client; normalize them into synthetic local renderables instead of failing the UI.
- Track pending control requests. Permission prompts and cancellations need stable request IDs, local bookkeeping, and explicit cleanup so reconnects and late cancellations do not leak stale UI state.
- Plan reconnect behavior. Distinguish transient reconnecting, permanent disconnect, and viewer-only no-interrupt modes. Decide whether the client resumes from sequence numbers, replays from checkpoints, or only reconnects live.
- Keep approval local where possible. Remote execution can ask; the local controller should decide and respond with a structured result.
- Test degraded modes. Verify network drops, reconnect backoff, remote interrupt, stale control requests, unsupported control subtypes, and local or remote command filtering.
Host Rules
- Local UI and remote execution should share one semantic session contract.
- Control messages should use a typed schema separate from normal transcript messages.
- Reads and writes may use different transports if that improves ordering, retry semantics, or observability.
- Pending permission requests must be keyed, cancellable, and removable from local state when the server cancels or the session dies.
- Remote mode should expose only the commands that make sense in a remote session.
- Unknown remote tools should sti