Skip to content

ref(conversations): Extract conversation-only runtime - #1370

Closed
sentry-junior[bot] wants to merge 2 commits into
mainfrom
ref/conversation-only-runtime
Closed

sentry-junior[bot] wants to merge 2 commits into
mainfrom
ref/conversation-only-runtime

Conversation

@sentry-junior

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

Copy link
Copy Markdown
Contributor

Closing without merge.

This PR only extracted the local CLI runner into conversation-only.ts. It did not add a second consumer, make destination optional, or put non-Slack turns on the shared worker path.

Next cut: dashboard/API input through the existing mailbox + worker with publishExternally: false and no provider delivery. Keep mailbox, lease, and checkpoint behavior unchanged.

Refs #1200

@vercel

vercel Bot commented Aug 10, 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 10, 2026 5:10am

Request Review

@sentry-junior sentry-junior Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Policy review against the extract claim and the shared-runtime framing:

  1. runConversationOnlyTurn sets publishExternally: false on agent routing, but the terminal saveTurnCheckpoint({ mode: "completed" }) call still omits the flag. The PR says this path always sets conversation-only publish. Please pass publishExternally: false on the completed checkpoint write so the durable turn record matches the routing contract, not only the live run.

  2. recordActivity currently does source.platform === "slack" ? "slack" : "local". That collapses api / internal / other conversation sources into local, and the new integration test already calls this path with surface: "api". For a pure local extract, keep source: "local" like main. If this is meant to be shared, map from the real conversation source/surface instead of inventing a Slack-or-local ternary. Speculative wrong mapping fights policies/correctness-complexity.md.

Related honesty gap, not a hard blocker if you keep this PR as a local extract only: the body still frames this as preparing dashboard-authored turns, but the API still requires a Destination and does not set sessionSource. Destinationless private dashboard turns from #1200 will need those next. Either tighten the PR framing to “local extract” or leave a concrete follow-up for destinationless + sessionSource.

(Could not submit as REQUEST_CHANGES because this is Junior’s own PR.)

Pass publishExternally: false on the completed checkpoint write and map
activity source from destination/surface with sessionSource, matching the
turn-cursor contract without inventing a Slack-or-local ternary.

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

@sentry-junior sentry-junior Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Addressed both durable-contract points without touching mailbox/lease/worker paths:

  1. completed saveTurnCheckpoint now writes publishExternally: false
  2. recordActivity maps like turn-cursor (local destination → local, else surface) and stores sessionSource

Also tightened the PR body to local extract framing; destinationless dashboard turns remain a follow-up.

Integration coverage now asserts both via getConversationStore().get + getTurnRecord.

@sentry-junior sentry-junior Bot closed this Aug 10, 2026
dcramer added a commit that referenced this pull request Aug 10, 2026
Close the extract-only path from #1370 and land a real #1200 slice
instead.

Private dashboard/API root turns now enter the existing mailbox + worker
path with `publishExternally: false`. Replies stay in the conversation
log. Mailbox, lease, and checkpoint behavior stay the shared execution
system.

**What this adds**
- `api-turns/`: enqueue + worker consumer for API root turns
- `POST /api/conversations` and `POST /api/conversations/:id/messages`
- junior/email actor identity so private API conversations keep
participant access
- integration coverage for enqueue, idempotency, worker run, transcript
messages, and completed checkpoint `publishExternally: false`

**Still out of scope**
- continuing Slack-rooted conversations from the dashboard
- destinationless agent routing without a local destination
- dashboard composer UI

Refs #1200

**Checks**
- `pnpm --filter @sentry/junior exec tsc -p tsconfig.json --noEmit`
- `pnpm --filter @sentry/junior exec vitest run
tests/integration/api-turn-work.test.ts`

<!-- junior-request-attribution:start -->
Requested by **U039RR91S**.
<!-- junior-request-attribution:end -->

<!-- junior-session-footer:start -->
<!-- junior-conversation-id:slack%3AC0B595QDZLL%3A1786336528.055359 -->

--

[View Junior
Session](https://junior-prod.sentry.dev/conversations/slack%3AC0B595QDZLL%3A1786336528.055359)
[[Sentry]](https://sentry.sentry.io/explore/conversations/slack%3AC0B595QDZLL%3A1786336528.055359/?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

1 active deployment
Preview – junior-docs — 5d89532e Deployed Aug 10, 2026 by vercel[bot]
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.

0 participants