chore(agents): add query tool to permanent agent fixture#2576
Draft
ks93 wants to merge 11 commits into
Draft
Conversation
Tests were branching on isinstance(loaded_tool, ...), which is the object under test. A loader regression returning the wrong subtype could silently skip entire assertion blocks and still pass. Branching on the parametrized expected_type keeps the isinstance check as a real assertion.
Mirrors the pattern already used by test_agent_tool_load_returns_correct_subtype, so a loader regression returning a wrong subtype fails loudly here instead of relying on _type string equality alone.
The cog-ai backend and Fusion frontend already support the "query" tool type, but the Python SDK deserialized it as UnknownAgentTool. This adds first-class support with QueryAgentTool, QueryAgentToolUpsert, and QueryAgentToolConfiguration classes.
Remove maturity label from docstring examples and surface missing dataModels key instead of silently defaulting to empty dict.
Covered automatically by tests/tests_unit/test_base.py.
Covered by automatic load/dump tests in test_base.py. Keep only test_load_without_configuration for the None config edge case.
Local codegen run during the rebase produced a stale hash; regenerated to match CI.
Exercises the new QueryAgentTool end-to-end via the shared integration test agent, following review feedback on #2569.
- Drop the existing-and-same-model reuse check; upsert is idempotent and this avoids silent staleness when anything other than model changes (tools, description, etc.). - Pin runtime_version to 1.2.1 so the fixture exercises the new runtime once it ships. 1.2.1 is not GA yet (expected in 2-4 weeks); until then, this fixture will fail to upsert.
Keep the fixture on the server default. The underlying query tool needs a runtime that is not yet available; the dependency is tracked in the PR description so the merge can be held until the runtime ships.
Merged
1 task
33c8067 to
11cb8b0
Compare
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.
Note
Stacked on #2569, merge that first.
Warning
The query tool depends on a runtime version that is not yet available, so we need to wait 2 to 4 weeks for it to be supported before we merge.
Summary
Addresses review feedback from @haakonvt on #2569: "Should we add the query tool to the list of tools of the permanent agent in the integration test?"
QueryAgentToolUpsertalongside the existingQueryKnowledgeGraphAgentToolUpserton the session-scopedpermanent_agentfixture in tests/tests_integration/test_api/test_agents.py.upsertis idempotent, and the old check only noticed model drift, silently missing tool, description, or runtime changes. Always upserting fixes that gap with no meaningful cost.Test plan