Skip to content

ref(conversations): use publishExternally for external replies - #1238

Merged
dcramer merged 8 commits into
mainfrom
codex/conversation-reply-destination
Aug 10, 2026
Merged

ref(conversations): use publishExternally for external replies#1238
dcramer merged 8 commits into
mainfrom
codex/conversation-reply-destination

Conversation

@dcramer

@dcramer dcramer commented Aug 4, 2026

Copy link
Copy Markdown
Member

Replace the turnDelivery enum with one boolean side effect on turn work.

The conversation log always stores the turn. publishExternally only decides whether assistant output also goes to the conversation destination. Slack and plugin dispatch set it true. Dashboard and destinationless child work set it false.

Mailbox work and the turn checkpoint keep the flag through pause, resume, lease recovery, and retry. Slack ingress and resume publish unless the flag is explicitly false. Non-Slack work stays conversation-only when unset. Destination presence must not invent publish. The worker keeps different publish choices in separate turns.

Refs #1200

Checks

  • pnpm --filter @sentry/junior exec tsc -p tsconfig.json --noEmit
  • targeted vitest for oauth-resume, slack-runtime, mcp-auth-runtime-slack, agent-continue-slack, paused-turn, conversation-work, slack-conversation-work (129 passed)

@vercel

vercel Bot commented Aug 4, 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 3:48am

Request Review

Comment thread packages/junior/src/chat/task-execution/state.ts Outdated
Comment thread packages/junior/src/chat/task-execution/state.ts Outdated
Persist reply delivery separately from Location so dashboard turns can
stay in the conversation. Keep paused-turn delivery across resume and
lease-expiry recovery so workers do not fall back to destination delivery.

Refs #1200

Co-Authored-By: David Cramer <david@sentry.io>
Comment thread packages/junior/src/chat/task-execution/worker.ts Outdated
Comment thread packages/junior/src/chat/task-execution/state.ts Outdated
dcramer added a commit that referenced this pull request Aug 9, 2026
Move user-authored configuration off expiring Redis scratch into durable
SQL, scoped to a provider Location.

**Ownership**
- `junior_location_configurations.location_id` references the canonical
Location row in `junior_destinations`
- Each `(location_id, key)` has one row with a text value
- Runtime routing supplies a Destination only to resolve the associated
Location; Destination remains reply-delivery data
- API and entry scope use `Location` / `location`

**Cutover**
- Existing live Redis channel-state entries copy into Location
configuration on the first Slack read
- New writes go only to SQL
- Concurrent SQL writes win over stale Redis entries
- The Redis fallback has an explicit `#1267` / `v0.147.0` removal marker

**Checks**
- Typecheck and lint pass
- Focused tests: 16/16

This follows the Source / Location / Destination split in #1200 and does
not overlap the reply-delivery changes in #1238.

Refs #1267

---------

Co-authored-by: sentry-junior[bot] <264270552+sentry-junior[bot]@users.noreply.github.com>
Co-authored-by: David Cramer <david@sentry.io>
sentry-junior Bot and others added 2 commits August 10, 2026 02:02
Co-Authored-By: David Cramer <david@sentry.io>
Co-Authored-By: David Cramer <david@sentry.io>
Comment thread packages/junior/src/chat/runtime/slack-runtime.ts Outdated
Comment thread packages/junior/src/chat/task-execution/worker.ts Outdated
Co-Authored-By: David Cramer <david@sentry.io>
@sentry-junior sentry-junior Bot changed the title ref(conversations): separate reply delivery from location ref(conversations): Enforce turn delivery boundary Aug 10, 2026
@dcramer
dcramer marked this pull request as ready for review August 10, 2026 02:43
@github-actions github-actions Bot added the risk: medium PR risk score: medium label Aug 10, 2026
Replace the destination/conversation enum with one boolean side-effect
flag. The conversation log always stores the turn; publishExternally
only decides whether assistant output also goes to the conversation
location. Keep the flag on mailbox work and the turn checkpoint.

Refs #1200

Co-Authored-By: David Cramer <david@sentry.io>
@sentry-junior sentry-junior Bot changed the title ref(conversations): Enforce turn delivery boundary ref(conversations): use publishExternally for external replies Aug 10, 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 202553b. Configure here.

Comment thread packages/junior/src/chat/runtime/reply-executor.ts Outdated
Accidental TurnDelivery→boolean replace mangled the delivery-accepted hook.

Co-Authored-By: David Cramer <david@sentry.io>
Require explicit true to publish externally. Resume reads the checkpoint
flag, dispatch passes true, and destination presence no longer invents
publish. Drop the one-line schema module and document the rule.

Co-Authored-By: David Cramer <david@sentry.io>
Slack ingress and resume publish unless the flag is explicitly false.
Non-Slack and destinationless work still stay conversation-only when
unset. Restores auth-pause notices and failure fallbacks on Slack paths.
@dcramer
dcramer merged commit 5107a2a into main Aug 10, 2026
37 checks passed
@dcramer
dcramer deleted the codex/conversation-reply-destination branch August 10, 2026 04:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk: medium PR risk score: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant