Skip to content

Conversation

@bokelley
Copy link
Contributor

Summary

Fixes #758 - Products now default to the AdCP "all" variant for publisher_properties when no properties are explicitly set, ensuring all products have valid publisher_properties.

Problem

Products created without properties/property_ids/property_tags would fail validation with "Product must have at least one publisher_property per AdCP spec."

Solution

Modified Product.effective_properties to default to {"publisher_domain": tenant_domain, "selection_type": "all"} instead of returning None, matching the first variant of the AdCP PublisherProperties discriminated union.

Testing

All 1001 tests pass (955 unit + 31 integration + 15 integration_v2), including all AdCP contract validation tests.

Fixes #758 - Product creation now succeeds when no properties are set

**Problem:**
Products without properties/property_ids/property_tags set would fail
validation with "Product must have at least one publisher_property"
because effective_properties() returned None.

**Solution:**
Modified Product.effective_properties to default to the "all" variant
when no properties are specified:
```python
{"publisher_domain": tenant_domain, "selection_type": "all"}
```

This matches the AdCP PublisherProperties schema (first variant) and
ensures all products have valid publisher_properties.

**Changes:**
- src/core/database/models.py: Update effective_properties to return
  default "all" variant instead of None
- Updated docstring to document default behavior

**Testing:**
- All 48 AdCP contract tests pass
- Verified Pydantic validation accepts the new format
- Tested Product creation with minimal fields

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

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley bokelley merged commit 690f2b1 into main Nov 19, 2025
8 checks passed
danf-newton pushed a commit to Newton-Research-Inc/salesagent that referenced this pull request Nov 24, 2025
…extprotocol#759)

Fixes adcontextprotocol#758 - Product creation now succeeds when no properties are set

**Problem:**
Products without properties/property_ids/property_tags set would fail
validation with "Product must have at least one publisher_property"
because effective_properties() returned None.

**Solution:**
Modified Product.effective_properties to default to the "all" variant
when no properties are specified:
```python
{"publisher_domain": tenant_domain, "selection_type": "all"}
```

This matches the AdCP PublisherProperties schema (first variant) and
ensures all products have valid publisher_properties.

**Changes:**
- src/core/database/models.py: Update effective_properties to return
  default "all" variant instead of None
- Updated docstring to document default behavior

**Testing:**
- All 48 AdCP contract tests pass
- Verified Pydantic validation accepts the new format
- Tested Product creation with minimal fields

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

Co-authored-by: Claude <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.

Mock external agent services in integration_v2 tests

2 participants