Skip to content

ref(chat): Stop writing actor into turn-session Redis - #1298

Merged
dcramer merged 6 commits into
mainfrom
ref/turn-session-stop-actor-writes
Aug 7, 2026
Merged

dcramer merged 6 commits into
mainfrom
ref/turn-session-stop-actor-writes

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

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

SQL already owns Slack actor identity and resume rebuilds execution actor
from message author, work-state profile, resource-event markers, or dispatch.
Drop singular actor from the Redis turn-session projection and summary indexes.

Refs #1267

Co-Authored-By: David Cramer <[email protected]>
@vercel

vercel Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
junior-docs Ready Ready Preview Aug 7, 2026 7:48pm

Request Review

Resume no longer carries Redis profile fields, and the MCP OAuth suite dropped
under the file-length limit after the mismatched-actor cases left.

Refs #1267
@dcramer
dcramer marked this pull request as ready for review August 7, 2026 18:57
@dcramer dcramer added the trigger-evals Run evals on a PR label Aug 7, 2026
@github-actions github-actions Bot added the risk: high PR risk score: high label Aug 7, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c5eca69. Configure here.

Work-state lookup and profile enrichment are optional. Failures there must
still fall through to author id + destination team rebuild on resume.

Refs #1267

@dcramer dcramer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

theres a lot of code in here that i would hope is temporary because its VERY hard to follow

Collapse nested system/user actor ternaries in continue-runner into
resolveResumeExecutionIdentity with an explicit priority list, and keep
plugin run.actor rebuild as first instruction actor or dispatch fallback.

Refs #1267
Move resource-event identity constants into resource-events/actor, require a
resume execution actor, set the system actor on live resource-event routing,
and rebuild plugin run.actor from instruction provenance or dispatch.

Refs #1267

Co-Authored-By: David Cramer <[email protected]>
Add credentialContextForActor so callers set actor first and project
credentials instead of hand-building parallel shapes. Resume, reply,
dispatch, and local runner all go through that path.

Refs #1267
@dcramer
dcramer merged commit 908ff9a into main Aug 7, 2026
38 checks passed
@dcramer
dcramer deleted the ref/turn-session-stop-actor-writes branch August 7, 2026 20:01

This branch was successfully deployed

1 active deployment
Preview – junior-docs — ff09a874 Deployed Aug 7, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: high PR risk score: high trigger-evals Run evals on a PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant