Repository navigation
ref(chat): Project turn sessions through explicit schemas - #1286
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
sentry-junior
Bot
force-pushed
the
ref/turn-session-stop-nested-routing-writes
branch
from
August 7, 2026 05:11
84f2a50 to
7b55979
Compare
dcramer
reviewed
Aug 7, 2026
dcramer
requested changes
Aug 7, 2026
dcramer
marked this pull request as ready for review
August 7, 2026 16:45
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 d776665. Configure here.
sentry-junior
Bot
force-pushed
the
ref/turn-session-stop-nested-routing-writes
branch
from
August 7, 2026 16:58
c1f4097 to
64ffb8f
Compare
SQL already owns destination and session source on resume. Drop those nested contracts from new Redis turn-session records and summary indexes while still dual-writing them into conversation metadata for SQL readers. Refs #1267 Co-Authored-By: David Cramer <[email protected]>
Auth-pause records no longer keep source/destination in redis; assert the materialized record omits those fields instead. Refs #1267 Co-Authored-By: David Cramer <[email protected]>
Co-Authored-By: David Cramer <[email protected]>
Address review feedback: document projection strip behavior, drop storage- prefixed schema names, keep source naming through the turn-session API, and collapse optional-field ternary walls behind definedProps helpers. Refs #1267 Co-Authored-By: David Cramer <[email protected]>
Abandon/fail no longer carry nested routing, so activity dual-writes must not invent ConversationSource from surface alone. That path was overwriting durable local source with internal via SQL coalesce. Refs #1267 Co-Authored-By: David Cramer <[email protected]>
Agent invocation children are destinationless; recovery must not read destination/source from the turn-session projection after those fields left the record schema. Refs #1267 Co-Authored-By: David Cramer <[email protected]>
ConversationStore gained createChild with agent invocations; the nested routing dual-write mock still omitted it and broke workspace typecheck. Refs #1267 Co-Authored-By: David Cramer <[email protected]>
sentry-junior
Bot
force-pushed
the
ref/turn-session-stop-nested-routing-writes
branch
from
August 7, 2026 17:59
816f04a to
7ea8ad4
Compare
dcramer
approved these changes
Aug 7, 2026
dcramer
added a commit
that referenced
this pull request
Aug 7, 2026
Finish the nested-contract cutover for turn sessions after #1268/#1286. Singular execution `actor` leaves the Redis turn-session projection and summary indexes; resume rebuilds it from durable sources. **Identity model (simplified)** - Set `actor` first (who runs) - Derive `credentialContext` with `credentialContextForActor(actor, subject?)` - They name the same principal except system runs with delegated `subject` (scheduled/event-task creator tokens) - resource-event identity owned by `resource-events/actor.ts` **Resume** 1. caller routingContext (dispatch / OAuth already bound) 2. resource-event markers → system actor 3. Slack author + destination team **Also** - live resource-event turns set `routing.actor` to the system principal - plugin `run.actor` = instruction provenance, else dispatch - reply / dispatch / local runner use the same actor→credential projection **Checks** - `tsc --noEmit` ✅ - continue-runner, agent-continue-slack, plugin-tasks ✅ - subscribed-message-behavior, agent-dispatch-work/recovery, slack-runtime ✅ Refs #1267 --------- 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.

Stop writing nested destination/source into turn-session state. Writers project through one explicit Zod schema (
.strip()), so unknown/deprecated keys never land in durable records or summary indexes. SQL remains the authority for routing via conversation metadata dual-writes.Projection schemas
agentTurnSessionSummarySchemais the shared field set. The stored record schema extends that same projection with resume-only fields (committedSeq,runtimeContext, …). Summary indexes intentionally omit the heavier fields; they are not a second domain model.Write-path cleanup
Optional-field ternary walls in the turn-session service collapse behind
definedProps+ a sharedsessionWriteContexthelper so each persist path only fills state-specific bits.Naming
Turn-session APIs keep
sourcefor the structured inbound Source. That maps to conversation-storesessionSourceonly at the SQL boundary, because the store already has a separate coarsesourceenum.Deploy after #1268 is in prod. Leaves actor dual-written for a later slice.
Refs #1267