Skip to content

Agent conversations: route by where a request was made, not who asked - #46759

Merged
Jinwoo-H merged 8 commits into
mainfrom
agent-routing-by-chat
Nov 22, 2026
Merged

Jinwoo-H merged 8 commits into
mainfrom
agent-routing-by-chat

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

An agent used to handle the same request differently depending on who asked. Now it follows one rule: every place (an Orca chat, a Slack thread, a Slack DM, a Linear issue, a GitHub PR) is its own chat, the agent sees all of its own work wherever it is, and answers go back to where the request came from.

Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​24 0 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​24
Prod 20 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​109 $\color{#cf222e}{\Huge{\mathbf{−}}}$​222 $\color{#cf222e}{\Huge{\mathbf{−}}}$​113

What Changed

Each change removes a check on who asked. No new check is added.

  1. Automations run in the chat they were made from. With no --runs-in, a recurring automation made from a chat other than the Home Chat now runs in that chat, whoever asked. Before, only a teammate's did; the owner's started a new conversation each run. Waits already worked this way. Automations already saved keep their target; only new defaults change (runs-in-caller-chat.ts).
  2. The agent's other chats and live work are shown to every turn. The "your other chats" note and the live-work note (items needing you, items in progress, running workers) were left out unless the turn acted for the owner alone. A teammate's turn, or a Home Chat turn a teammate's request woke, could not see a worker already on the same job, and started another. Both notes now go to every turn, and neither read looks up who the turn is for any more (bot-recent-chats.ts, bot-active-work-read.ts, bot-turn-ended.ts).
  3. Answers show where the request was made. The card that shows "sent to X" and its answer was written only when everyone who asked was the owner. It is now written in the sending chat unless that turn is answering a connector conversation (a Slack, Linear or GitHub thread, which gets the answer as the agent's reply there). The check reuses the askedInConversation record field each request already stores, so the sender's instructions and the card always agree. When the sending turn was itself answering a request from another chat (say, a teammate's thread asked the Home Chat, which asks another agent), the agent is still told to pass the answer back in its reply, keyed on that request (a new answersRequest record field) rather than on who asked (bot-request-view.ts, bot-request-owner-card.ts, bot-request-send.ts, bot-request-record.ts).
  4. new-chat works from the Home Chat whatever started the turn. It no longer requires the latest message to be one the owner typed in Orca, so asking from Slack works too. It still runs only from that agent's own Home Chat. The instruction to run it only when the owner asks is unchanged (bots.ts).
  5. Items closed from any chat go into the memory journal. Before, items closed in a teammate's chat (or in an old event run with an unknown causer) were left out, so a later "what did you do for Dana's release?" found nothing (bot-memory-journal-runtime.ts).

Instruction text that changes (agents read these)

src/main/bots/bot-preamble.ts line 63, before:

  • When you create or change an automation, tell your owner where it runs (a new conversation each time, this chat, or your Chat; one a teammate asks for runs in their chat) and where its results go.

After:

  • When you create or change an automation, tell your owner where it runs (a new conversation each time, this chat, or your Chat; a recurring one made from a chat other than your Home Chat runs in that chat unless told otherwise or it answers in a thread or runs on its own agent, which take a new conversation) and where its results go.

--runs-in help (src/cli/specs/automations.ts line 80) and the matching CLI skill guide (skill-guides/orca-cli/references/automations.md line 80, bundle regenerated). The changed clause, before:

except that one a teammate asks for from their chat runs in that chat, so its results reach them there

After:

except that one made from a chat other than its Home Chat runs in that chat, so its results reach whoever asked there

The skill guide's clause changes the same way and keeps its "(… Chat once that chat is closed)" note.

Why

Each check sent the same command or request to different places depending on who typed it. That cost real work: duplicate workers on a job a teammate asked about, answers written out "for Dana" in a chat Dana never reads, an owner's "post it here every morning" landing in a new conversation, and memory with no record of teammates' work. None of these checks protected anything. Teammates are already trusted to ask, and the same data was readable through orca bot chats, orca bot items and orca bot work list. Keying on the place a request came from gives one rule for every place.

Checks that do protect against outside parties are untouched: Who can ask, approval routing, Slack mirror defaults, marking event text as content, and refusing requests from other owners' agents.

Linked Issue

N/A (maintainer change).

Visual Proof

N/A: no UI changes. What changes is the text an agent is given and where its replies and cards go; the tests below pin each change.

Testing

  • Automated tests added/updated, or explained why not below

Main has since cut the test suite to invariant tests (#46786), which deleted every test file this PR had changed, so the PR's only test is the new bot-request-record.test.ts: a turn that took status mail and a question answers the question, and fails on the code before it. Locally on the merged tree: the Node typecheck, oxlint and oxfmt on the changed files, and the owner-DM reply tests main kept (external-conversation-legacy-replies.test.ts, connector-reply-restart-matrix.test.ts) with one worker.

The owner's Slack DM reply rule (words before NO_REPLY are still posted there, #47045) is unchanged by this PR.

Performance

Less work per turn: the other-chats and live-work reads no longer read the turn's record and acts-for rows first, and the other-chats read no longer looks up each chat's acts-for row. Nothing new runs. The only added work is that teammate turns now get the two notes owner turns already got: the same bounded, time-limited reads, with live work still cached per agent for 15 s.

Risk

Level: Medium

  • Agents give teammates' turns more context (other chats, live work). That information was already readable through the CLI, and it stays fenced as content.
  • Stored data and the protocol are unchanged: no fields, flags or methods are removed, and saved automations keep their target. A plain revert undoes everything; journal lines already written for teammate-chat items stay.

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Checklist

  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • I stated the risk: what could break, for whom, and how to back it out
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A): no platform-specific code. Remote hosts and paired servers run the same host code.

An automation made from a chat other than the Home Chat now runs in that chat
whoever asked, like waits already do; saved automations keep their target.
Items closed from any chat now join the memory journal.
…asked

Other-chats and live-work notes go to every turn, whoever asked. A request's
card shows in the sending chat unless that turn answers a connector
conversation. New Home Chat works from the Home Chat whatever started the
turn. The owner's DM is quieted by the marker like any thread.
@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • Resume reviews
  • Trigger review
Walkthrough

Active-work, journal, and recent-chat reads no longer use owner or asker identity filters. Request records capture conversation context and whether a turn answers another request, and request-card placement uses those fields. Recurring automations from a bot chat outside Home Chat use that chat under the default run-location behavior. Home Chat reset checks for bot callers use bot identity and current session.

Merge Risk: Low · previous review eb37a

Automation guidance may tell the owner a cross-bot recurring automation runs in the originating chat when it actually starts a new conversation. This is a small text mismatch and does not block merging, but it should be corrected.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title states the main change: agent conversation routing now depends on where a request was made rather than who asked. The changeset removes owner/teammate checks across automation run location, …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description check Passed The PR description follows the template's main sections (ELI5, What Changed, Why, Visual Proof, Testing, Performance, Risk, Agent skill upstream boundary, Checklist) and covers the change in detail. I…
Full details: Title check

Explanation

The title states the main change: agent conversation routing now depends on where a request was made rather than who asked. The changeset removes owner/teammate checks across automation run location, recent-chat and active-work reads, request card routing, and new-chat, which matches the title. It is specific and concise, and it does not describe unrelated work.

Full details: Description check

Explanation

The PR description follows the template's main sections (ELI5, What Changed, Why, Visual Proof, Testing, Performance, Risk, Agent skill upstream boundary, Checklist) and covers the change in detail. It explains the before and after behavior, the mechanism (removal of per-asker checks, new answersRequest field), the rationale, the test situation, the performance impact, and the risk level with a revert path. Gaps: the Linked Issue section says N/A (maintainer change) rather than linking an issue, which the template marks as required for outside contributors; the AI Disclosure section is absent; the Review and Notes sections are absent; and the Testing section ticks the manual-testing box is not checked, though it describes local verification. These gaps are non-critical for a maintainer PR, so the description is mostly complete.

Finishing Touches

Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A turn answering another chat's request now passes an onward answer back
there, beside its card. Removes two helpers nothing calls any more.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a3800034-0739-46ae-a249-2afc460af071
Commits

Reviewing files that changed from the base of the PR and between 6ed8e2f and b882031.

Files selected for processing: 8

  • src/main/bots/bot-request-view.test.ts
  • src/main/bots/bot-request-view.ts
  • src/main/runtime/rpc/methods/orchestration/messaging/bot-request-chain.test.ts
  • src/main/runtime/rpc/methods/orchestration/messaging/bot-request-record.ts
  • src/main/runtime/rpc/methods/orchestration/messaging/bot-request-send.ts
  • src/shared/bots/bot-acts-for.ts
  • src/shared/connectors/slack-direct-message.test.ts
  • src/shared/connectors/slack-direct-message.ts
Files with no reviewable changes: 3

  • src/shared/bots/bot-acts-for.ts
  • src/shared/connectors/slack-direct-message.test.ts
  • src/shared/connectors/slack-direct-message.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review.

Keep main's owner Slack DM reply rule (#47045) and main's test cuts (#46786).

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 112f3a73-51a6-49af-a21c-84918516a805
Commits

Reviewing files that changed from the base of the PR and between b882031 and 9098478.

Files selected for processing: 5

  • src/main/bots/bot-preamble.ts
  • src/main/bots/bot-request-view.ts
  • src/main/runtime/orca-runtime-bots.ts
  • src/main/runtime/rpc/methods/bots.ts
  • src/main/runtime/rpc/methods/orchestration/messaging/bot-request-send.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.

Comment thread src/main/bots/bot-preamble.ts Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 34fa1b27-01b1-44bd-bb2e-f2c3604ed8ea
Commits

Reviewing files that changed from the base of the PR and between 9098478 and 080a536.

Files selected for processing: 3

  • src/main/bots/bot-preamble.ts
  • src/main/runtime/rpc/methods/orchestration/messaging/bot-request-record.test.ts
  • src/main/runtime/rpc/methods/orchestration/messaging/bot-request-record.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

Comment thread src/main/bots/bot-preamble.ts Resolved

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 9bf08030-03e6-4553-ae82-28142672d1ca
Commits

Reviewing files that changed from the base of the PR and between 080a536 and eb37a21.

Files selected for processing: 2

  • src/main/bots/bot-preamble.ts
  • src/main/runtime/rpc/methods/automations/runs-in-caller-chat.ts
Files skipped from review as they are similar to previous changes: 1

  • src/main/runtime/rpc/methods/automations/runs-in-caller-chat.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 0 remain after this review.

Comment thread src/main/bots/bot-preamble.ts Resolved
@Jinwoo-H
Jinwoo-H merged commit 849c9da into main Nov 22, 2026
39 checks passed
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.

1 participant