Skip to content

fix(storyboard-runner): create_media_buy enricher drops proposal_id, total_budget, idempotency_key from sample_request #1604

@bokelley

Description

@bokelley

Root cause

src/lib/testing/storyboard/request-builder.ts:207 — the create_media_buy enricher rebuilds the request from scratch and only spreads start_time / end_time / packages from step.sample_request. It substitutes account with resolveAccount(options) = {brand: {domain: 'test.example'}, sandbox: true} and silently drops:

  • proposal_id (sourced via $context.proposal_id after adcp#4088)
  • total_budget
  • idempotency_key

The YAML's proposal_id: \"\$context.proposal_id\" substitution never reaches the wire because the enricher discards it before send.

Symptom

Proposal-mode adapter gate test masks create_media_buy in EXPECTED_FAILURES (PR #1599). Without the mask, the adapter receives a request without proposal_id, can't look it up, returns an error or wrong-shape response, and fails the schema check.

Fix

The enricher should preserve all sample_request fields and only override what it explicitly needs to (account substitution). Spread step.sample_request first, then layer the runner's substitutions on top.

Acceptance

  • All sample_request fields reach the wire when the runner enriches create_media_buy (and any other tool with similar enrichment logic — audit request-builder.ts for the pattern).
  • Proposal-mode adapter gate test passes with empty EXPECTED_FAILURES.
  • Drop the create_media_buy allowlist entry from test/examples/hello-seller-adapter-proposal-mode.test.js (fix(test): drop stale get_products_refine allowlist on proposal-mode adapter #1599).
  • Add a regression test that pins the field-pass-through for at least one mutating tool with discriminator-bearing fields in sample_request.

Refs

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions