惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
博客园_首页
H
Help Net Security
T
Tailwind CSS Blog
S
SegmentFault 最新的问题
GbyAI
GbyAI
Scott Helme
Scott Helme
D
Docker
Hacker News: Ask HN
Hacker News: Ask HN
P
Privacy & Cybersecurity Law Blog
Jina AI
Jina AI
雷峰网
雷峰网
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Spread Privacy
Spread Privacy
G
GRAHAM CLULEY
C
Cisco Blogs
The Hacker News
The Hacker News
F
Full Disclosure
Y
Y Combinator Blog
Blog — PlanetScale
Blog — PlanetScale
Recent Announcements
Recent Announcements
G
Google Developers Blog
量子位
K
Kaspersky official blog
Cisco Talos Blog
Cisco Talos Blog
The Cloudflare Blog
A
About on SuperTechFans
C
Cybersecurity and Infrastructure Security Agency CISA
Last Week in AI
Last Week in AI
博客园 - 三生石上(FineUI控件)
Microsoft Security Blog
Microsoft Security Blog
Martin Fowler
Martin Fowler
T
Tenable Blog
P
Palo Alto Networks Blog
H
Heimdal Security Blog
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
Schneier on Security
Schneier on Security
The Register - Security
The Register - Security
F
Fortinet All Blogs
Stack Overflow Blog
Stack Overflow Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
The Blog of Author Tim Ferriss
N
News and Events Feed by Topic
Hugging Face - Blog
Hugging Face - Blog
小众软件
小众软件
V
V2EX
爱范儿
爱范儿

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
A Control Plane for Long-Running Agent Services
mgd43b · 2026-06-04 · via DEV Community

An earlier post in this series covered running agent ensembles as long-running services -- always-on processes that accept work over WebSocket, HTTP, queues, or topics instead of running once and exiting. Once an ensemble is a service, a new category of problem appears: how do external systems interact with it?

The existing WebSocket dashboard streams execution events and handles review decisions. That covers observability and human review. What it doesn't cover is run submission. There's no way for a CI pipeline, orchestrator, or custom UI to kick off a run, pass runtime parameters, query what's currently executing, or cancel something that's gone wrong -- without a WebSocket connection and custom client code.

The Ensemble Control API fills that gap.

The Control Plane vs. the Data Plane

Before getting into the API itself, a design distinction worth stating explicitly.

The v3 network module handles ensemble-to-ensemble communication: tasks delegating work to remote peers, capability registries, federation across namespaces. That's the data plane -- ensemble-internal traffic, designed for ensemble peers.

The Control API is the control plane: CI pipelines, orchestrators, and custom UIs talking to an ensemble service. Different audience, different semantics. External systems shouldn't need a WebSocket client, shouldn't need to understand the ensemble networking protocol, and shouldn't be treated as ensemble peers. The REST-first design reflects that distinction.

Phase 1: Core REST Endpoints

Four endpoints on the same Javalin server as the WebSocket dashboard -- no new port, no new process:

POST /api/runs          Submit a run with input variables
GET  /api/runs          List recent runs (filterable by status, tag)
GET  /api/runs/{runId}  Get full run detail (status, task outputs, metrics)
GET  /api/capabilities  List registered tools, models, and preconfigured tasks

Enter fullscreen mode Exit fullscreen mode

Setup

The API is activated by adding catalogs to WebDashboard.builder():

ToolCatalog tools = ToolCatalog.builder()
    .tool("web_search", webSearchTool)
    .tool("calculator", calculatorTool)
    .build();

ModelCatalog models = ModelCatalog.builder()
    .model("sonnet", claudeSonnetModel)
    .model("haiku", claudeHaikuModel)
    .build();

WebDashboard dashboard = WebDashboard.builder()
    .port(7329)
    .toolCatalog(tools)
    .modelCatalog(models)
    .maxConcurrentRuns(5)
    .maxRetainedCompletedRuns(100)
    .build();

Enter fullscreen mode Exit fullscreen mode

The ensemble wires in the dashboard:

Ensemble.builder()
    .chatLanguageModel(claudeSonnetModel)
    .webDashboard(dashboard)
    .task(Task.builder()
        .description("Research {topic} focusing on recent developments in {year}")
        .tools(webSearchTool)
        .build())
    .task(Task.builder()
        .description("Write a concise executive summary of the research")
        .build())
    .build()
    .start(7329);

Enter fullscreen mode Exit fullscreen mode

ToolCatalog and ModelCatalog serve two purposes. They make the API transport-agnostic (JSON refers to tools and models by name, not class). And they act as allowlists -- only registered tools and models can be used. Dynamic task creation in later phases cannot instantiate arbitrary code.

Submitting a run

POST /api/runs submits the pre-configured ensemble tasks with variable substitution:

{
  "inputs": {
    "topic": "AI safety",
    "year": "2025"
  },
  "tags": {
    "triggeredBy": "ci-pipeline",
    "environment": "staging"
  }
}

