Repository navigation
Validate Agent configuration with official error fields - #61
Merged
Merged
Conversation
Agent create and update and the inline Session agent rejected structural configuration errors with the local unsupported_or_invalid_configuration or invalid_request code, a null param and local messages, while the official service reports invalid_request_error with the JSON path as param (TV-01). Core also saved repeated function names, web_search and tool_search declarations and non-object schema roots that the official service rejects (TV-02, TV-03), and reported the none input requirement before an invalid inline agent (TV-04). A compact path-tracking validator now walks the raw JSON along the pinned shapes (the tool unions, text, reasoning, service_tier and multi_agent) before the existing parsers and harness admission. It reports the first violation through the typed field error with the observed message forms and the pinned enum lists, prefixing Session paths with agent. Repeated tools and explicit non-object root types return the observed messages with a null param; Session admission also applies these checks to resolved saved configurations. Caller-supplied names and values are only repeated when short and printable, following the Environment Files rule. Values the official service accepts are unchanged (TV-07), and harness admission limits and saved web_search modes keep their local code (TV-05, TV-06).
Replay the TV-01..03 rows on Agent create by two tenants, on updates of owned, foreign, missing and malformed Agents, and on inline and saved-override Session creates with and without input. Every response must match byte for byte and a database digest must show no writes. A saved record from before the checks cannot execute and stays invisible to another tenant, while the K1 values are saved and read back. The pinned-SDK acceptance scripts assert the new codes, params and messages on Agent create, Agent update (identical for owned, foreign and missing Agents) and inline Session create, and save function names that the official service accepts.
Add the dated batch section to the official semantics alignment document with rows C1-C4 and K1-K3, the scan evidence, the validator design, message and echo decisions, and the deferred items, including TV-05. Register the batch as Z in the operation evidence inventory and update the Agent create, Agent update and Session create rows. Update CONTRIBUTING, the contract README and the execution-tools, tool-policy, structured-output and tool-search coverage where they described repeated tools, schema roots or web_search errors as local gaps.
The validator checked only the last copy of a repeated member, but
encoding/json merges repeated objects into the decoded pointer structs
and matches member names case-insensitively. A text object given twice
could therefore store an array-root output schema, and
{"reasoning":{"Effort":"high"},"reasoning":{}} stored effort high.
Report unknown members, including names that differ from a member only
by case, and repeated members in document order before any value is
checked, anywhere in the validated configuration tree. A repeated member
returns 400 invalid_request_error with its path as param and the local
message "Duplicate parameter: '<path>'.", since the official response
is unobserved. Members left to the existing parsers are validated on the
decoded values, so they cannot differ from what is stored.
Handler tests cover the reviewer examples on Agent create, update and
Session create with and without input, and the PostgreSQL replay proves
that they write nothing.
Replace the claim that a repeated member is checked with its last value: unknown and repeated members are rejected in document order, with a local duplicate message, because decoding merges repeated objects and matches names case-insensitively. Record that inline agent validation runs before same-key creation recovery, so a retry of an inline Session created before this batch returns the new 400 when its original configuration is now invalid, while saved-Agent retries still recover. Core is pre-release, so the order is unchanged.
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-owned validation of Agent configuration (saved Agent create/update and the inline
agenton Session create) now rejects what the official service rejects, with the official error fields. Native harness admission limits are unchanged. The pinned baseline is unchanged (SDK 3.13.0 / d7c41ef /agents=v1).Behavior
tools[],text.format,reasoning,service_tier,multi_agentand so on, return 400invalid_request_error:agent.on Session create;web_searchortool_searchtool, return 400 with the observed messages.parametersandtext.formatjson_schema whose root is nottype: objectreturn the observed 400 messages, for every harness, before harness admission.noneinput requirement, as officially observed.reasoning.effort: max,service_tier: flex.unsupported_or_invalid_configuration.web_searchmodes (TV-05, pending a separate decision).Evidence
Campaign scan 3 findings TV-01..07 (owned official requests, all resources deleted). All 44 official TV records were replayed against this branch: 42 match on status, code, param and message, and the other 2 are the intentional K3 rows. Recorded in
official-semantics-alignment.mdandoperation-evidence.md(entry M; rows 1, 3, 6).Validation
official_client.pyharness pass.make checktargets plus the Web typecheck, core-doctor, unit tests and build pass. The Playwright browser cases were not run on the server (no Google Chrome; skip approved by the user).make openapiis byte-identical.Documented differences
No full protocol compatibility is claimed.
Need help on this PR? Tag
@codesmithwith what you need. Autofix is disabled.