feat(sdk,core,webapp): transcript storage for chat.agent - #4896
feat(sdk,core,webapp): transcript storage for chat.agent#4896ericallam wants to merge 3 commits into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
🦋 Changeset detectedLatest commit: a4f1bfe The changes in this PR will be included in the next version bump. This PR includes changesets to release 27 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Observability mapAs of 20/100 over 451 measured of 469 entry points (base 20, no change) What this PR changed
FIX FIRST
AUDIT 3 of 50 sensitive mutations record an actor. 47 without one. What the score is made ofThe score and findings here are report-only and never gate the merge. Separately, a required test suite keeps this tool's symbol and route lists in sync with the code they name, and can fail a pull request that renames or removes a symbol they reference, or that adds the first route with a segment they anticipate. Each failure names the list to edit. The rules and their reasons: internal-packages/observability-map/README.md. |
2b2ea99 to
be72173
Compare
@trigger.dev/build
trigger.dev
@trigger.dev/core
@trigger.dev/python
@trigger.dev/react-hooks
@trigger.dev/redis-worker
@trigger.dev/rsc
@trigger.dev/schema-to-json
@trigger.dev/sdk
commit: |
be72173 to
5dc4365
Compare
5dc4365 to
3bdfd45
Compare
3bdfd45 to
db561bb
Compare
db561bb to
185360a
Compare
185360a to
461a6d2
Compare
461a6d2 to
1a3b477
Compare
1a3b477 to
d06408f
Compare
…nformance suite chat.agent takes a storage option, with the platform snapshot as the default and the TranscriptStorage types, defaultStorage, snapshotTranscriptStorage, memoryTranscriptStorage and reduceTranscriptChanges exported from @trigger.dev/sdk/ai. chat.createLoadTranscriptAction(storage) reads a conversation on the server for any storage, and useLoadTranscript renders it in the browser and seeds the transport's resume cursor. runTranscriptStorageTests from @trigger.dev/sdk/ai/test is the contract a storage implementation has to meet. A new secret-key endpoint, GET /api/v1/sessions/:id/transcript, pages the platform snapshot server-side so rendering the last page of a long conversation does not download all of it; the default storage uses it for paged reads and falls back to the whole blob.
… message rows The real-schema conformance target for the storage contract: one row per message in chat_messages, with the runtime's state and cursors in two new nullable columns on chats. Paging is by position in SQL. The agent itself still persists through its hooks.
…, and the changeset
d06408f to
a4f1bfe
Compare
Summary
The public surface for transcript storage:
chat.agent({ storage }), the exported types and factories, a read path that works for any storage, a conformance suite, and the docs.loadon the storage is the one read for every backend.chat.createLoadTranscriptActionwraps it for the app server anduseLoadTranscriptrenders the result and seeds the transport's resume cursor. A new secret-key endpoint,GET /api/v1/sessions/:id/transcript?limit=&before=, pages the platform snapshot server-side so rendering the last page of a long conversation does not download all of it; the default storage uses it for paged reads and falls back to the whole blob.runTranscriptStorageTestsfrom@trigger.dev/sdk/ai/testis the contract a storage has to meet: appends and in-place replacement, idempotentremoveandtruncateAfter,stateround-trips, cursors, replaying a changeset, paging, and chat isolation. It runs here againstmemoryTranscriptStorage(), the default snapshot storage, and a row-per-message adapter over the dashboard agent's own tables, which is the real-schema target and adds two nullable columns to its chats table.hydrateMessagesis documented as deprecated, withloadContexton a storage as the replacement. The changeset in this PR is the release note for the whole feature.