Repository navigation
Align list query parsing with official families - #43
Merged
Merged
Conversation
Unknown list query keys are now ignored, while a repeated supported key still rejects with each family's observed error: the Beta duplicate-field deserialization error, the Skills duplicate_parameter code, or the retained Files rejection. Agent, Session, Item and Template lists clamp limit 0 to 1 and larger limits to 100. Turn, Subagent and Artifact lists keep rejecting values outside 1-100 with the Beta invalid_request_error code. Negative and non-integer Beta limits use the observed deserialization message; Vault and Credential lists keep their pinned clamp. Skills accept limit 0 as an empty page reporting has_more and use the observed integer range codes. Files range errors have a null code. A scalar Vault/Credential status combined with status[] filters by their union, and an explicit empty Files purpose applies no filter.
The official service ignores unrecognized query keys on resource reads, writes and deletions; a deleted Vault or Agent still returns 404. No single-resource operation in the pinned SDK sends a typed query parameter, so the blanket "does not accept query parameters" and invalid-input rejections are removed from every such handler. Authentication, tenant scoping and missing/foreign not-found masking are unchanged: a tenant_id query key is ignored like any other unknown key.
official_list_query.py now replays the batch matrix against real HTTP and PostgreSQL with the pinned SDK: unknown list keys, family-specific duplicate errors, per-family limit bounds including the Skills zero page, the Vault/Credential status union and the Files empty purpose, each as tenant A and tenant B, plus unknown keys on single-resource reads, event admission, streams, updates and deletions. Other acceptance scripts that asserted the former blanket rejections now assert that unknown keys are ignored without selecting another tenant, exposing secrets or bypassing body validation.
list-query-semantics.md gains a dated section with the A1-D2 matrix, the campaign-scan-1 request IDs, the recorded decisions, local choices for unsampled inputs and the remaining deferrals. operation-evidence.md registers the evidence and updates the affected list rows; related contract prose and the CONTRIBUTING list-query paragraph follow the new behavior. openapi.yaml is regenerated from the updated annotations.
CONTRIBUTING, the contract README, the service README and the Environment Files contract still described the former blanket query rejection, the mixed status rejection and the old limit policy. They now describe the per-family limit policy, the status union and ignored unknown keys. The list query sections now also state precisely that the Environment Files list keeps its own strict key parser and validates its query only after the Environment lookup.
Environment file creation, Artifact deletion, File upload and Skill and Skill version upload ignore unknown query keys. The new handler tests show that the body is still validated, that query keys never become multipart form fields or select a tenant, and that a foreign resource still returns the same 404 as a missing one without writing.
verify_resource_queries now also uploads a File and a Skill with its version through the pinned SDK with unknown query keys, checks that a query purpose or default is not a form field, and that a foreign Skill version upload returns the same 404 as a missing Skill.
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
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.
Core rejected many list and resource query strings that the official Agents API accepts or rejects differently. This batch aligns the shared list parser and query handling with owned official observations. The pinned baseline is unchanged (SDK 3.13.0 / d7c41ef /
agents=v1).Behavior
unsupported_parameter. Only authentication selects the tenant. Foreign and missing resources stay indistinguishable, and body validation is unchanged.invalid_request_errorwith the duplicate-field message.duplicate_parameter, paramlimit/key.invalid_request_error.has_morereports remaining resources. Out-of-range values returninteger_above_max_value/integer_below_min_valuewith paramlimit.statuscombined withstatus[]filters Vaults/Credentials by their union.purpose=means no filter.Decision: the pinned Turn/Item/Template docstrings say "between 1 and 100". Clamping keeps the effective page inside that range, so Items and Templates follow the live service's clamp. Turns keep rejecting because the live service rejects.
Evidence
Campaign scan 1 sent 252 owned official requests across three families, with request IDs retained privately. It included 4 official
noneSessions with 6 tiny Turns; every owned official resource was deleted and verified. The matrix, the decisions and the deferred items are recorded incontracts/agents-api/list-query-semantics.mdandoperation-evidence.md(entry L).Validation
5e1171b), all rows passed.make -o check-web checkplus Web typecheck, core-doctor, 287 client tests, 583 Web tests and the build all passed. The Playwright browser cases were not run on the server, because it has no Google Chrome; this skip was approved by the user.make openapiregenerates the committed schema byte for byte. There are no SQL changes.Deferred
Not part of this change and registered on the board:
limit=abcversuslimit=-1codes are inconsistent.limit=messages.No full protocol compatibility is claimed.
Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.