fix(agents): expose runtime version on agent models#2568
fix(agents): expose runtime version on agent models#2568
Conversation
Align the Agents SDK with the documented API by surfacing runtimeVersion on agent read and write models and covering the round-trip in unit and integration tests.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request introduces a runtime_version field to the Agent data classes, including AgentCore, AgentUpsert, and Agent. The implementation covers updates to class definitions, constructor signatures, serialization/deserialization logic in _load and as_write, and corresponding updates to integration and unit tests. I have no feedback to provide.
The geospatial service returns 500 errors, causing all geospatial integration tests to fail in the session-scoped autouse fixture.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2568 +/- ##
==========================================
- Coverage 93.47% 92.72% -0.75%
==========================================
Files 480 480
Lines 48318 48314 -4
==========================================
- Hits 45164 44798 -366
- Misses 3154 3516 +362
🚀 New features to boost your workflow:
|
haakonvt
left a comment
There was a problem hiding this comment.
I'm not sure how you asked Claude to add tests, but please be more targeted 😅
| description (str | None): The human readable description of the agent. | ||
| instructions (str | None): Instructions for the agent. | ||
| model (str | None): Name of the language model to use. For example, "azure/gpt-4o", "gcp/gemini-2.0" or "aws/claude-3.5-sonnet". | ||
| runtime_version (str | None): Version of the runtime environment used by the agent. |
There was a problem hiding this comment.
How are people expected to know which are available for selection? The API docs are very limited:
runtimeVersion | string (Runtimeversion)
The runtime version of the agent. Defines the complete execution environment including system
prompt, available tools, and core features. Defaults to the latest version (1.1.1).
Also, 1.1.1 does not look like what you used below at all (2024.09.1). Have you changed to calendar versioning?
There was a problem hiding this comment.
I also found this randomly in the docs:
The tool can only be added to an agent if the agent's runtime version is 2.0.0-alpha or higher.
There was a problem hiding this comment.
Updated to semver and updated docstring with link to info and better description: https://docs.cognite.com/cdf/atlas_ai/references/atlas_ai_agent_runtime_versions
Address PR feedback: remove runtime_version checks from tests not specifically testing that field, and delete manually written as_write test that is already covered by test_base.py.
Update test values from "2024.09.1" to "1.1.1" to match actual API versioning, and add documentation link for available runtime versions.
Use skipif with a date check so tests resume automatically once the geospatial service is expected to be available again.
…cked PR These changes are part of #2568 and should not be duplicated here.
Summary
runtimeVersionfield asruntime_versionon agent read and write modelsload,dump, andas_write()so agent round-trips keep the API value intactTest plan
poetry run pytest tests/tests_unit/test_data_classes/test_agents/test_agents.py tests/tests_unit/test_api/test_agents.pypoetry run pytest tests/tests_integration/test_api/test_agents.py