Enter fullscreen mode Exit fullscreen mode

Response (202 Accepted):

{
  "runId": "run-7f3a2b",
  "status": "ACCEPTED",
  "tasks": 2,
  "workflow": "SEQUENTIAL"
}

Enter fullscreen mode Exit fullscreen mode

The run executes asynchronously -- the response is immediate. Poll GET /api/runs/{runId} for completion. Tags are arbitrary metadata for filtering and auditing. An empty body submits the template ensemble with no substitution. If maxConcurrentRuns is reached, the response is 429 with a retryAfterMs hint.

Querying capabilities

GET /api/capabilities exposes what's registered:

{
  "tools": [
    { "name": "web_search", "description": "Search the web using Google" },
    { "name": "calculator", "description": "Evaluate mathematical expressions" }
  ],
  "models": [
    { "alias": "sonnet", "provider": "anthropic" },
    { "alias": "haiku", "provider": "anthropic" }
  ],
  "preconfiguredTasks": [
    { "description": "Research {topic} focusing on recent developments in {year}" },
    { "description": "Write a concise executive summary of the research" }
  ]
}

Enter fullscreen mode Exit fullscreen mode

GET /api/runs/{runId} returns full run detail including task outputs and metrics. GET /api/runs lists recent runs filterable by ?status=RUNNING, ?status=COMPLETED, or ?tag=triggeredBy:ci-pipeline.

Phase 2: The Three-Level Run Submission Model

The most interesting design decision in the Control API is the graduated run submission model. There are three levels, each more dynamic than the last.

Level 1 (covered above): substitute template variables into the pre-configured ensemble. The simplest and most constrained option -- the Java code defines what runs.

Level 2: override specific fields of individual tasks at runtime.

Level 3: define a new task list entirely in the POST body, without changing any Java code.

This graduated approach keeps the simple case simple while making the more dynamic cases possible without abandoning the safety properties of the catalog model.

Task naming

To use Levels 2 and 3 effectively, tasks can be given logical names:

Task.builder()
    .name("researcher")
    .description("Research {topic} focusing on recent developments in {year}")
    .tools(webSearchTool)
    .build()

Enter fullscreen mode Exit fullscreen mode

GET /api/capabilities returns task names alongside descriptions. Level 2 override keys match by exact name first, then by description prefix (first 50 characters, case-insensitive) as a fallback.

Level 2: Per-task overrides

taskOverrides lets a caller change a specific task's description, model, tools, or context without recompilation:

{
  "inputs": { "topic": "AI safety" },
  "taskOverrides": {
    "researcher": {
      "description": "Research {topic} focusing on EU AI Act compliance",
      "expectedOutput": "A regulatory analysis report with citations",
      "model": "sonnet",
      "maxIterations": 15,
      "additionalContext": "The EU AI Act was formally adopted in March 2024.",
      "tools": {
        "add": ["web_search"],
        "remove": ["calculator"]
      }
    }
  }
}

Enter fullscreen mode Exit fullscreen mode

The override key ("researcher") is matched against the template ensemble's task names. If no matching task exists, the request is rejected with 400. The original task objects are never mutated -- Task.toBuilder() creates modified copies.

All tool references are resolved against the ToolCatalog and all model references against the ModelCatalog. A caller cannot inject a tool or model that was not pre-registered.

Level 3: Dynamic task creation

When tasks is provided in the request body, the template ensemble's task list is replaced entirely. The template's model, catalogs, and configuration are preserved -- only the task list changes:

{
  "tasks": [
    {
      "name": "researcher",
      "description": "Research the competitive landscape for {product}",
      "expectedOutput": "A competitive analysis identifying 5 key competitors",
      "tools": ["web_search"],
      "model": "sonnet",
      "maxIterations": 20
    },
    {
      "name": "writer",
      "description": "Write an executive brief based on the research",
      "expectedOutput": "A 1-page executive summary suitable for C-suite",
      "context": ["$researcher"],
      "model": "sonnet"
    }
  ],
  "inputs": { "product": "AgentEnsemble" }
}

Enter fullscreen mode Exit fullscreen mode

The context field declares dependencies between tasks. $researcher references the task named "researcher"; $0 references the task at index 0. The scheduler infers the workflow type from these dependencies -- if context references exist and no workflow is explicitly set, PARALLEL (DAG-based) is used. Circular dependencies and unknown references are rejected at submission time.

WebSocket run submission

REST isn't the only submission channel. WebSocket clients can submit runs using the run_request message -- useful for browser-based UIs that already have a dashboard connection:

{
  "type": "run_request",
  "requestId": "req-1",
  "inputs": { "topic": "AI safety" },
  "tags": { "env": "staging" }
}

Enter fullscreen mode Exit fullscreen mode

The server acknowledges immediately with run_ack. On completion it sends run_result to the originating session only -- the existing ensemble_completed broadcast continues to go to all connected clients unchanged.

