Skip to content

plans: prioritized plan to close the LangGraph gaps - #157

Closed
davidkpiano wants to merge 1 commit into
nextfrom
davidkpiano/langgraph-gaps-plan
Closed

davidkpiano wants to merge 1 commit into
nextfrom
davidkpiano/langgraph-gaps-plan

Conversation

@davidkpiano

@davidkpiano davidkpiano commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

Planning only. Adds plans/langgraph-gaps.md and indexes it in plans/README.md. No library code.

What it covers

Seven gaps versus LangGraph, each with current state (file refs on next at b884c73), proposed design, what it touches, effort, risks, and the examples and docs that exercise it:

  1. Per-transition update stream: streamAgent over onTrace, no trace-envelope change.
  2. Time travel: fresh executionId on fork (fixes a callKey collision), documented fork-edit-resume recipe, examples/time-travel.
  3. Long-term memory store: documented pattern only, per docs/scope.md.
  4. Subgraph mapping: docs leading with nested states; child machines as the escalation.
  5. Published test fake: adapter recipes plus settings(request, info); the 2026-09-24 ruling stands.
  6. September sweep gaps, each re-verified: 6b dropped (XState v6 semantics), 6f dropped (redundant), 2a/2e redesigned as a schema-driven, MCP-elicitation-shaped interaction.
  7. Durable store: conformance-tested SQLite and Postgres recipes as examples, no bundled package.

Grouped into three PR-sized batches with the decisions table at the top. Recommendation: Batch A first.

Verification caveat

Repros ran on a stale install (xstate alpha.57 vs pinned alpha.64); alpha.64 types were read by hand for 6b. Re-run the repro files after pnpm install before implementing.


Devin Review

Summary by CodeRabbit

  • Documentation
    • Added a LangGraph gaps plan covering proposed work in streaming, interaction handling, execution lineage, adapter guidance, subgraphs, memory, and durable-store examples.
    • Documented scope decisions, verification caveats, risks, and proposed PR batches, including the decision not to bundle a durable store.
    • Linked the plan from the plans index. These documents describe proposed work; no library behavior or code was changed.

Seven gaps (per-state update stream, time travel, memory store, subgraph
mapping, published test fake, the September sweep's library gaps, durable
store recipes), each with current state, design, touches, effort, risks,
and the examples and docs that exercise it. Grouped into three PR-sized
batches with decisions recorded. Planning only; no library code.
@changeset-bot

changeset-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 394269e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: b78ba84d-ae1b-4183-b2e9-4994e553070f
📥 Commits

Reviewing files that changed from the base of the PR and between b884c73 and 394269e.

📒 Files selected for processing: 2
  • plans/README.md
  • plans/langgraph-gaps.md
 ___________________________________________________________
< Veni, Vidi, Codici Fixi. I came, I saw, I fixed the code. >
 -----------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 3 potential issues.

Devin Review

Comment thread plans/langgraph-gaps.md
Comment on lines +244 to +257
### Batch A: sweep fixes and the testing seam (one PR, `next`)

- Gap 2: 6c, 6d, 6e, 6f, 6h. (6a can ride along or split into its own PR if the choices API needs discussion; it is the only M item.)
- Gap 5: `settings(request, info)` on the three adapters, `examples/mock-model.ts` `byRequestId`, the three docs recipes, comparison row.
- Changeset: minor. Tests: unit per gap, `pnpm check`, `pnpm docs:check`, `pnpm vitest run examples`.

### Batch B: streaming (one PR, `next`)

- Gap 1: trace fields, `streamAgent`, two stream examples rewritten, observability and comparison docs.
- Changeset: minor. Follow-up issue: adapter-subpath UI-protocol bridges; child emits; richer chunk parts.

### Batch C: persistence and composition docs (one PR, `next`)

- Gap 3: event-log "Branch with edited state" section, `forkThread`, fresh `executionId` on fork + `forkedFrom`, `examples/time-travel`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Final checklist retains dropped work

Batch A retains agent.actors, Batch B retains trace fields, and Batch C retains forkThread. The decisions table drops all three, leaving implementers with conflicting checklists.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread plans/langgraph-gaps.md
Comment on lines +75 to +85
**Proposed design** (smallest; provider-free; keeps `onTrace` as the single emission point per `run-agent.ts:1069-1080`):

1. Enrich the existing `machine.transition` trace variant rather than add a new event bus:
```ts
| { type: "machine.transition"; snapshot; event;
changed: boolean; // next !== prev
previousValue?: StateValue; // undefined on run.start / restore
contextPatch?: Record<string, unknown>; // shallow top-level diff, Object.is per key; removed keys as undefined
}
```
`commit(snapshot, event, prev)` takes `prev` from `transition()` (`:2960`) and `undefined` from `start` (`:2956`). `JsonSerializableTraceEvent` is derived, so JSON projection follows automatically; the pinned shape test in `src/serialize-trace-event.test.ts` needs updating. Optionally pass the same `{ changed, previousValue, contextPatch }` as a third argument to `onTransition`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Superseded designs remain actionable

The detailed proposals still prescribe trace fields, a choices list, text-field inference, and forkThread. Each conflicts with the decisions table, so implementers need a single authoritative design.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread plans/langgraph-gaps.md
**Proposed design** (docs and examples only):

1. `docs/event-log.md` "Stores" section is rewritten to lead with the contract and the suite: "implement four methods, run `assertEventLogStoreConformance`, you're done". Include the SQL shape (`(thread_id, index)` primary key, append in one transaction with a length check).
2. `examples/stores/` (or three sibling example dirs, per the one-flat-directory rule): `sqlite` (`better-sqlite3`, ~60 lines), `postgres` (`pg`, ~60 lines), and a pointer to `cloudflare-agent-host`'s Durable Object store. Each has a test that runs the conformance suite; SQLite in-memory runs in CI, Postgres is gated on a `DATABASE_URL` env var and skipped otherwise.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Postgres recipe lacks guaranteed CI coverage

The plan promises conformance tests in CI but skips Postgres without DATABASE_URL. CI needs a database service to exercise that recipe.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@davidkpiano

Copy link
Copy Markdown
Member Author

Closed: the plan stays local; the docs and examples it calls for will come as their own PR.

@davidkpiano
davidkpiano deleted the davidkpiano/langgraph-gaps-plan branch October 13, 2026 22:39
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