-
Notifications
You must be signed in to change notification settings - Fork 13
Fix: Ensure Package objects always have valid status #755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
**Problem:**
"Package missing required package_id for AdCP response" error occurred
when Package objects were created with status=None or invalid status
values (e.g., TaskStatus.INPUT_REQUIRED).
**Root Cause:**
1. Package.model_dump() validated required fields by checking the
serialized dict (data.get("package_id")), but exclude_none=True
(default) would exclude None values, making the check ineffective
2. Two code paths created packages without proper status:
- Manual approval flow: set status to None
- Config approval flow: set status to TaskStatus.INPUT_REQUIRED
(not a valid AdCP Package status)
**Solution:**
1. Changed Package.model_dump() validation to check object attributes
(self.package_id, self.status) instead of serialized dict
2. Set status="draft" in manual approval flow (line 1870)
3. Changed status from TaskStatus.INPUT_REQUIRED to "draft" in config
approval flow (line 2239)
**Testing:**
- Validation now properly detects None values even with exclude_none=True
- All Package objects created in response flows have valid AdCP-compliant
status values ("draft", "active", "paused", "completed")
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
The test was missing the required 'selection_type' field in publisher_properties, causing schema validation to fail per AdCP spec. Publisher properties require either selection_type='by_tag' with property_tags or selection_type='by_id' with property_ids. This was a pre-existing test issue, not caused by the package status changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
youbek
pushed a commit
that referenced
this pull request
Nov 17, 2025
* Fix: Ensure Package objects always have valid status
**Problem:**
"Package missing required package_id for AdCP response" error occurred
when Package objects were created with status=None or invalid status
values (e.g., TaskStatus.INPUT_REQUIRED).
**Root Cause:**
1. Package.model_dump() validated required fields by checking the
serialized dict (data.get("package_id")), but exclude_none=True
(default) would exclude None values, making the check ineffective
2. Two code paths created packages without proper status:
- Manual approval flow: set status to None
- Config approval flow: set status to TaskStatus.INPUT_REQUIRED
(not a valid AdCP Package status)
**Solution:**
1. Changed Package.model_dump() validation to check object attributes
(self.package_id, self.status) instead of serialized dict
2. Set status="draft" in manual approval flow (line 1870)
3. Changed status from TaskStatus.INPUT_REQUIRED to "draft" in config
approval flow (line 2239)
**Testing:**
- Validation now properly detects None values even with exclude_none=True
- All Package objects created in response flows have valid AdCP-compliant
status values ("draft", "active", "paused", "completed")
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
* Fix: Add missing selection_type to publisher_properties in test
The test was missing the required 'selection_type' field in publisher_properties,
causing schema validation to fail per AdCP spec. Publisher properties require
either selection_type='by_tag' with property_tags or selection_type='by_id'
with property_ids.
This was a pre-existing test issue, not caused by the package status changes.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
danf-newton
pushed a commit
to Newton-Research-Inc/salesagent
that referenced
this pull request
Nov 24, 2025
…ol#755) * Fix: Ensure Package objects always have valid status **Problem:** "Package missing required package_id for AdCP response" error occurred when Package objects were created with status=None or invalid status values (e.g., TaskStatus.INPUT_REQUIRED). **Root Cause:** 1. Package.model_dump() validated required fields by checking the serialized dict (data.get("package_id")), but exclude_none=True (default) would exclude None values, making the check ineffective 2. Two code paths created packages without proper status: - Manual approval flow: set status to None - Config approval flow: set status to TaskStatus.INPUT_REQUIRED (not a valid AdCP Package status) **Solution:** 1. Changed Package.model_dump() validation to check object attributes (self.package_id, self.status) instead of serialized dict 2. Set status="draft" in manual approval flow (line 1870) 3. Changed status from TaskStatus.INPUT_REQUIRED to "draft" in config approval flow (line 2239) **Testing:** - Validation now properly detects None values even with exclude_none=True - All Package objects created in response flows have valid AdCP-compliant status values ("draft", "active", "paused", "completed") 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * Fix: Add missing selection_type to publisher_properties in test The test was missing the required 'selection_type' field in publisher_properties, causing schema validation to fail per AdCP spec. Publisher properties require either selection_type='by_tag' with property_tags or selection_type='by_id' with property_ids. This was a pre-existing test issue, not caused by the package status changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> --------- 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
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
Fixes "Package missing required package_id for AdCP response" error by ensuring Package objects always have valid AdCP-compliant status values. Changed validation to check object attributes instead of serialized dict, and ensured both approval workflows set status to "draft".
Changes
🤖 Generated with Claude Code