feat(adk): warn when the agentex server reports an unsupported version#410
feat(adk): warn when the agentex server reports an unsupported version#410max-parke-scale wants to merge 5 commits into
Conversation
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…tibility (#405) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…erver contracts (#407) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
…wheel install (#406) Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Runtime complement to the build-time compat suite (#407): the ADK reads the server's X-Agentex-Version response header and warns once, loudly, when the server's contract version is older than MIN_SUPPORTED_SERVER_VERSION — the 0.13.0 failure mode (a current client against an older deployed server) the build-time test can't see. - _server_compat.py: parse + compare + warn-once; AGENTEX_STRICT_SERVER_VERSION raises instead. No-op when the header is absent/unparseable (servers predating the header can't be identified). - Installed as an httpx response hook in the ADK client factory (hand-authored, preserved across codegen). Covers the ADK path; bare-client coverage is a follow-up (needs a Stainless hook, not a generated-file edit). Dormant until servers emit the header (scale-agentex#321 adds it). Floor kept in sync with the compat suite's min-supported. AGX1-367. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Shape is right — warn-once + strict-env escape hatch + no-op on absent header is exactly the cardinality you want when the header rides every response. Two substantive things worth flagging:
Other small note for the merge queue: floor stays at |
|
Closing in favor of #408, which implements the same runtime SDK↔backend version guard (AGX1-367) more cleanly: it reads the backend's 🧑💻🤖 — posted via Claude Code |
What
The ADK warns once, loudly, when the agentex server it's talking to reports a contract version older than the SDK supports — the runtime complement to the build-time compat suite (#407). It reads the server's
X-Agentex-Versionresponse header and compares toMIN_SUPPORTED_SERVER_VERSION.Why
#407 validates the client's requests against the supported-server window at build time; it can't see a deployment pointed at a server below the floor — the 0.13.0 failure mode (a current client against an older deployed server). This catches that at runtime.
How
agentex/lib/_server_compat.py: parse + compare + warn once per process;AGENTEX_STRICT_SERVER_VERSION=1raises instead. No-op when the header is absent or unparseable (servers predating the header can't be identified — silent by design).create_async_agentex_client(hand-authored, preserved across Stainless codegen — deliberately not the generated_base_client.py).Coverage / scope
Covers the ADK path — how agents build their client, i.e. the incident path. The bare slim client used by REST-only consumers isn't covered, because that would mean editing the Stainless-generated base client; bare-client coverage is a follow-up (needs a Stainless-supported hook).
Status
Dormant until servers emit the header — that's scaleapi/scale-agentex#321 (release pipeline + version) plus a small middleware to set
X-Agentex-Version(a follow-up PR stacked on #321). The check tolerates the absent header (silent), so this is safe to merge now.MIN_SUPPORTED_SERVER_VERSIONstarts permissive (0.1.0) and is kept in sync with #407'smin-supported.Test
tests/lib/adk/test_server_compat.py: below-floor → warns once; at/above → silent; absent/unparseable → silent; strict → raises; factory installs the hook; the installed hook checks the header.ruff,pyright, and animport agentex.lib.adksmoke pass.Implements AGX1-367.
🧑💻🤖 — posted via Claude Code