Copy library / What got built / Multiple
Letting Grok Bot or a Dot drive local Codex and Claude CLIs
# 让 Grok Bot 或 Dot 远程驱动本地 Codex 和 Claude CLI Source: https://github.com/Snseam/harnessorbit/pull/14 Author: Snseam HarnessOrbit 的 agent 接入层第一阶段:Grok Bot、Dot 等远程个人 agent 不用拿到 shell,就能以受限身份提交任务,在隔离的 worktree 中运行本地 Codex 和 Claude CLI,并轮询状态直到需要人工决定。实现了令牌只存哈希、项目与 agent 白名单、频率限制、幂等提交和仅本机的 MCP 服务器。
- What it does
- Phase one of HarnessOrbit's agent access layer: a remote personal agent such as Grok Bot or a Dot, without a shell, authenticates as a scoped principal, submits a job that runs the local Codex or Claude CLI in an isolated worktree, and polls status until a decision is needed. Includes hashed tokens, project and agent allowlists, rate limits, idempotent submits and a loopback-only MCP server.
- Scenarios
- Code & ship
- What the source covers
- Author & original linkYes
- What it doesYes
- Verbatim source excerptYes
- Screenshots / mediaNot in source
- Steps / chaptersYes
- Verbatim prompt / configNot in source
- Results / numbersNot in source
- Risk notesYes
- Related entriesYes
— means the source doesn't say; we don't fill it in.
- Verbatim source excerpt
Add agent access layer: describe, submit and status over MCP and CLI
## Summary
Phase one of the agent access layer. A remote personal agent (Grok Bot, Dot) can drive the local Codex and Claude CLIs through HarnessOrbit without getting a shell: it authenticates as a scoped principal, submits a job that becomes an isolated worktree run, and polls `status` until an attention item needs a decision.Show full post
- **`src/access/principals.mjs`**: principal store. Token (`hoa_…`) is printed once at creation; only its SHA-256 is stored and checked in constant time. Per-principal project whitelist (realpath), agent whitelist, permission bits (`integrate` off by default), per-minute rate limit.
- **`src/access/jobs.mjs`**: job store with a per-principal idempotency index, so a `submit` retried after a client timeout returns the original job instead of dispatching twice.
- **`src/access/service.mjs`**: `describe`, `submit`, `status`. `context` and `checks` are required; project and agent scope and `allowedPaths` are validated before any run is created. Dispatch failures are kept as a `retry` attention item rather than lost. `status` advances collect and verify through the existing Supervisor (up to three stages per call) and always returns `state`, `attention[]`, `attention_pending`, `next_action`. Audit log at `<state>/access/audit.jsonl` never contains bodies or tokens.
- **`src/access/server.mjs`**: hand-written MCP Streamable HTTP server, loopback only, JSON responses (no SSE/sessions). `initialize`, `ping`, `tools/list`, `tools/call`. Bearer auth, non-loopback `Origin` rejected, batches rejected, per-principal token bucket on write tools, 20s tool timeout, tool failures returned as `isError` with a stable `code`.
- **`bin/cao.mjs`**: `access principal create|list|remove`, `access serve`, `access describe|submit|status`.
- **`docs/access.md`** with topoSnseam · · Open original ↗ From the project README, verbatim and untranslated.
- Steps / points from the source
- Coordinate existing agents. Use Herdr-managed sessions while preserving each CLI's provider and model configuration.
- Choose execution profiles. Route tasks to native Claude, Codex, Pi, or OpenCode profiles with local relay gateways, stored secrets, fallbacks, and capacity r……
- Isolate parallel work. Assign independent tasks separate Git worktrees, declared file ownership, dependencies, and run capacity.
- Verify actual changes. Check result identity and file scope, stop the worker, then run your acceptance commands against its candidate.
- Repair with evidence. Start a new attempt with failed check output and the previous worktree's changes intact.
- Integrate with checks. Detect changed target files, apply the verified patch, and rerun acceptance commands in the project checkout.
- Keep work inspectable. Save tasks, prompts, results, terminal output, patches, and verification logs locally.
- Node.js 22.13+ and Git.
Verbatim from the source, untranslated.
- Prompt
The source does not include a prompt you can copy verbatim.
- How to copy
- Open the repo: github.com/Snseam/harnessorbit/pull/14 ↗
- Read the README, send the repo link to your Bot and have it reproduce it
- Get it working small first, then add a routine
- Risks and limits
- The author's result may not reproduce for you; the original post is the reference
- Usage estimate
- Estimate with the metal calculator