Skip to content

chore(agents): add query tool to permanent agent fixture#2576

Draft
ks93 wants to merge 11 commits into
masterfrom
test/permanent-agent-add-query-tool
Draft

chore(agents): add query tool to permanent agent fixture#2576
ks93 wants to merge 11 commits into
masterfrom
test/permanent-agent-add-query-tool

Conversation

@ks93
Copy link
Copy Markdown
Contributor

@ks93 ks93 commented Apr 18, 2026

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?"

  • Adds QueryAgentToolUpsert alongside the existing QueryKnowledgeGraphAgentToolUpsert on the session-scoped permanent_agent fixture in tests/tests_integration/test_api/test_agents.py.
  • Drops the existing-and-same-model reuse check. upsert is 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

  • Once the required runtime is supported, run the integration test suite against a real project and confirm the permanent agent comes back with the new query tool.

ks93 added 11 commits April 17, 2026 16:46
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.
@haakonvt haakonvt changed the title test(agents): add query tool to permanent agent fixture chore(agents): add query tool to permanent agent fixture Apr 18, 2026
@haakonvt haakonvt force-pushed the feat/add-query-agent-tool branch 2 times, most recently from 33c8067 to 11cb8b0 Compare April 21, 2026 20:54
Base automatically changed from feat/add-query-agent-tool to master April 22, 2026 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant