Skip to content

fix(graph-query): sync CIClient.cypher params parity + document workspace binding#29

Merged
colombod merged 1 commit into
mainfrom
fix/graph-query-sync-params-and-docs
Jun 4, 2026
Merged

fix(graph-query): sync CIClient.cypher params parity + document workspace binding#29
colombod merged 1 commit into
mainfrom
fix/graph-query-sync-params-and-docs

Conversation

@colombod
Copy link
Copy Markdown
Collaborator

@colombod colombod commented Jun 4, 2026

Delivered — merged to main. Related: #30 (dtu test collection-safety fix split out from this work).

Summary

  • Sync/async parity: CIClient.cypher() (synchronous) now accepts an optional params: dict[str, Any] | None = None and forwards it in the /cypher POST body (previously hardcoded to {}). The async client and the graph_query tool already did this on main; this closes the remaining gap so parameterized Cypher works through the sync client too. Additive and backward-compatible (defaults to {}).
  • Docs accuracy: the graph_query tool's params input-schema description now documents the server's actual workspace handling — the effective workspace is bound into the query as the $workspace parameter; a specific (non-*) workspace overrides any workspace key supplied inside params, while * (all workspaces) passes a caller-supplied workspace key through unchanged.

Background

This was discovered while reviewing an out-of-tree fork's PR. The core params end-to-end work already landed on main for the async path, but the synchronous CIClient.cypher() still dropped params. 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.workspace then session.run(body.query, params).

Test Plan

  • New tests: 2 sync-client (test_cypher_forwards_params, test_cypher_default_params_is_empty_dict)
  • tests/test_client.py: 52 passed
  • Full top-level suite: 656 passed (the only collection error is an unrelated environment permission issue under tests/dtu/, not touched by this change)
  • modules/tool-graph-query suite: 29 passed
  • ruff lint + format clean on all changed files

…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).
@colombod colombod merged commit 6815cb5 into main Jun 4, 2026
9 checks passed
@colombod colombod deleted the fix/graph-query-sync-params-and-docs branch June 4, 2026 14:27
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