Skip to content

Centralize Agent-Bridge as an HTTP hub with CLI/cloud workers and a secure cloud-to-local gateway - #42

Merged
devin-ai-integration[bot] merged 67 commits into
mainfrom
devin/hub-api
Nov 24, 2026
Merged

devin-ai-integration[bot] merged 67 commits into
mainfrom
devin/hub-api

Conversation

@Fei2411

@Fei2411 Fei2411 commented Nov 23, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Turns Agent-Bridge into a long-running central hub so every agent (local or cloud) is an API that any other agent can call, instead of agents calling each other through nested MCP servers.

  • Hub (agent-bridge serve): authenticated REST API on 127.0.0.1 (/v1/tasks, /wait, /result, /v1/agents/{agent}/invoke, sessions, transcripts, cancel). Shared BridgeService backs both REST and MCP; MCP auto-proxies to a discovered hub and falls back to the local Registry otherwise. Workers get hub URL/token/caller session/depth via env, so they can call peers with agent-bridge ask/call; max depth 3, no self-dispatch.
  • Protocols: ACP stays default; opt-in protocol = "cli" (headless -p-style per-turn process, resume, model/effort args, parsers; OpenCode/Claude presets, Cursor preset unverified) and protocol = "cloud" with Cursor v1 and Devin v3 providers (remote session create/follow-up/poll/cancel, PR/branch/ACU metadata; hub restart never terminates remote work).
  • Long tasks & feedback: invoke/ask wait until terminal by default (no 180s cap); ask --async returns immediately and the hub pushes the result back into the caller's session as a new turn (queued behind busy sessions, ordered, deduped, durable across restarts), or POSTs to a callback URL with HMAC-SHA256.
  • Cloud → local gateway ([hub.remote], disabled by default): separate loopback listener (8766) meant to be exposed only via Cloudflare Tunnel (agent-bridge tunnel); admin port never exposed. Per-cloud-task abr_ tokens stored only as SHA-256, scoped to agent/workspace allowlists (empty by default), named workspaces only (raw cwd rejected), call budget, concurrency, rate and body limits, optional require_approval, redacted audit log; results delivered back to the cloud session.
  • Secrets: cloud keys, hub bearer token and callback secrets live in the OS keychain (keyring, e.g. Windows Credential Manager) with RAM-only fallback; hub.json no longer contains the token; legacy plaintext files are migrated and removed.

Testing

  • ruff, mypy, pytest (818 passed).
  • Real agents: OpenCode with OpenDesign deepseek-v4.1-flash-eco for REST dispatch, peer calls, MCP proxy, ACP vs CLI benchmarks (scripts/bench_protocols.py).
  • Real Cloudflare quick tunnel: fake Devin-shaped cloud agent → public URL → gateway → local agent → result pushed back; with a live token over the public URL: non-allowlisted agent 403, raw cwd 400, workspace traversal 403, concurrency/rate limit 429, admin routes 404.
  • Not tested: real Cursor/Devin API calls (no credentials). Cloudflare Access check is header-presence only; JWT validation is expected at the Cloudflare edge.

AB Product Engineer opened this PR for Stull
Implemented in session Refactor Agent-Bridge into central API hub
Review with Devin · Open in Devin Desktop


Fei2411 and others added 15 commits November 21, 2026 03:45
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…fallback

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…controls

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

Fei2411 and others added 14 commits November 23, 2026 13:51
…e UI

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…rkers

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…t substrings

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…quests

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Fei2411 and others added 3 commits November 23, 2026 14:46
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…b preferences

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 9 findings. Devin automatically fixed all 9 findings.

Fixed by Devin (9)
  • Saved ZCode models block startup — Model pattern allows non-leading backslash (ZCode IDs).
  • Callbacks ignore reachable DNS addresses — Callback delivery tries each validated address in order.
  • Revoked worker tokens accumulate indefinitely — Revoked worker tokens are removed from the redaction cache.
  • Worker cleanup crash blocks callbacks — forget() is surrogate-safe and revocation errors cannot skip task completion.
  • Remote DSH skips permission opt-in — DSH approval-disabling mode now counts as unsafe and needs explicit opt-in.
  • Workers can use owner signing keys — Worker-token callers can no longer name callback signing keys.
  • Deleted callback keys remain usable — Callback key names are read from the keyring, not the cache.
  • Expired worker authorization permits mutations — Worker token is re-checked after the body read, before acting.
  • Remote DSH tool approval bypass — DSH mode is normalized the same way in validation and launch.

View findings in Devin Review · Follow Devin's work

Devin Review

Fei2411 and others added 24 commits November 23, 2026 15:12
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…lections

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot merged commit 20a0882 into main Nov 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant