Repository navigation
fix(bots): a bot woken by its own background work in a Slack DM is told to post itself - #50246
Conversation
…ld to post itself Slack DMs, and threads inside them, now each run in a chat of their own. The worker-start note stage 1 gives a thread chat now names a DM's own chat too, on the same proofs (delivery mark, opener stamp, origin record), so a turn that starts on its own there is told bot reply posts there. The bot's Chat still gets no note.
|
Perf scan: PASS (head 7cedcd0) No perf findings. The change loosens one gate: Work newly reached, one row per piece
Price at the reference fleet (100+ agents, a dozen calling the CLI every few seconds): only bot chats reach this, once per worker-start. Even if every CLI call were a worker-start, that's a few calls per second. Each call is one newest-turn indexed read plus a handful of PK lookups, about the same as the thread case already on main. No subprocesses, no timers, no subscriptions, no retained state. Regression classes touched
Six questions
Not covered: no runtime timing was measured. The impact above comes from the work counts in the source. |
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Review status for 7cedcd0 The problem: a bot that starts a background job from a Slack DM wakes up on its own when the job finishes. It wasn't told where the job came from or how to post there. Channel threads already got that note. The change: the worker-start note now also names a DM's own chat and a thread inside a DM, on the same three proofs as threads. The bot's shared Chat still gets no note. Nothing posts on its own; the bot uses its normal reply command. Verified:
Fixed after review: the PR body now follows the repo template. Deferred: the DM test case reuses a "the thread …" label from the shared test helper. It is naming only and hides no failure. |
ELI5
When a bot starts a background job from a Slack DM and the job finishes later, the bot wakes up on its own. Anything it says then stays in Orca unless the bot posts it. For Slack threads, the bot is already told where the job came from and how to post there. Now the same note appears in a DM's own chat. The bot decides whether to post; Orca posts nothing by itself.
What Changed
orca orchestration worker-startin a bot's chat for a Slack DM, or for a thread inside a DM, printed no note. A turn that woke on its own there wasn't told that its final message stays in Orca, or thatorca bot replyposts in the DM.orca bot reply --text "..."posts there".orca bot replyalready worked from such a turn in a DM's own chat. I checked the reply handler with a self-started turn in a per-DM chat, for both a bare DM and a thread inside a DM. The reply posted with no refusal. The connector service accepts a reply for any conversation bound to the host.What this stops working for
worker-startnow prints the note when the turn is proven to be that DM's.bot replythere is still refused.--on) startsWhy
Slack DMs, and threads inside them, now each run in a bot chat of their own, the same as channel threads. The worker-start note was limited to channel threads only because DMs used to share the bot's Chat. That is no longer true for any new DM, so the same rule and the same proofs now apply to them. A larger saved-DM mechanism for the shared Chat (#50146) was closed in favor of this.
Linked Issue
No issue. This is a maintainer follow-up to #49406, which added the note for channel threads.
Visual Proof
The note and a later reply in a DM's chat, in dark and light, are in the details block below. Before this change, worker-start printed no note in a DM's chat.
Screenshots: the note in a DM's chat (dark, light) and a later reply
Testing
connector-wake-reply.test.tsdrives the realconnector.wakeReplyPlacehandler. I removed each rule in turn and confirmed a test fails:Performance
None, because this only runs once per worker start from a bot chat. A DM chat now also does the origin read thread chats already do, which reads only the newest turn and gives up rather than reading the chat's history.
Risk
The riskiest part is naming a place the start didn't come from. A reply would then still go to the chat's own conversation, so the worst case is a misleading note. All three proofs must hold, and the bot's shared Chat is still excluded. Nothing is saved or migrated, and a plain revert undoes it.
Level: Low
AI Disclosure
Review
Self-reviewed for correctness, security, and performance. A fresh review and an independent regression audit of the final head found no code problems; the perf scan passed.
Agent skill upstream boundary
Notes
No change to security boundaries, platforms, SSH/remote hosts (the note is read from the bot's own chat before a start is routed), mobile, or saved data. An older machine without this change simply prints no note in a DM's chat.
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)