refactor(langgraph): adapter reflects CompiledStep.executionPlan on node metadata#86
Conversation
#65 added CompiledStep.executionPlan (ExecutionPlan | null). The LangGraph adapter built nodes without it, so the serialized state graph carried no fan-out/fan-in. Consumer side of #65, parallel-execution analog of the verification gap. Reflect compiledStep.executionPlan onto StateGraphNode.metadata.executionPlan, read from the compiled artifact (the adapter already holds the CompiledStep in buildGraphDefinition), gated by includeMetadata like retryPolicy and omitted when the step has no plan. A LangGraph builder can construct parallel/conditional edges from this without reaching back into the un-compiled spec. Consume-and-reflect only; no concurrent scheduler. Loop-closing test wraps compileWorkflow to attach an executionPlan to the compiled step while the source spec declares no parallel structure, proving the adapter reflects the compiled artifact and not the spec. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Review limit reached
More reviews will be available in 24 minutes and 20 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Part of #75 (LangGraph adapter half). Companion to the executor half.
Summary
#65 added
CompiledStep.executionPlan(ExecutionPlan | null). The LangGraph adapter built nodes without it, so the serialized state graph carried no fan-out/fan-in. This reflects the compiled plan ontoStateGraphNode.metadata.executionPlan.compiledStep.executionPlan(the adapter already holds theCompiledStepinbuildGraphDefinition), gated byincludeMetadataand omitted when null, mirroring the existingretryPolicyreflection. A LangGraph builder can construct parallel/conditional edges from this without reaching back into the un-compiled spec.Tests
src/__tests__/execution-plan-source.test.ts) wrapscompileWorkflowto attach an executionPlan to the compiled step while the source spec declares no parallel structure, proving the adapter reflects the compiled artifact and not the spec. Verified RED before the fix, GREEN after.Reviewer-relevant caveats (please read before merge)
The
adapters/langgraphpackage is outside all root gate commands: it is not in the rootworkspaces(packages/*only), is excluded from biome (!**/adapters), is not referenced bytsconfig.build.json, and is not a vitest project (root vitestprojects: ["packages/*"]). Rootnpm test/typecheck/linttherefore do not exercise it and remain green.On
main, before this change, the adapter package already fails its own suite (4 failing tests) and does not typecheck (~8tsc --noEmiterrors) due to stale drift against the current core API (console/lib config,ParseResult.data,DagResult.levels/order) — all unrelated to executionPlan. This change does not introduce or fix any of that; it is purely additive (one metadata field + one passing test), verified by running the adapter suite directly (my test passes; the 4 pre-existing failures persist unchanged).Recommendation: merge the executor half (#85) unconditionally. For this PR, either merge as-is and track a follow-up to repair the adapter's API drift and bring it under a gate, or fold this field into that repair so the adapter re-enters CI green in one move. I did not touch root config or repair the drift, as both are out of scope for #75.
🤖 Generated with Claude Code
Summary by cubic
Reflects the compiled parallel execution plan onto LangGraph node metadata so consumers can build fan-out/fan-in edges without reading the source spec. Part of #75; no scheduler changes.
CompiledStep.executionPlanand write toStateGraphNode.metadata.executionPlanwhenincludeMetadatais true; omitted when null.ExecutionPlanfrom@logic-md/coreand added a test verifying the adapter uses the compiled artifact, not the spec.Written for commit 0560a24. Summary will update on new commits. Review in cubic