Skip to content

agent-context-graph: doctor's skills-graph/actions-graph connector checks ignore resolved Memgraph config #274

Description

@antejavor

Summary

cli.py's _check_connector resolves the configured Memgraph connection (~/.config/context-graph/config.toml via resolve_memgraph_env()) for the sessions-graph connector check, but not for skills-graph or actions-graph — those two just call SkillGraph()/ActionsGraph() with no arguments, which fall back to Memgraph()'s own defaults (MEMGRAPH_URL env var, or bolt://localhost:7687) instead of whatever's actually configured.

Practical effect: agent-context-graph doctor --connector skills-graph (or actions-graph) reports FAIL connector:skills-graph: ValueError: Could not connect to Memgraph database...bolt://localhost:7687 even when the configured instance (a different URL) is reachable and correctly set up -- runtime:<name>'s own smoke check fails the same way, for the same reason, since it also builds its AgentLink without passing the resolved config through.

Repro

With ~/.config/context-graph/config.toml pointing at a non-default Memgraph URL (e.g. a remote/HA instance, or just a different local port) that is reachable and has the connector's schema set up:

agent-context-graph doctor --runtime codex --connector skills-graph
# OK memgraph: <configured-url> reachable
# FAIL connector:skills-graph: ValueError: Could not connect to Memgraph database. Please ensure the URL 'bolt://localhost:7687' is correct
# FAIL runtime:codex: ValueError: Could not connect to Memgraph database. Please ensure the URL 'bolt://localhost:7687' is correct

Confirmed this is pre-existing (reproduces identically on main before any of the recent context-graph work) -- not a regression from #271/#273.

Where

  • context-graph/agent-context-graph/src/agent_context_graph/cli.py's _check_connector -- the sessions_graph branch does resolve_memgraph_env() + passes url/username/password/database explicitly; the skills_graph and actions_graph branches don't.
  • Same root cause likely affects _check_runtime, which calls create_link(connectors) (via hooks/runner.py post-agent-context-graph: entry_points-based runtime plugin registry #273) with no memgraph_env argument at all.

Fix sketch (not yet designed/confirmed)

Resolve memgraph_env once in _doctor() and thread it through to every _check_connector call and into _check_runtime, matching what sessions_graph's branch and _check_memgraph() already do.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions