Research
Linglong Agent Service: A Runtime for Centralized Agent Reasoning and Distributed Execution
LLM agents already reach beyond their own host through SSH, remote MCP servers, and hosted sandboxes, but keeping reasoning, session state, and many heterogeneous execution environments coherent is…
- arXiv
- 2611.21129 · Preprint · not peer-reviewed
- Published
- 2026-11-16
- Authors
- Hua Zhang, Min Jiang
In plain words
LLM agents already reach beyond their own host through SSH, remote MCP servers, and hosted sandboxes, but keeping reasoning, session state, and many heterogeneous execution environments coherent is an unsolved runtime design problem.
AI summary
Overview
- Research area: LLM agent systems engineering — specifically the design of an agent runtime that separates centralized model orchestration from distributed tool execution (categorized on arXiv under Robotics, cs.RO).
- Technical level: Advanced. The paper assumes familiarity with LLM tool-calling loops, HTTP/WebSocket transports, MCP, and Python process internals such as tracebacks and frame objects.
- Scope (one sentence): The paper describes Linglong Agent Service (
agentsvc), a self-hosted HTTP service and embeddable Python runtime in which the execution site of tools is a configurable dimension alongside model, tools, and context, and extends the same principle to a process-scale debugger (online_debugger) that inspects and patches exceptions inside a live program.
What This Paper Is About
LLM agents already reach beyond their own host through SSH, remote MCP servers, and hosted sandboxes, but keeping reasoning, session state, and many heterogeneous execution environments coherent is an unsolved runtime design problem. The authors propose treating "where a tool runs" as an explicit, per-request configuration choice, so that conversation history, tool descriptions, and inference orchestration stay in one parent service while files, shells, terminals, and MCP operations happen on a selected child environment. They then push the same idea below machine granularity: a debugger accessory that lets a coding agent inspect exceptions and edit source inside the process where the failure occurred, without opening a new listening port.
Key Contributions
- A compositional agent runtime and design rationale. The runtime models an agent as Model × Tools × Context × Execution Site, and justifies centralized session assets, a near-zero-dependency deployment core, and runtime configuration using an explicit expected-utility expression with stated benefits and costs.
- A remote-execution design. Request-scoped site selection, a portable request-context header, parent-side orchestration, and a single application interface carried over both direct HTTP and child-initiated reverse WebSocket tunnels, including centrally managed configuration updates.
- A client-side tool contract and its realization in exception diagnosis and source repair. Tools whose descriptions live on the server but whose execution belongs to the caller, applied to a debugger that captures exception evidence, exposes six session-scoped inspection tools inside the incident process, and requires failing-then-passing reproduction evidence for source changes.
- A bounded comparison and an evidence inventory. An item-by-item architectural comparison against Hermes Agent, Pi, Codex, and Claude Code, plus an explicit separation between mechanism-correctness evidence and task-effectiveness claims.
Main Findings
- Execution site is a first-class routing decision, but with three separate records. The request body is authoritative for routing (an omitted
remote_envmeans local execution, an explicitly unknown one is rejected); session metadata merely restores the UI selection; turn metadata records what actually happened. The authors flag the integration hazard that an API client omitting the field can silently run locally. - The parent never fetches the child's tool catalogue on the main path. Model-facing names, schemas, and descriptions come from the parent's registry, and per-request wrappers forward calls using the original tool identifiers. This avoids a second "remote-only" tool vocabulary, but makes compatibility an operational obligation: a missing or incompatible child tool fails when called, and there is no schema negotiation or drift-proofing.
- Not every tool follows the selected site.
talk_toanddelegatestay at the parent because orchestration state lives there; their subagents reason at the parent and use inherited remote wrappers. Skills remain disclosure items in the parent's loop, with full bodies fetched from the child. - Two transports, one data plane. Direct HTTP and reverse-tunnel mode both invoke the child's ordinary endpoints —
POST /v1/tools/callwith{tool_id, arguments},GET /v1/tools/skill/{tool_id}, and workspace endpoints. Portable context travels in a base64url-encoded JSONX-Agents-Request-Contextheader, which the paper explicitly states is an encoding convention, not encryption or authorization. - Tunnel engineering defaults are stated as defaults, not optimized parameters. Binary body frames up to 256 KiB, empty frame terminates a body, up to 16 in-flight HTTP calls per tunnel with eight local request workers, bodies up to 8 MiB kept in memory with larger bodies spilled to a temporary file, protocol pings every 30 seconds, disconnect after 90 seconds without a frame, child read timeout 95 seconds, reconnect backoff 1 to 30 seconds, 600-second default forwarding timeout, and 900 seconds for update pushes.
- TLS handling in local replay is an explicit security tradeoff. Local replay TLS disables certificate verification by default under a trusted-local-host assumption;
AGENTS_TUNNEL_LOOPBACK_VERIFY=1enables the default verification context. Tunnel admission does not cryptographically authenticate an unverified local TLS peer, and certificate pinning is named as a possible future strengthening. - Control-plane health does not imply data-plane health. A local
OSErrorbecomes an HTTP 502 containing the resolved target, other unexpected local-call exceptions become 500, and these are surfaced as model-visible tool errors — but registration and online status do not probe local replay, so a live control connection can coexist with a broken data plane, with no degraded health state representing the difference. - Client-side handoff has a different lifecycle from remote proxying. A remote proxy obtains the child result within the server-side tool loop; a client-side call ends the current inference request and requires the caller to submit a continuation. This determines where budgets, retries, and failure handling belong.
- Debugger evidence is deliberately bounded and is near-exception, not atomic. Capture is limited to 12 frames, 30 locals per frame, and 200 characters per variable representation; an LRU cache retains up to 512 frame objects; the event table holds 32 entries and the dispatch queue 64, with a full queue dropping work. These entry limits do not bound memory in bytes, because a frame may retain a large object graph.
- Fingerprinting and cooldowns are heuristic. The default fingerprint hashes exception type plus frame function, file basename, and line number; repeated fingerprints increment counters rather than dispatching another diagnosis in that process, and synchronous mode adds a persistent cooldown, normally 1,800 seconds.
- Six session-scoped inspection tools are supplied per diagnostic request, never globally registered.
debugger_status,debugger_events,debugger_event,debugger_frame,debugger_threads, anddebugger_eval— the last of which evaluates expressions in a retained frame or accessory scope, is enabled by default, and is explicitly not a sandbox. - No single global termination guarantee exists for a diagnostic session. The driver owns a default continuation budget of 80 handoffs; the server's
max_tool_roundsof 200 applies per inference request and cannot bound a handoff-driven session; an HTTP request timeout of 1,200 seconds and a synchronous wait limit of 900 seconds are additional limits. - Repair is staged, and the last stage is missing. Stages L0 through L4 (record, diagnose, recommend, modify, reproduce) have mechanisms; L5, activating a patch in the running program and recovering the failed call, has no general mechanism. The paper notes that already-loaded Python functions do not change when their source file is rewritten, and that replaying a failed call requires knowing whether it already produced side effects.
- Reproduction verification is a prompt contract, not enforcement. The default
verify_fix=Trueasks for a minimal reproduction that fails before the patch and passes after, matching exception type and top stack location;DEBUGGER_VERIFY=0removes the action requirement but still requires disclosure. The implementation test only checks that the prompt contains the requirement — it does not show the model follows it or that a passing reproduction establishes correctness. - The stated evidence ceiling. The authors state they have no latency benchmark, no controlled repair study, and no evidence of general production recovery; the current evidence establishes executable contracts, not performance advantages, repair accuracy, or production recovery.
- The comparison is evidence-bounded. Documentation review used repository material collected on November 7, 2026; Hermes and Pi were represented mainly by README material, Codex by its README and documentation index, and Claude Code by a retained system-prompt/tool-description snapshot dated May 9, 2026, so current Claude Code claims remain provisional. Several "managed private fleet and reverse transport" cells are marked unverified rather than absent, and no same-task product benchmark was performed.
- Implementation baseline. The baseline is commit
07d3d23a24f356bf2e59527b762ab66611c34f27, dated November 8, 2026; regression results come from that baseline's verification record.
Methodology in Plain English
The work is a system-design and implementation paper rather than an experimental study. The authors start from six constraints and near-term assumptions about how model APIs, tool effects, context budgets, installation friction, transient diagnostic evidence, and human authority behave. They convert those into design choices, and use an expected-utility expression — with terms for task benefit, reachable-environment value, future adaptability, development cost, deployment cost, inference cost, and risk loss — purely as a discipline for stating both benefits and costs. They explicitly say they have not estimated the weights or probabilities, so the expression does not prove optimality.
They then built the system: a Python service whose normal core path uses only the standard library, with an optional winpty dependency for Windows pseudo-terminals, four upstream model adapters (OpenAI Chat Completions, OpenAI Responses, native Ollama chat, Anthropic Messages), a browser console, a terminal client, and an embeddable runtime. Verification takes the form of regression tests recorded against a single commit and archived, plus a documentation-based architectural comparison against four existing agent systems. Where behavior is policy rather than enforcement (for example the reproduction requirement), the paper states plainly what the tests do and do not establish.
Why This Matters
Impact on research. The paper reframes "remote tool use" as a runtime contract question rather than a feature checklist, and it introduces a vocabulary — request-authoritative routing, portable versus host-bound context, caller-owned tool continuation, staged repair with an explicit L5 gap — that other agent-runtime papers can adopt or dispute. Its insistence on separating executable contracts from performance claims sets a bar for how agent systems papers report evidence.
Real-world applications (drawn from the paper's own scenarios):
- A coding agent that operates a GPU server behind NAT, keeping model and conversation history central while file, shell, terminal, and journal operations stay on that server.
- Deploying to machines where parent-to-child reachability is impossible, using the child-initiated tunnel so a NATed child can participate.
- Bringing LLM-assisted diagnosis into ordinary exception handlers in an existing Python service via
report(), without opening an inbound inspector port and without changing the host's exception-handling policy. - Browser-based operations work across environments through the same-origin environment bridge, so operators do not need direct connectivity to, or credentials for, each child.
Industry relevance. Self-hosted runtimes with a small mandatory install footprint, tunnel-based egress for locked-down networks, and centrally pushed updates map directly onto how enterprises run agents across heterogeneous infrastructure. The paper is equally clear about what is not provided: no per-tool permissions, no sandbox, no multi-tenant isolation, and no general patch activation or failed-call recovery — gaps that matter for anyone considering production deployment.
Future Directions
- Close the L5 gap. Implement mechanisms for activating a source patch inside a running program and for recovering the failed call, addressing the stated hazards of state, reference validity, and unknown side effects from the original attempt.
- Measure what is currently only contracted. Latency, context-guard compression quality and overhead, deployment cost as the fleet grows, and debugger repair accuracy evaluated with independent hidden tests and recorded tool receipts rather than prompt-content checks.
- Add enforceable authority boundaries. The paper names missing per-tool approval, sandboxing, and general secret redaction for locals, plus the gap in enforceable tool admission for reversing arbitrary shell effects, as open problems.
- Harden transport and topology. Certificate pinning for loopback replay, schema negotiation or drift detection between parent tool descriptions and child implementations, and a health state that distinguishes a live control connection from a broken data plane.
- Extend diagnosis beyond a single process. The paper notes that a workspace path inferred on the incident machine may not exist at the service, that
DEBUGGER_WORKSPACEaddresses source visibility only, and that the stock diagnostic payload does not automatically select aremote_env— pointing to shared storage or explicit remote binding through an appropriate driver.
Target Audience
Engineers and researchers building LLM agent runtimes or self-hosted agent services; infrastructure and platform teams who need agents to act across NATed, locked-down, or heterogeneous machines; Python developers interested in process-level debugging and repair workflows driven by a model; and reviewers who want a carefully bounded example of how to report agent-systems evidence without overclaiming. Readers seeking benchmark numbers, repair-accuracy results, or production case studies will not find them here — the paper says so directly.
Authors’ abstract
LLM agents can use remote tools and cloud sandboxes, but integrating reasoning, session state, and heterogeneous execution sites remains a runtime design problem. We present Linglong Agent Service (agentsvc), a self-hosted HTTP service and embeddable Python runtime that treats execution site as a configurable dimension alongside model, tools, and context. A parent service retains inference orchestration, tool descriptions, and conversation history; each inference request…
The full abstract on arXivRelated papers
- ACE-Brain-0.7: Learning Execution-Grounded Reasoning for Embodied Agents 2026-11-19 · cs.RO · Key terms of the title in common
- Learning and Verifying Progress: Closed-Loop Agentic Planning with Progress-Enhanced Execution for Long-Horizon Vision-Language Navigation 2026-11-16 · cs.RO · Key terms of the title in common
- Cooperative Transport of Unknown Objects by Distributed Effort Regulation in Multi-agent Systems 2026-11-15 · cs.RO · Key terms of the title in common
- Reasoning on Call: Efficient Agentic Robot Control for Long-Horizon Robot Manipulation 2026-11-19 · cs.RO · Key terms of the title in common
- Selective Cooperative Perception via Blind Spot Reasoning and Agentic Dialogue with Vision-Language Models 2026-11-07 · cs.RO · Key terms of the title in common