Skip to content

fix: correct tool name in list_creative_formats method#10

Merged
bokelley merged 1 commit intomainfrom
hardcoded-tool-name-bug
Nov 6, 2025
Merged

fix: correct tool name in list_creative_formats method#10
bokelley merged 1 commit intomainfrom
hardcoded-tool-name-bug

Conversation

@bokelley
Copy link
Copy Markdown
Contributor

@bokelley bokelley commented Nov 6, 2025

Summary

Fixed critical copy-paste bug where list_creative_formats() was calling adapter.call_tool("update_media_buy", ...) instead of the correct "list_creative_formats" tool name.

Test Improvements

  • Added parameterized test verifying all 9 methods call correct tool names
  • Enhanced protocol tests to verify HTTP/MCP request details
  • Fixed test mocking to verify arguments, not just invocation
  • Removed non-functional stub tests

All 68 tests pass.

🤖 Generated with Claude Code

Fixed critical copy-paste bug where list_creative_formats() was calling
adapter.call_tool("update_media_buy", ...) instead of the correct
"list_creative_formats" tool name.

Bug Impact:
- Method was completely non-functional, calling wrong tool
- Activity logs showed incorrect task_type
- Webhooks and tracking would fail for this method

Root Cause:
- Copy-paste error from method template
- Over-mocked tests didn't verify tool name argument
- Tests passed because mocks returned success regardless of tool name

Test Improvements:
- Added parameterized test verifying ALL methods call correct tool names
- Fixed test_get_products to verify tool name argument
- Fixed test_multi_agent_parallel_execution to actually test execution
- Enhanced protocol tests to verify HTTP/MCP request details
- Removed non-functional stub tests from test_cli.py

All 68 tests now pass, including the new test that would have caught
this bug immediately.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley bokelley merged commit d9eff68 into main Nov 6, 2025
6 checks passed
bokelley added a commit that referenced this pull request Apr 30, 2026
…design

Round-4 review pass synthesizes (a) the TS team's review of the parallel
@adcp/client port (PR #1005, EmmaLouise2018), (b) the TS team's
decisioning-platform-python-port-v2.md RFC, and (c) Yahoo's ask for
typed framework-owned state threading on RequestContext.

Guiding principle ported from the TS port: "make it impossible for an
implementer to screw up via typing." Python can't match TS's
compile-time RequiredPlatformsFor<S> gate, but per-method typed
surfaces, runtime validate_platform fail-fast, and Protocol structural
matching close most of the gap.

Highlights:

- D15 NEW: typed RequestContext sub-readers (state + resolve).
  - StateReader (sync) — find_by_object, find_proposal_by_id,
    governance_context, workflow_steps. Lets platforms read prior
    workflow context without re-querying their own DB.
  - ResourceResolver (async) — property_list, collection_list,
    creative_format. Framework-mediated cache + validation.
  - Surface ships in v6.0 with no-op stub backings; impls fill in
    for v6.1 (same gating as TS side). Locks the typed contract so
    adopters write the right shape from day one.

- Round-4 changelog covers 8 cross-language items applied:
  - D14 enum coverage (Emma #6)
  - D7+serve() prod gate on InMemoryTaskRegistry (Emma #8)
  - Dispatch AdcpError projection consistency (Emma #10)
  - D6 sync-handoff register-before-cleanup race (Emma #11)
  - validate_platform catches validator throws (Emma #16)
  - Per-server status-change bus, not module-level singleton (Emma #17)
  - AdcpError ACCOUNT_NOT_FOUND semantic narrowing (Emma #18)
  - CI lint: examples can't reach into src/ (Emma #5)

- Bugs structurally avoided in our hybrid SalesResult[T] design
  documented (Emma #2, #3, #13, design concern #14) — worth calling
  out in foundation PR description; the framework-design choice gets
  the credit.

- File plan additions: state.py, resolve.py, context.py extensions for
  D15; four new test files for Round-4 regressions. Foundation PR
  total grew from ~2475 to ~2965 lines.

- Items deferred to follow-up PRs: ErrorCode Literal codegen (Emma #19),
  workflow-step/proposal/governance backing store (D15 v6.1),
  tasks/get wire surface.

- TS-only items (no Python equivalent) explicitly enumerated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant