fix(adk): re-send task_id/agent_id in state updates for backend compatibility#405
Merged
Merged
Conversation
0.13.0's generated client dropped task_id/agent_id from states.update(),
and the ADK stopped sending them in the body. Backends predating
scale-agentex#278 still require those fields, so every state write 422'd
("Field required") — multi-turn context was lost on every turn (SEV,
~22k failures over ~21h on the Cengage agent).
Re-send both via extra_body. Backends post-#278 accept-and-ignore them,
so this is compatible with old and new servers. Adds a regression test
asserting StateService.update_state forwards them in the request body.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
dm36
approved these changes
Jun 17, 2026
deepthi-rao-scale
approved these changes
Jun 17, 2026
Merged
max-parke-scale
added a commit
that referenced
this pull request
Jun 17, 2026
Generalizes the #405 regression guard. Captures the requests the ADK emits (states.create/update for v1) and validates each against a window of supported server OpenAPI contracts vendored under tests/compat/server_specs/: `current` (scale-agentex main) and `min-supported` (pre-#278, which still requires task_id/agent_id in the state body). Catches the 0.13.0 class of break — a client that drops a field an older deployed server still requires. Verified: with the field-drop, states.update fails "task_id/agent_id required" against min-supported while passing current. Specs are vendored for deterministic CI (no network); refresh_specs.py re-pulls them at the SHAs in manifest.json. Advance min-supported as the oldest deployed server moves forward; extend _OPERATIONS for more ADK operations. Stacked on #405 (needs the extra_body fix so states.update passes). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
StateService.update_statere-sendstask_id/agent_idin thestates.updaterequest body (viaextra_body).Why
0.13.0's Stainless-generated client dropped
task_id/agent_idfromstates.update(), and the ADK stopped sending them. Backends predating scale-agentex#278 still require those fields, so every state write returned422 Field required. On the Cengage agent (centipede-student-assistant-agentex-agent) this dropped multi-turn context on every turn — ~22k failures over ~21h, logged at warn level so nothing alerted.Backends post-#278 accept-and-ignore the fields, so re-sending is compatible with both old and new servers — it closes the version-skew window where the client outran the backend rollout reaching the customer (2.10.0-rc).
Test
tests/lib/adk/test_state_service.pyassertsupdate_stateforwardstask_id/agent_idin the request body — KeyErrors without the fix.ruff check,pyright, and the test pass locally.Notes
Issue #1 of 3 from the 0.13.0 incident; ships in the 0.13.1 hotfix. The namespace-version guard (issue #2) is a separate PR; the APM route-doubling (issue #3) is under investigation.
🧑💻🤖 — posted via Claude Code
Greptile Summary
task_idandagent_idin thestates.updaterequest body viaextra_body.stateparameter while adding the legacy identifiers required by older backends.StateService.update_state.Confidence Score: 5/5
The change is narrowly scoped to restoring compatibility for ADK state updates and includes targeted regression coverage.
No correctness issues were identified in the changed service logic or test coverage, and the update preserves the generated state payload while adding the legacy identifiers expected by older backends.
What T-Rex did
Reviews (1): Last reviewed commit: "fix(adk): re-send task_id/agent_id in st..." | Re-trigger Greptile