Skip to content

fix(server): default supported_billing: [] in createAdcpServerFromPlatform (match v5 behavior)#1196

Closed
bokelley wants to merge 2 commits into
mainfrom
claude/issue-1186-default-supported-billing
Closed

fix(server): default supported_billing: [] in createAdcpServerFromPlatform (match v5 behavior)#1196
bokelley wants to merge 2 commits into
mainfrom
claude/issue-1186-default-supported-billing

Conversation

@bokelley

@bokelley bokelley commented May 1, 2026

Copy link
Copy Markdown
Contributor

Closes #1186

Summary

When requireOperatorAuth is true (or derived from accounts.resolution: 'explicit') but supportedBillings is not set, the v6 createAdcpServerFromPlatform path projected the account block to the wire response but omitted supported_billing. The AdCP schema requires the field whenever account is present, so schema validation failed with missing required property 'supported_billing' — and the storyboard runner cascade-failed every subsequent step.

Root cause: src/lib/server/decisioning/runtime/from-platform.ts:767 used a conditional spread ...(supportedBillings?.length && { supported_billing: [...] }) that produced nothing when supportedBillings was undefined or empty. The v5 createAdcpServer path at create-adcp-server.ts:3431 correctly defaulted to supported_billing: capConfig.account.supportedBilling ?? [].

Fix: Replace the conditional spread with supported_billing: supportedBillings?.length ? [...supportedBillings] : [] — same one-line change the v5 path uses. Also corrects the DecisioningCapabilities.supportedBillings JSDoc which claimed the default was ['agent'] (it was always []).

What was tested

  • npm run format:check — passed
  • npx tsc --project tsconfig.lib.json — passed (pre-existing TS2688/TS5107 env errors unrelated to this change)
  • node --test test/server-decisioning-capability-projections.test.js13/13 pass (new regression test is test Fix A2A agent card validation endpoint #12)
  • Full suite: 4542 tests, 4278 pass, 220 fail — baseline has 222 fail; no new failures introduced
  • New regression test uses validation: { responses: 'strict' } to exercise the actual schema-validation path that the bug broke

Nits noted (not fixed in this PR):

  • The accounts.resolution: 'explicit' path in the pre-existing test (line 210) uses responses: 'off' — a follow-up could upgrade it to responses: 'strict' + assert supported_billing: []. The fix is correct for both paths since the logic is shared; this is a coverage gap, not a correctness gap.
  • docs/llms.txt and skills/build-retail-media-agent/SKILL.md have zero mentions of supportedBillings — doc improvement tracked in issue.

Pre-PR review

  • code-reviewer: approved — no blockers; fix is minimal and correct; test correctly exercises schema validation with responses: 'strict'
  • dx-expert: approved — no blockers; JSDoc correction is accurate; changeset bump (patch) is appropriate

Triage-managed PR. This bot does not currently iterate on
review comments or PR conversation threads (only on the source
issue). To unblock:

  • Push fixup commits directly: gh pr checkout <num>
    fix → push.
  • Or re-trigger: comment /triage execute on the source
    issue.

See adcp#3121
for context.

Session: https://claude.ai/code/session_01CbCVxFuiFnDHrBFwNFbWMs


Generated by Claude Code

…tform (adcp-client#1186)

When requireOperatorAuth is true (or derived from accounts.resolution:
'explicit') but supportedBillings is not set, the v6 from-platform path
omitted supported_billing from the wire account block. The AdCP schema
requires the field whenever account is present, so schema validation
failed and the storyboard runner cascade-failed every subsequent step.

Fix: replace the conditional spread with supported_billing: [] default,
matching the v5 createAdcpServer behaviour. Also corrects the
DecisioningCapabilities.supportedBillings JSDoc which claimed the
default was ['agent'] (it is []).

Adds a regression test with responses:'strict' validation to lock in
schema compliance.

https://claude.ai/code/session_01CbCVxFuiFnDHrBFwNFbWMs
…6.3.0)

npm install during ci pre-check corrected a pre-existing version drift in
the lockfile. No dependency changes; version fields only.

https://claude.ai/code/session_01CbCVxFuiFnDHrBFwNFbWMs
@bokelley

bokelley commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

Triage: superseded by #1198

Issue #1186 was closed by #1198 (commit 14f011c7), which shipped a different default: ['agent'] (not []).

The schema requires supported_billing with minItems: 1 (schemas/cache/3.0.1/protocol/get-adcp-capabilities-response.json), so emitting [] would fail schema validation. #1198's ['agent'] default matches the platform-interface JSDoc contract at capabilities.ts:130 ("Defaults to ['agent'] when omitted") and is the least-surprising default for non-media-buy specialisms.

Closing this as superseded — the working fix is already on main.

@bokelley bokelley closed this May 1, 2026
@bokelley

bokelley commented May 1, 2026

Copy link
Copy Markdown
Contributor Author

Acknowledged — thanks for the context, @bokelley. Noted that #1198 is the authoritative fix on main with ['agent'] as the default (matching minItems: 1 schema requirement and the JSDoc contract at capabilities.ts:130). No further action from this session.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(server): default supported_billing: [] in createAdcpServerFromPlatform (match v5 behavior)

2 participants