Agent Context Protocol Upgrade: Background Tasks and Skill Loading in Practice
This article explains how the agent context protocol is evolving from simple tool calling toward two-way capability collaboration. It covers on-demand skill loading to preserve context window budget, task delegation for long-running background work, interactive user confirmation at high-risk steps, and direct file uploads that bypass the model context. It also outlines an open specification approach and practical rollout advice, including skill catalog governance, task state handling, tiered confirmation, and evaluation sets for failure paths.
1. Upgrade Background: From Tool Calling to Capability Collaboration
As agent applications move into production, the industry has run into a structural bottleneck. Early context protocols mainly solved the “connection” problem: letting the model know which external tools are available. They did not adequately address the “how to get things done” problem. Tool names and descriptions can express interface capabilities, but they struggle to carry business workflows, industry standards, internal organizational conventions, and multi-step operational experience. The result is that models in real business scenarios can often “call tools but not complete tasks.”
The direction of this protocol upgrade is essentially to move the relationship between agents and external services from one-way tool calling to two-way capability collaboration. External services can not only expose tools but also deliver domain knowledge and workflows; not only return results synchronously but also run tasks in the background over a longer period; not only complete actions within a single interaction but also pause at critical points to ask the user for input. For developers and enterprise users, this means the focus of agent engineering shifts from “piling up tools” to “designing collaboration protocols and workflow orchestration.”
2. Skill Loading: Bringing Domain Knowledge into Context on Demand
1. Problem: The Context Window Is a Scarce Resource
The most common cause of failure in long-workflow agents is not insufficient model capability but context being crowded out by irrelevant information. Injecting all business standards, operation manuals, and historical cases into the prompt at once leads to three consequences: higher first-response latency, decision interference from irrelevant information, and costs that accumulate quickly as the session grows.
2. Mechanism: Separating Capability Declarations from Knowledge Payloads
The upgraded approach can be abstracted into two layers. The first layer is the capability declaration, which stays lightweight and only describes “which skills exist and when they apply.” The second layer is the knowledge payload, which contains best practices, constraints, and multi-step procedures and is loaded only when a matching scenario is hit. This layered design decouples routing decisions from knowledge consumption: the model first makes a coarse-grained selection, then retrieves fine-grained guidance.
A schematic skill declaration structure is shown below (it expresses a general concept only, not a specific interface):
{"skills": [{"name": "storefront_layout_review","when_to_use": "When you need to evaluate or adjust page information architecture","payload_ref": "skills/storefront/layout.md"}]}
3. Engineering Priorities: Discoverable, Routable, Updatable
- Discoverable: keep the skill list short and stable; avoid hundreds of entries that make selection difficult.
- Routable: specify trigger conditions and counterexamples for each skill to reduce incorrect loading.
- Updatable: skills evolve with server-side versions, so clients do not need separate installation, lowering operational cost.
- Customizable: the same capability can deliver differentiated workflows for different roles or organizations, achieving “same tool, different approach.”
4. Practical Benefits
In scenarios such as e-commerce page design and updates, customer configuration guidance, and internal enterprise knowledge analysis, skill payloads carry “common industry practices plus internal organizational standards.” After loading them on demand, the model produces output that fits the business better while leaving context budget for the data and conversation that truly matter.
3. Background Tasks: Moving Long-Running Work Off the Main Path
1. The Blocking Problem in the Traditional Model
Under synchronous model calls, the agent cannot advance to subsequent steps until a tool call completes. For time-consuming operations such as building indexes, batch data processing, and complex codebase analysis, the main path is occupied for a long time, hurting both user experience and throughput.
2. The Task Delegation Model
The upgrade introduces a “task handle”: the agent receives an identifier immediately after starting a long-running task and continues with other work, then obtains the result via callback or polling once the task finishes. The state machine can be simplified as:
submitted -> running -> succeeded | failed | canceled
The corresponding general call semantics can be expressed as:
{"action": "submit_task","payload": { "type": "repo_scan", "target": "service-a" },"return": { "task_id": "t-123", "status": "submitted" }}
3. Design Recommendations
- Idempotent submission: deduplicate by business key to avoid duplicate tasks.
- Timeout and retry: distinguish retryable errors from non-retryable ones.
- Result lifecycle: define how long results are retained and how they are cleaned up.
- Observability: carry the task identifier through logs, metrics, and traces to help locate long-tail issues.
- Resource isolation: run background tasks and online interactions on separate resource pools to prevent mutual contention.
4. Interactive Elicitation: Adding Human Confirmation at Key Points
High-risk actions require a human in the loop. Interactive elicitation lets the server pause before execution and request additional information or authorization from the user via a form or link, then resume from where it left off. Typical scenarios include creating billing resources, performing irreversible data changes, and deleting code repositories.
The recommended engineering principle is “minimal necessary elicitation”: interrupt only at medium- and high-risk points, and ask only for the required fields at a time. Elicitation state should also be persisted so that a session interruption does not lose the workflow. A schematic flow is shown below:
{"action": "elicit","reason": "destructive_sql_confirmation","fields": ["confirm_statement"],"resume": "after_user_submit"}
5. Direct File Upload: A Transfer Path That Bypasses the Context Window
The goal of file upload capability is to let documents, spreadsheets, and images go directly into external service processing without passing through the model context. This significantly reduces token consumption and avoids interference with inference stability from large files. Three points matter in implementation: validate type and size up front; encrypt transfers and enforce access control; and clean up and keep an audit trail after processing. In the general capability portfolio of Baidu AI Cloud, this kind of need is typically handled by foundational components such as object storage, logging services, and monitoring and alerting.
6. Open Specification and Ecosystem Significance
The capabilities above belong to an open protocol specification and its extensions, not to a single client. This means a server implementation can be reused across multiple compatible clients, avoiding repeated adaptation. For developers, skill payloads, task interfaces, and elicitation interactions should be treated as “portable assets,” managed with versioning, and covered by contract tests in continuous integration to ensure consistent behavior across clients.
7. Rollout Recommendations and Risk Control
- Govern the skill catalog first: keep it at a routable scale and fill in trigger conditions for each skill.
- Then rework long tasks: change blocking calls to task delegation and improve state handling and retries.
- Introduce tiered confirmation: configure elicitation policies by risk level and retain a complete audit trail.
- Keep the file path independent: route files through a direct upload channel, decoupled from the conversation context.
- Build an evaluation set: cover abnormal paths such as incorrect skill loading, task timeouts, and users denying authorization.
In summary, the core value of the protocol upgrade is not a few new features but bringing four elements—knowledge, execution, confirmation, and files—into a unified collaboration framework. If developers use the open specification as a baseline and observability and rollback as constraints, they can build more stable and controllable agent systems in complex business scenarios.
