Skip to content

feat(slack): Defer passive steering during active turns#612

Merged
dcramer merged 3 commits into
mainfrom
dc/steering-interrupt-defer
Jun 17, 2026
Merged

feat(slack): Defer passive steering during active turns#612
dcramer merged 3 commits into
mainfrom
dc/steering-interrupt-defer

Conversation

@dcramer

@dcramer dcramer commented Jun 17, 2026

Copy link
Copy Markdown
Member

Active Slack requests that arrive during an in-flight turn now interrupt that run through Pi steering, while passive subscribed-thread messages that are reply-eligible remain pending and run after the current answer is delivered. Passive no-reply and opt-out messages are still consumed through skipped-message handling without model injection.

The implementation keeps Pi steering as ordinary user input, matching Pi's queue semantics instead of adding a model-visible steering wrapper. The mailbox drain path now supports subset acknowledgement by inbound id, rejects acknowledgements outside the offered pending batch, and validates Slack mailbox metadata before using route data for active/passive classification. Deferred passive messages stay durable for the next worker slice while interrupted and skipped messages are acknowledged immediately.

Garfield review passed after tightening the mailbox boundary, task-execution spec, and visible Slack output assertions. Verified with the focused Slack steering/component tests, respond/session-history regression tests, tsc --noEmit, and package lint.

Fixes GH-603

Route active Slack follow-ups into the running Pi turn while leaving passive subscribed-thread follow-ups pending for the next worker slice. This keeps explicit requests responsive without letting passive thread chatter change an in-flight answer.

Fixes GH-603
Co-Authored-By: GPT-5 Codex <codex@openai.com>
@vercel

vercel Bot commented Jun 17, 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, Comment Jun 17, 2026 9:16pm

Request Review

Acknowledge drained mailbox entries by inbound id and reject ids that were not offered in the pending batch. This keeps deferred passive Slack follow-ups durable while making the steering drain boundary explicit.

Update the task execution contract and tests for subset acknowledgement and visible no-wrapper steering output.

Fixes GH-603
Co-Authored-By: GPT-5 Codex <codex@openai.com>

@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 33bd385. Configure here.

Comment thread packages/junior/src/chat/task-execution/slack-work.ts Outdated
Treat Slack assistant-thread user messages as active steering even when a mailbox record carries the subscribed route. This preserves immediate steering for app-thread follow-ups without changing ordinary subscribed channel-thread deferral.

Fixes GH-603
Co-Authored-By: GPT-5 Codex <codex@openai.com>
@dcramer dcramer merged commit 5e6bcf4 into main Jun 17, 2026
16 checks passed
@dcramer dcramer deleted the dc/steering-interrupt-defer branch June 17, 2026 21:26
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.

Rethink mid-turn interrupt-steering for passive vs explicit messages

1 participant