Repository navigation
Description
Summary
On 8.0.0, PlatformHandler writes every TaskHandoff to self._registry and returns status: "submitted" with a task_id. It does not implement get_task_status, though, so a buyer polling that task_id gets NOT_SUPPORTED, and the tool is left out of tools/list. AdCP 3.2 defines get_task_status as the protocol polling tool, and the SDK's own ADCPClient polls it. A decisioning seller that hands off work therefore cannot be polled, unless it patches PlatformHandler.
Reproduction (adcp 8.0.0)
import asyncio
import warnings
warnings.simplefilter("ignore")
from adcp.decisioning import DecisioningCapabilities, DecisioningPlatform, SingletonAccounts
from adcp.decisioning.serve import create_adcp_server_from_platform
from adcp.server.mcp_tools import create_tool_caller, get_tools_for_handler
class Seller(DecisioningPlatform):
capabilities = DecisioningCapabilities(specialisms=["sales-non-guaranteed"], channels=["display"],
pricing_models=["cpm"])
accounts = SingletonAccounts(account_id="acct_1")
def get_products(self, req, ctx): return {"products": []}
def create_media_buy(self, req, ctx): raise NotImplementedError
def update_media_buy(self, media_buy_id, patch, ctx): raise NotImplementedError
def sync_creatives(self, req, ctx): raise NotImplementedError
def get_media_buy_delivery(self, req, ctx): raise NotImplementedError
def get_media_buys(self, req, ctx): raise NotImplementedError
async def main():
handler, executor, registry = create_adcp_server_from_platform(Seller(), validate_at_init=False)
task_id = await registry.issue(account_id="acct_1", task_type="get_products")
print("issued:", task_id, (await registry.get(task_id, expected_account_id="acct_1"))["state"])
print("advertised:", [n for n in ("get_task_status", "list_tasks")
if n in {t["name"] for t in get_tools_for_handler(handler)}])
result = await create_tool_caller(handler, "get_task_status")({"task_id": task_id})
print("get_task_status:", result)
executor.shutdown()
asyncio.run(main())Output:
issued: task_a606e95fbcd7409d submitted
advertised: []
get_task_status: {'supported': False, 'reason': 'get_task_status is not supported by decisioning platform', 'error': {'code': 'NOT_SUPPORTED', 'message': 'get_task_status is not supported by decisioning platform'}, 'status': 'completed'}
Details
adcp/server/base.py:703-723:get_task_statusandlist_tasksdefault to_not_supported.PlatformHandler(adcp/decisioning/handler.py) doesn't override either one, soget_tools_for_handlerfilters them out.adcp/server/mcp_tools.py:725-754: both tools are defined._schemas/3.2/manifest.json:get_task_statusis aprotocoltool, and thebuyer_activationstoryboard exercises it.adcp/decisioning/task_registry.py:95-137, 205, 354: the docstrings describe "the wiretasks/getpath", which always passesexpected_account_id. No such path exists. Nothing in the SDK reads the registry on behalf of a buyer.TaskRecord.to_dict()(task_registry.py:136-160) isn't the wire shape either: it returnsstaterather thanstatus, epoch floats rather than ISO timestamps, and noprotocol. Each adopter has to write that projection too.
Why an adopter hits this
Embedded Sales Agent uses async get_products handoff. To make those tasks pollable, it ships core/task_polling_compat.py (320 LOC). That file:
setattrsget_task_statusandtasks_getontoPlatformHandler;- appends a tool definition to
ADCP_TOOL_DEFINITIONS; - mutates the private
_ALL_TOOL_NAMES,_HANDLER_TOOLSand_PROTOCOL_TOOLS; - reimplements account scoping, the record-to-response projection, the TTL/expiry response and the unknown-task response.
The file is installed at startup from core/main.py. Every SDK upgrade risks breaking it silently. Without it, a buyer that receives submitted has no way to fetch the result.
Ask
- Implement
PlatformHandler.get_task_status. It should resolve the account the way other tools do, callself._registry.get(task_id, expected_account_id=account.id)and project the record toGetTaskStatusResponse, includingREFERENCE_NOT_FOUNDfor unknown or cross-account IDs. Advertise the tool whenever the handler can issue handoffs. - Add a list method to
TaskRegistry(or an optional protocol for it) so thatlist_taskscan be served the same way. - Optional: register
tasks_getas an alias for buyers still on the legacytasks/getname. Alternatively, add a publicregister_tool_alias()so adopters can do it without touching private sets.
Activity
bokelley commentedon Oct 2, 2026
Triage
Classification: Bug
Bucket(s): handlers (note: no
handlerslabel exists in this repo — bucket recorded here only)Status: ready-to-implement
What the experts said:
TaskRegistryis@runtime_checkable, adding a requiredlistmethod silently breaks existing custom registries atisinstancetime. Use a separateListableTaskRegistry(Protocol)mixin.TaskRecord.to_dict()returnsstate(notstatus) and epoch floats (not ISO strings) — the shim must project both; cross-tenant guard requires account resolution beforeregistry.get().PlatformHandlerpromises atask_id+submittedthen has no supported read-back path, forcing adopters into 320-LOCsetattrworkarounds. Item 1 must-fix; Item 2 safe only via optional protocol; Item 3 (alias) nice-to-have, defer.My take: The bug is confirmed and both experts converge. Items 1 and 2 are implementable non-breakingly; the change is well-scoped, testable, and ready for a PR as soon as someone picks it up.
Implementation scope:
src/adcp/decisioning/handler.py— Addget_task_statusoverride toPlatformHandler:resolve_account(same pattern as other shims).self._registry.get(task_id, expected_account_id=account.id)— account MUST be resolved first to enforce cross-tenant isolation.Nonereturn → respondREFERENCE_NOT_FOUND.record["state"]→"status",record["created_at"]/record["updated_at"]→ ISO 8601 UTC strings (not epoch floats). Includetask_type,progress,result,error,contextas the wire schema expects."get_task_status"toadvertised_tools_for_instanceunconditionally —PlatformHandler.__init__always requiresregistry, so advertising is always appropriate.list_tasks: advertise only whenisinstance(self._registry, ListableTaskRegistry)(see below); otherwise falls back to base_not_supported.src/adcp/decisioning/task_registry.py— AddListableTaskRegistry(Protocol)as a separate optional extension (NOT a new method on the existingTaskRegistryProtocol — that would be a breaking change):PlatformHandler.list_tasksdelegates toself._registry.list(account_id=account.id, ...)only whenisinstance(self._registry, ListableTaskRegistry).src/adcp/server/base.py— Update docstrings on theget_task_status/list_tasksstubs to note thatPlatformHandleroverrides them when aTaskRegistryis provided, so adopters don't subclass thinking they must implement it themselves.Tests — Cover:
get_task_statusround-trip (submitted → polled), cross-tenant probe returnsREFERENCE_NOT_FOUND,list_taskspresent/absent based on registry type,get_task_statusappears intools/listafter fix.Do not include item 3 (
tasks_getalias) in this PR — leave as a follow-up. The tool-vs-routing-alias question needs separate resolution.Non-breaking rationale: New method override on
PlatformHandler(callers going fromNOT_SUPPORTEDto real data is always safe).ListableTaskRegistryas a separate Protocol doesn't touchisinstance(x, TaskRegistry)checks. No public symbols renamed or removed.Required checks:
pytest(task registry + handler coverage),mypy src/,ruff check .Triaged by Claude Code. Session: https://claude.ai/code/session_01GkJrmKvkuxwvrUrjAReiRk
Generated by Claude Code