Repository navigation
feat: expose standalone SDK runtime transport - #713
Conversation
|
@codex review Please review the current PR head df9464f. Confirm that this exact commit is the reviewed commit and ignore findings that apply only to earlier heads. Focus on the standalone package boundary, CJS/ESM loading and consumer types, parity with the existing LibreChat wire transport, identity/policy enforcement, recovery, and cancellation cleanup. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Additional migration acceptance at df9464f: installed this built SDK into a disposable LibreChat dev checkout and temporarily routed its client/server entry points through |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: df9464f7c7
ℹ️ 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".
|
@codex review Please review the current PR head 6dc7a49. Confirm that the review applies to this commit. The follow-up addresses approval resume indices and terminal content, consumed one-shot matchers, subagent type matching, and worker forwarding deadlines. Please check regression coverage and compatibility with the existing wire protocol. |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
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". |
Summary
External SDK workers currently import
@librechat/api/sdk, which is not published. They cannot install and run independently of a LibreChat checkout.Expose the existing runtime bridge as the Node-only
@librechat/agents/runtimesubpath, with CommonJS, ESM, and TypeScript exports. It includes the worker server, host client, authenticated identities, bounded WebSocket RPC, checkpoint/approval reconstruction, encrypted host model/policy/file channels, host tools, and optional durable recovery journal. Core SDK imports do not re-export the transport.The transport comes from LibreChat's current dev implementation at e50a30653cd439b404432ecfc3efc41ddcedc236 (LibreChat-AI/LibreChat#18419). Host-specific model policy callbacks, registration, storage authorization, and billing stay with LibreChat; the SDK accepts their service contracts. The wire protocol and its fail-closed capability checks are unchanged.
Clean consumer installation also exposed two packaging defects: broad Langfuse peers selected an incompatible OpenTelemetry exporter, and emitted declarations retained workspace-only aliases. Declare compatible tracing dependencies and resolve declaration aliases during the build. Negative type assertions verify that installed runtime contracts retain their types.
Validation
@librechat/api, checks ESM/bundler and CommonJS/Node TypeScript consumers, and runs an ESM host against a separate CJS worker. Exercises a custom StateGraph, streamed events, approval/reconstruction, host model invocation, cancellation, identity rejection, and graceful shutdown.Release boundary
No version bump or npm publication in this PR. A separate SDK release follows merge. LibreChat can then replace its transport implementation with these exports; existing hosts already interoperate with the packaged worker. This changes packaging and ownership, not the previously supported feature set.