sdk: migrate to omnigraph-server v0.6.0 (graphs, query/mutate, multi-graph) - #8
Conversation
- Bump serverVersion pin 0.4.2 -> 0.6.0; resync spec/openapi.json from
upstream main (includes today's PR #110 + PR #119 multi-graph).
- Expose og.graphs.list() on flat GET /graphs; add GraphsResource.
- Multi-graph routing via OmnigraphOptions.graphId and og.graph(id):
Transport rewrites graph-scoped paths to /graphs/{id}/..., leaves
/healthz and /graphs flat.
- Add MethodNotAllowedError mapped from HTTP 405 / code:method_not_allowed.
- SchemaApplyInput auto-gains allowDataLoss (Camelize over the spec).
- PR #110 follow-up: add og.query() (POST /query) and og.mutate()
(POST /mutate); mark og.read()/og.change() @deprecated. ChangeInput
field rename (querySource->query, queryName->name) is intentional and
breaking at the TS layer; wire still works via serde aliases.
- MCP package: expose graphId, register graphs_list tool +
omnigraph://graphs resource, add canonical query/mutate tools,
retitle legacy read/change tools, read OMNIGRAPH_GRAPH_ID env.
- READMEs: multi-graph clusters section, v0.6 auth states
(Open / DefaultDeny / PolicyEnabled), allowDataLoss, query/mutate
migration callout, MethodNotAllowedError.
- E2E workflow: single-graph job writes a Cedar policy and starts via
--target/--config so non-read actions are authorized in v0.6.
New e2e-multigraph job initializes alpha+beta graphs and runs the
multi-graph SDK suite (gated by OMNIGRAPH_E2E_MULTIGRAPH=1).
- Tests: 81 unit + 19 single-graph e2e + 4 multi-graph e2e — all green
against a locally-built omnigraph-server v0.6.0. check-coverage now
binds 17 SDK call sites to 17 spec operations.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e8a6b9ea00
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| inputSchema: { | ||
| query: z.string().min(1), | ||
| name: z.string().optional(), | ||
| params: z.record(z.unknown()).optional(), | ||
| branch: z.string().optional(), | ||
| }, |
There was a problem hiding this comment.
Preserve legacy change tool inputs
For existing MCP clients that still call the legacy change tool with its previously documented querySource / queryName arguments, this new schema rejects the request before it reaches the server because query is now required. Since the tool is kept as a legacy alias and the server still accepts the old wire fields, this breaks backward compatibility for current MCP integrations; accept both shapes here (or keep the old schema on change) and translate to the canonical SDK call.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
1 issue found across 25 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
Summary
Brings
@modernrelay/omnigraphfromomnigraph-server0.4.2 → 0.6.0. v0.6 reshapes the SDK contract in three places at once: a new flat management endpoint (GET /graphs) plusMethodNotAllowedError(HTTP 405) on single-graph mode; multi-graph cluster routing under/graphs/{id}/...modeled as a transport prefix knob; and (today's upstream PR #110) canonicalPOST /query/POST /mutateplus aChangeRequestfield rename that ripples into a breaking TS API change.What changed
SDK (
@modernrelay/omnigraph)og.graphs.list()against flatGET /graphs; newGraphInfo/GraphListpublic types.new Omnigraph({ baseUrl, graphId: "alpha" })andog.graph(id)for multi-graph clusters.Transportrewrites graph-scoped paths under/graphs/{encodeURIComponent(id)}/...and exempts the flat paths/healthzand/graphs. Single-graph behaviour is unchanged.MethodNotAllowedErrormapped fromcode: "method_not_allowed"/ HTTP405.SchemaApplyInput.allowDataLoss?: boolean(camelized from the regenerated spec).og.query()(POST/query) andog.mutate()(POST/mutate) as the canonical successors;og.read()/og.change()carry@deprecatedJSDoc explaining theDeprecation+Link: rel="successor-version"response headers the server emits.ChangeInputfield renamequerySource → query,queryName → name(mirrors the upstreamChangeRequestrename; the server still accepts both via serde aliases, so the wire is byte-stable).ReadInputis unchanged.MCP (
@modernrelay/omnigraph-mcp)OMNIGRAPH_GRAPH_IDenv var +CreateServerOptions.graphIdthread the graph id through to the client.graphs_list,query,mutate; new resourceomnigraph://graphs. Legacyread/changetools are retitled with deprecation notes;change's input schema is renamed toquery/nameto match the SDK.Docs
allowDataLoss,query/mutatemigration callout.OMNIGRAPH_GRAPH_ID, new tools / resources documented; legacy tools tagged.E2E
omnigraph.yamland starts the server via--target e2e --configso non-readactions are authorized — necessary because v0.6 moved tokens-without-policy from permissive toDefaultDeny.e2e-multigraphjob: initializesalpha+betagraphs with a server-level policy + per-graph policies, runs the multi-graph SDK suite (gated byOMNIGRAPH_E2E_MULTIGRAPH=1).Validation
Verified end-to-end against a locally-built v0.6
omnigraph-serverin both modes:og.graphs.list()returning[alpha, beta]andog.graph("beta").snapshot()routing under/graphs/beta/....pnpm run check-coverage: 17 SDK call sites ↔ 17 spec operations (was 15 ↔ 15 pre-v0.6).POST /branchesreturns500 internal(Lance "Clone operation should not enter build_manifest") instead of the documented409 conflict. The SDK maps the wire correctly; worth a follow-up issue againstModernRelay/omnigraph.Expected-red until upstream cuts
v0.6.0pnpm run check-driftfails with a 404 againsthttps://raw.githubusercontent.com/ModernRelay/omnigraph/v0.6.0/openapi.json.v0.6.0release asset doesn't exist yet).The wire surface itself is fully validated; both go green automatically once the upstream tag publishes.
Test plan
pnpm run check-coverage— 17/17.pnpm run typecheck— clean.pnpm -r run test— 81 SDK + 12 MCP unit, all pass.OMNIGRAPH_E2E=1+ live server, single-graph — 100/100.OMNIGRAPH_E2E=1 OMNIGRAPH_E2E_MULTIGRAPH=1 OMNIGRAPH_GRAPH_ID=alpha+ live server, multi-graph — 103/103 (1 single-graph-only case correctly gated off).pnpm run build— clean.pnpm run check-drift— expected red until upstream cutsv0.6.0.v0.6.0.Note
Medium Risk
Large API and auth-behavior shift (Cedar default-deny, breaking TS mutation field names for new code) with broad transport and CI changes; legacy paths preserved on the wire but consumers must migrate and configure policies correctly.
Overview
Bumps the repo to omnigraph-server v0.6.0 (pinned spec, SDK, and MCP all at
0.6.0) and aligns the TypeScript client and MCP server with the new API surface.The SDK adds
og.query()/og.mutate()as the canonical read/write paths;og.read()/og.change()stay as deprecated aliases, withog.change()normalizing legacyquerySource/queryNameor canonicalquery/nameonto the v0.6 wire body. Multi-graph support uses optionalgraphId,og.graph(id), and transport rewriting to/graphs/{id}/...while/healthzandGET /graphsstay flat;og.graphs.list()maps single-graph 405 toMethodNotAllowedError.schema.applygains optionalallowDataLoss.MCP mirrors the same:
OMNIGRAPH_GRAPH_ID, toolsquery,mutate,graphs_list, resourceomnigraph://graphs, and legacyread/changewith dual input shapes onchange.CI/release adds
pnpm run check-versions, stale checks forpackages/mcp/src/version.gen.ts, and e2e that boots v0.6 with Cedar policies +omnigraph.yaml(token default-deny) plus a newe2e-multigraphjob for alpha/beta routing.Reviewed by Cursor Bugbot for commit fe5a2cc. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by cubic
Migrates
@modernrelay/omnigraphtoomnigraph-serverv0.6.0 with multi-graph routing, canonicalPOST /queryandPOST /mutate, and a flat graphs registry. Adds CI guards to enforce the v0.6 pin and keep SDK/MCP versions in sync; single-graph behavior remains unchanged by default.New Features
new Omnigraph({ graphId })andog.graph(id); transport rewrites to/graphs/{id}/...while/healthzand/graphsstay flat.og.graphs.list()forGET /graphs; single-graph returns 405 mapped toMethodNotAllowedError.og.query()andog.mutate();og.read()/og.change()deprecated. Type rename:querySource→query,queryName→name(wire remains compatible).SchemaApplyInput.allowDataLoss?: boolean.@modernrelay/omnigraph-mcp): supportsOMNIGRAPH_GRAPH_ID; adds toolsgraphs_list,query,mutateand resourceomnigraph://graphs; legacy tools kept with deprecation notes. Reports MCP package version in initialize.Migration
og.read→og.queryandog.change→og.mutate; update inputs toquery/name.graphIdor useog.graph(id); do not include/graphs/{id}inbaseUrl.MethodNotAllowedErrorwhen callingog.graphs.list()against single-graph servers.pnpm run check-versionsenforces alignment, andpnpm run gen-versionnow generates SDK and MCP version files.Written for commit fe5a2cc. Summary will update on new commits.