Phase 3: Run Control

Two operations that apply to in-flight runs.

Cancellation

POST /api/runs/{runId}/cancel cancels a running or accepted run. This is cooperative cancellation -- the current in-flight task completes normally; cancellation takes effect before the next task starts.

{ "runId": "run-abc", "status": "CANCELLING" }

Enter fullscreen mode Exit fullscreen mode

The same operation is available over WebSocket: { "type": "run_control", "runId": "run-abc", "action": "cancel" }.

The cooperative model is intentional. A task mid-execution is mid-LLM-call. Interrupting that immediately would leave the ensemble in an undefined state. Completing the current task and stopping cleanly at the boundary gives deterministic behavior without losing progress already made.

Mid-run model switching

POST /api/runs/{runId}/model switches which LLM subsequent tasks will use:

{ "model": "haiku" }

Enter fullscreen mode Exit fullscreen mode

The switch takes effect on the next LLM call; the in-flight call completes with the previous model. The model alias must be registered in the ModelCatalog. This is useful when a long-running ensemble is partway through and you want subsequent tasks to use a cheaper or faster model.

Phase 4: Event Streaming

The existing WebSocket dashboard broadcasts all execution events to all connected sessions. Phase 4 adds filtering and an HTTP-native alternative.

Subscription filtering

WebSocket clients can subscribe to a specific subset of events:

{ "type": "subscribe", "events": ["task_started", "task_completed", "run_result"] }

Enter fullscreen mode Exit fullscreen mode

Or filter to a specific run:

{ "type": "subscribe", "events": ["run_result"], "runId": "run-abc" }

Enter fullscreen mode Exit fullscreen mode

Reset to all events with "events": ["*"]. The server responds with a subscribe_ack confirming the effective subscription.

SSE streaming

For HTTP-only clients -- curl scripts, serverless functions, server-side integrations -- a WebSocket connection is awkward. The SSE endpoint offers the same event stream over a regular HTTP connection:

GET /api/runs/{runId}/events
Accept: text/event-stream

Enter fullscreen mode Exit fullscreen mode

For completed runs, stored events replay immediately and the connection closes. For in-progress runs, events stream until the run completes. A from parameter supports reconnection by resuming from a specific position in the stored output.

Phase 5: Completing the Control Loop

Phase 5 rounds out the API with three operations that were previously only available through the WebSocket dashboard or by interacting with a running Java process directly.

REST review decisions

The human-in-the-loop system generates review gates where a reviewer approves, edits, or rejects task output before the ensemble proceeds. Phase 5 exposes this over REST, so server-side systems (Slack bots, CI pipelines) can automate or route review decisions:

POST /api/reviews/{reviewId}
{ "decision": "CONTINUE" }

Enter fullscreen mode Exit fullscreen mode

For edits:

{ "decision": "EDIT", "revisedOutput": "Updated output..." }

Enter fullscreen mode Exit fullscreen mode

Discover pending reviews:

GET /api/reviews
GET /api/reviews?runId=run-abc

Enter fullscreen mode Exit fullscreen mode

Context injection

Inject a directive into a running ensemble's DirectiveStore. The directive is picked up on the next LLM iteration of any agent in the ensemble:

POST /api/runs/{runId}/inject
{ "content": "Focus on EU AI Act compliance", "target": "researcher" }

Enter fullscreen mode Exit fullscreen mode

This is the REST equivalent of what the dashboard allows through the live run view -- useful for server-side automation that needs to steer a run mid-execution.

Direct tool invocation

Execute a registered tool from the ToolCatalog without running a full ensemble:

POST /api/tools/calculator/invoke
{ "input": "What is 42 * 17?" }

Enter fullscreen mode Exit fullscreen mode

Response:

{ "tool": "calculator", "status": "SUCCESS", "output": "714", "durationMs": 2 }

Enter fullscreen mode Exit fullscreen mode

This is useful for integration testing, for validating tool configuration, and for pipeline steps that need a single tool call without the overhead of an ensemble run.

The Design Tension

The interesting question in a feature like this is where the boundary sits between the control plane and the data plane.

The v3 network module already has capability queries (CapabilityQueryMessage), task delegation (NetworkTask/NetworkTool), and directives (DirectiveMessage). The Control API exposes similar operations -- but over HTTP, for a different audience, with different security and access semantics.

The key distinction is the audience. External systems that should not need a WebSocket client and should not need to understand the ensemble networking protocol are not ensemble peers -- they're operators. The REST-first design, catalog-enforced allowlists, and graduated Level 1/2/3 submission model reflect that distinction throughout.


The Ensemble Control API is documented in the control API guide. The underlying design doc is design/28. Source is on GitHub.

I'd be interested in where the three-level submission model feels right or falls short. The boundary between Level 2 (override existing tasks) and Level 3 (define new tasks) is where the most design tension sits -- curious whether that separation is useful or whether most real use cases collapse to one or the other.