Skip to content

Comments

feat(sdk): add bootstrapState + listMessagesDirect + memfsStartup#54

Merged
cpacker merged 2 commits intomainfrom
feat/overnight-bootstrap-sdk
Feb 23, 2026
Merged

feat(sdk): add bootstrapState + listMessagesDirect + memfsStartup#54
cpacker merged 2 commits intomainfrom
feat/overnight-bootstrap-sdk

Conversation

@cpacker
Copy link
Contributor

@cpacker cpacker commented Feb 23, 2026

Summary

  • add Session.bootstrapState(options?) API
  • add standalone listMessagesDirect(agentId, options?) API
  • add memfsStartup option forwarding to transport
  • add SDK tests for bootstrap + transport/list-messages coverage

Notes

  • depends on letta-code headless protocol additions

Validation

  • bun test src/tests/bootstrap-sdk.test.ts src/tests/transport-args.test.ts src/tests/list-messages.test.ts

…ption

- types.ts: add BootstrapStateOptions, BootstrapStateResult types; add
  memfsStartup option to CreateSessionOptions and InternalSessionOptions
- transport.ts: forward memfsStartup as --memfs-startup CLI flag
- session.ts: add Session.bootstrapState() — single-round-trip cold-open API
- index.ts: export new types; add standalone listMessagesDirect() for
  sessionless prefetch with memfs skip + minimal overhead
- tests: 11 new tests (transport arg forwarding, type shapes, protocol contract)

👾 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>
Copy link
Contributor

@cpfiffer cpfiffer left a comment

Choose a reason for hiding this comment

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

Reviewed the full diff. Three features: bootstrapState(), listMessagesDirect(), and memfsStartup transport option.

Looks good overall. Clean separation, thorough tests, types are well-documented. A few observations:

1. listMessagesDirect creates and tears down a full session for a single API call.
That's a fresh CLI subprocess spawn, initialize, control request, close. For a "prefetch" use case this is fine, but worth noting in docs that it's not cheap. The memfsStartup: "skip" and skillSources: [] options help a lot -- good call.

2. bootstrapState depends on CLI-side bootstrap_session_state protocol.
The PR notes say "depends on letta-code headless protocol additions." This means the SDK side will silently hang or error if the CLI doesn't support this control request yet. There's no version check or feature detection. If someone upgrades the SDK without upgrading letta-code, bootstrapState() will time out. Consider adding a note in the JSDoc about the minimum letta-code version, or at least a clear error message if the response shape is unexpected.

3. Mock transport tests are protocol-shape tests, not behavioral tests.
The bootstrapState: protocol logic via mock tests verify the subtype string constant and CLI arg building, but don't actually test the request-response flow through session.bootstrapState(). The makeMockTransport helper is defined but never used. This is fine if live integration tests cover the real path, but worth noting the gap.

4. memfsStartup type is "blocking" | "background" | "skip" -- consistent naming.
Good. The CLI flag mapping in buildCliArgs is straightforward.

5. No changes to transformMessage or stream handling.
This PR is purely additive APIs + transport args. No risk to existing stream behavior.

No blocking issues. Approve with the suggestion to document the minimum letta-code version dependency for bootstrapState.

@cpacker cpacker merged commit 17b7641 into main Feb 23, 2026
2 checks passed
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.

2 participants