fix(graph-query): sync CIClient.cypher params parity + document workspace binding#29
Merged
Merged
Conversation
…pace binding
The async AsyncCIClient.cypher() and the graph_query tool already forward `params` on main, but the SYNCHRONOUS CIClient.cypher() still hardcoded `params: {}` and did not accept a params argument. This brings the sync client to parity (accepts `params: dict[str, Any] | None = None`, forwards `params if params is not None else {}`), matching the async implementation exactly.
Documents verified server behavior in the graph_query tool's `params` input-schema description: the effective workspace is bound into the query as the $workspace parameter; a specific (non-"*") workspace overrides any `workspace` key supplied in params, while "*" (all-workspaces) leaves a caller-supplied `workspace` key untouched. (Verified against the server handler at context_intelligence_server/main.py:214-216 in microsoft/amplifier-context-intelligence.)
Adds 2 sync-client regression tests (params forwarding + backward-compat empty-dict default).
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.
Summary
CIClient.cypher()(synchronous) now accepts an optionalparams: dict[str, Any] | None = Noneand forwards it in the/cypherPOST body (previously hardcoded to{}). The async client and thegraph_querytool already did this onmain; this closes the remaining gap so parameterized Cypher works through the sync client too. Additive and backward-compatible (defaults to{}).graph_querytool'sparamsinput-schema description now documents the server's actual workspace handling — the effective workspace is bound into the query as the$workspaceparameter; a specific (non-*) workspace overrides anyworkspacekey supplied insideparams, while*(all workspaces) passes a caller-suppliedworkspacekey through unchanged.Background
This was discovered while reviewing an out-of-tree fork's PR. The core
paramsend-to-end work already landed onmainfor the async path, but the synchronousCIClient.cypher()still droppedparams. The workspace-precedence note was verified directly against the server handler (context_intelligence_server/main.py:214-216):params = dict(body.params); if body.workspace is not None and body.workspace != "*": params["workspace"] = body.workspacethensession.run(body.query, params).Test Plan
test_cypher_forwards_params,test_cypher_default_params_is_empty_dict)tests/test_client.py: 52 passedtests/dtu/, not touched by this change)modules/tool-graph-querysuite: 29 passed