Repository navigation
ref(chat): Write thread/channel scratch with Junior TTL - #1320
Merged
Merged
Conversation
Route thread and channel scratch through the Junior state adapter so chat-sdk no longer hardcodes a 30-day hangover on those keys. Co-Authored-By: David Cramer <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Route turn prep and factory readers through getPersistedThreadState, point the Slack test harness at Junior's adapter TTL path, and pin the memory adapter across vi.resetModules so fixture and production scratch agree. Co-Authored-By: David Cramer <[email protected]>
Factory skip handlers resolve a concrete conversation id before loading persisted thread scratch so prepare builds typecheck cleanly.
Coerce adapter null reads in the Slack harness, drop the process-global memory pin, seed cross-runtime vision state before module reloads, and point assistant-thread contract bots at Junior's shared adapter. Co-Authored-By: David Cramer <[email protected]>
createTestThread now seeds Junior adapter scratch asynchronously. Make createEvalThread/getThreadRecord async and drop the redundant setState mirror that still assumed a sync TestThread.
Co-Authored-By: David Cramer <[email protected]>
dcramer
marked this pull request as ready for review
August 8, 2026 15:53
createTestThread now applies constructor state to the shared Junior adapter instead of keeping leftover keys, so suites that reuse thread ids start clean.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2481933. Configure here.
Empty createTestThread channel refs no longer wipe adapter channel config. Channel ids are shared, so only explicit constructor channel state is applied.
dcramer
added a commit
that referenced
this pull request
Aug 8, 2026
) Stop mirroring rebuildable conversation stats into thread-state Redis after the TTL unification in #1320. **Thinner conversation scratch** `buildConversationStatePatch` now writes only `schemaVersion`, `processing`, and `vision`. Token/count stats and the Slack backfill marker are no longer dual-written into Redis. **SQL hydrate rebuilds authority** `hydrateConversationMessages` rebuilds working-set stats from the projected message/compaction history and marks backfill complete when SQL already has transcript. Empty conversations stay unmarked so first-turn Slack backfill can still run. **Still later for scratch** - vision cache durable home (or shorter-lived authority) - pendingAuth / sandbox / artifacts thinning - channel configuration ownership - further TTL tightening once the bag is thinner Refs #1267 <!-- junior-request-attribution:start --> Requested by **U039RR91S**. <!-- junior-request-attribution:end --> <!-- junior-session-footer:start --> <!-- junior-conversation-id:slack%3AC0B595QDZLL%3A1786205981.988819 --> -- [View Junior Session](https://junior-prod.sentry.dev/conversations/slack%3AC0B595QDZLL%3A1786205981.988819) [[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0B595QDZLL%3A1786205981.988819/?project=4510944073809921) <!-- junior-session-footer:end --> --------- Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com> Co-authored-by: David Cramer <[email protected]>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Route thread and channel scratch writes through Junior's state adapter so they use the 7-day retention policy instead of Chat SDK's hardcoded 30-day TTL.
Single write path
persistThreadRuntimeState,persistThreadStateById, and channel configuration saves merge through one TTL-owning helper. Reads remain on the injectedThreadandChannelcapabilities, preserving the chat runtime boundary; id-only continuation paths still use the explicit persisted-state readers.Harness alignment
Slack fixtures use the same adapter keys as production, including across module reloads, so tests observe the state that runtime writes actually produce.
Refs #1267