Skip to content

agent-context-graph: entry_points-based runtime plugin registry - #273

Merged
antejavor merged 1 commit into
mainfrom
agent-context-graph-runtime-plugin-registry
Aug 12, 2026
Merged

antejavor merged 1 commit into
mainfrom
agent-context-graph-runtime-plugin-registry

Conversation

@antejavor

Copy link
Copy Markdown
Contributor

Summary

  • bootstrap/doctor/setup <runtime> and hook run/init <runtime> hardcoded a closed choices=["codex", "claude-code"] enum with if/else dispatch in three places (cli.py's _check_runtime, hooks/cli.py's _run_runtime and _init) -- a third-party package implementing its own RuntimeAdapter for a new harness had no way to get bootstrap/doctor/setup support without a code change here.
  • Adds a RuntimeCLIPlugin protocol (adapter_class, response_for_payload, build_hooks_config, optional init) registered via the agent_context_graph.runtimes entry point group, resolved through importlib.metadata.entry_points() -- no registry file, no code changes to this package needed to add a runtime.
  • Also extracts hooks/runner.py: codex.py and claude_code.py's main() duplicated near-identical stdin-loading/connector-construction/CLI-argument logic (flagged by a pre-existing # TODO in codex.py), differing only in the adapter class and a few env var names. One generic run_hook(plugin, argv) now serves both, and any future runtime.
  • Codex and Claude Code become the first two registered plugins (in this package's own pyproject.toml) rather than special-cased code paths -- Claude Code's plugin has no init, matching its pre-existing "not implemented yet" behavior, now expressed by simply omitting the optional protocol member instead of a hardcoded early-return.
  • Extends the "Adding a New Command-Hook Runtime Adapter" README section (from the previous PR) with the registration story.

Implements the design from Grilling: CLI plugin-discovery for custom runtime adapters, a child ticket of the Wayfinder map Continuous memory organization for context-graph.

Test plan

  • All 88 existing + new unit tests pass, unchanged in behavior (only monkeypatch targets moved, matching where the code moved to)
  • ruff check / ruff format --check
  • Smoke tested for real (not just unit tests): hook run codex with a live Stop payload, hook run <unknown> prints a clear "Unknown runtime" error listing what's registered, hook init claude-code still prints its pre-existing "not implemented yet" message, hook init codex writes real .codex/config.toml+.codex/hooks.json
  • doctor --runtime codex and doctor --runtime claude-code both pass their full check suite (including the new registry-based runtime: smoke check) against a live Memgraph instance
  • Verified the connector-check failure seen when Memgraph isn't at the default port is pre-existing on main too (unrelated to this change) by reproducing it against unmodified main via git stash

bootstrap/doctor/setup <runtime> and hook run/init <runtime> hardcoded
a closed choices=["codex", "claude-code"] enum with if/else dispatch
in three places (cli.py's _check_runtime, hooks/cli.py's _run_runtime
and _init) -- a third-party package implementing its own RuntimeAdapter
for a new harness had no way to get bootstrap/doctor/setup support
without a code change here.

Adds a RuntimeCLIPlugin protocol (adapter_class, response_for_payload,
build_hooks_config, optional init) registered via the
agent_context_graph.runtimes entry point group, resolved through
importlib.metadata.entry_points() -- no registry file, no code changes
to this package needed for a new runtime.

Also extracts hooks/runner.py: codex.py and claude_code.py's main()
duplicated near-identical stdin-loading/connector-construction/
CLI-argument logic (flagged by a pre-existing # TODO in codex.py),
differing only in the adapter class and a few env var names. One
generic run_hook(plugin, argv) now serves both, and any future
runtime, driven by the plugin object instead of a hardcoded branch.

Codex and Claude Code become the first two registered plugins (in
this package's own pyproject.toml) rather than special-cased code
paths -- claude-code's plugin has no init, matching its pre-existing
"not implemented yet" behavior, now expressed by simply omitting the
optional protocol member instead of a hardcoded early-return.

All 88 existing + new unit tests pass unchanged in behavior (only
monkeypatch targets moved, matching where the code moved to). Smoke
tested for real: hook run/init codex, hook init claude-code's
not-implemented message, an unknown-runtime error, and doctor
--runtime {codex,claude-code} against a live Memgraph instance.

Design: #269
@antejavor
antejavor merged commit 898d7f0 into main Aug 12, 2026
20 checks passed
@antejavor
antejavor deleted the agent-context-graph-runtime-plugin-registry branch August 12, 2026 08:26
antejavor added a commit that referenced this pull request Aug 18, 2026
…try_points registry) (#295)

PyPI has been stale for months relative to main -- these four packages
haven't been released since before most of maps #275/#288's work landed,
so the actual subagent-nesting model (Agent node, SPAWNED inference,
HAS_AGENT, USED_SKILL-on-Agent attachment) isn't published anywhere yet.

- actions-graph 0.1.2 -> 0.2.0: first-class Agent node model, SPAWNED
  inference rule, and the agent_spawning_tool_names default-name fix,
  all verified live against a real Claude Code session.
- skills-graph 0.1.3 -> 0.2.0: USED_SKILL attaching to the specific
  Agent (not just the flat Session) when skill usage happens inside a
  subagent.
- sessions-graph 0.4.0 -> 0.5.0: reconcile_session() now writes episodic
  Session.summary, plus config propagation fixes to the reconcile
  subprocess. (0.4.0 itself was already unreleased -- the ontology/label-
  promotion work from #248/#251.)
- agent-context-graph 0.1.9 -> 0.2.0: entry_points-based runtime plugin
  registry. (main's 0.1.9 already diverged from the last published 0.1.9
  build without a version bump -- #273 landed after the last release.)

No code changes -- version bumps only, verified compatible with existing
consumers (all internal >= constraints, no upper bounds).
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