Repository navigation
feat: serve request_account and account requests from the AccountStore - #1808
Merged
Merged
Conversation
A decisioning AccountStore can now serve AdCP 3.3 account.requests, the Python counterpart of adcp-client#3586: - request_account on the store serves the tool, advertises it, and adds the account.requests capability block with supported, request_task and read_task, plus the account.requests experimental feature id. Optional lists come from the declared account.requests. Callers before 3.3 see neither, and a feature claim without the hook is dropped. - list_requests serves account_requests and account_requests_pagination on list_accounts when the buyer sends include_requests, request_ids or requests_pagination, for 3.3 callers only. - The framework never invents billing claims: a store with request_account and no declared account.supported_billing is refused at construction with ConfigurationError, as are list_requests without list and a declared account.requests without the hook. request_account without list_requests warns that buyers cannot poll. - Account.revision is served on list_accounts to 3.2 and later callers. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Ladon verdict: Approve
Approve — clean, additive seller-side request_account / account.requests support (AdCP 3.3), the counterpart to adcp-client#3586.
What I checked:
- Semver signal:
feat:is correct — new exports and two Protocol methods are additive optional surface; nothing removed, retyped, or flipped required↔optional on a public model. No breaking change shipped under a non-breaking prefix. - Version-translation pathway (DR-0032/0033):
account.requestsblock + feature id gated to 3.3+;_project_account_requests(handler.py:2444-2467) drops both for sub-3.3 callers and when the hook is absent. Revision gated to 3.2+ inlist_accounts(handler.py:3529-3533), andto_wire_accountis reached only via_project_list_accountsso revision never leaks throughsync_accounts. Droppable pathway, tested. - Config fail-closed:
_validate_account_requests_config(handler.py:2452-2480) refusesrequest_accountwithoutsupported_billing,list_requestswithoutlist, declaredaccount.requestswithout a hook, warns onrequest_accountwithoutlist_requests— each case tested. - No credentials in
ctx_metadata, generated code untouched, import layering respected.
High-risk flag: true, but all six matching files are (modified) with no medium-or-higher findings — presumed safe per the modified-file rule. No deletions.
No blocking or medium findings. One non-blocking note (account_requests[] items bypass strip_credentials_from_wire_result — harmless today, schema has no secret fields; follow-up only if request records gain adopter passthrough).
No no-auto-approve team match, gated_paths false. Falls through to row 9.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This adds the seller side of
request_accountfor Python, the counterpart of adcp-client#3586. The reporting-subscriptions DX work had deferred it. A decisioningAccountStorecan now serve AdCP 3.3account.requests, so a Python seller can serverequest_accountand list pending requests. A Python or TS buyer'sclient.accounts.ensure/changethen routes to it.request_accounthook (AccountStoreRequestAccount)PlatformHandler.request_accountprimes the caller's identity, assync_accountsdoes, and calls the hook with aResolveContext.{"status": "completed", "request": ...}. A full response passes through.not_supportedand is not advertised.Capability (gated to 3.3 and later)
account.requestswithsupported: true,request_task: "request_account"andread_task: "list_accounts";account.requestsexperimental feature id.changeable_attributes,pending_action_kinds,event_type) come from the seller's declaredDecisioningCapabilities.account.requests. The task names are always the framework's.experimental_featuresclaim made without the hook is dropped.list_requestshook (AccountStoreListRequests)list_accountsservesaccount_requests[]andaccount_requests_pagination(fromAccountRequestsPage.next_cursor/total_count).include_requests,request_idsorrequests_pagination, and only for 3.3 callers. The accounts page is unchanged.No fabricated claims. The capabilities schema requires
supported_billingin the account block. TS synthesizes{ supported_billing: ['agent'] }; this PR does not. These configurations are refused at construction withConfigurationError:request_accountwithout a declaredaccount.supported_billing(or the legacy flatsupported_billing);list_requestswithoutlist;account.requestswithout the hook.request_accountwithoutlist_requestswarns that buyers cannot poll a pending request, as TS does. Request-scoped capabilities (get_adcp_capabilities_for_request) that dropsupported_billingwhile the hook is set raise the same error at request time.Account.revisionis served onlist_accountsto 3.2 and later callers, as TS #3586 does. Buyers read it before a change.request_accountandlist_requestsjoin_ACCOUNT_STORE_METHODS, soPlatformRouterkeeps them on the router's store. The accounts guide gains Servingrequest_account(sellers).Deliberate differences from TS #3586
opts.accounts.requestAccount). Here it is a method on theAccountStore, next tolist_requests, as the DX plan proposed (accounts.request).account.requestscapability model, not a separateaccountRequestsoption.Test plan
tests/test_account_requests_seller.py:ConfigurationErrorcase, and the warning.request_accountserves the hook's record (the response validates againstRequestAccountResponse), withtool_name="request_account"on the context.list_accountschecks:list_requestsonly when asked, and returns paging;request_idsfilters;revisionis served from 3.2 and stripped for 3.1;ListAccountsResponse.ADCPClientreads the handler's capabilities, andensureroutes torequest_account(notsync_accounts), givingAccountPending.refresh()isAccountReadythroughlist_accountsrequest_ids.ensureopens no duplicate request.ruff checkandmypy src/adcp/decisioning/.🤖 Generated with Claude Code