Skip to content

fix(connectors): carried messages keep their senders' authority and image cap - #48662

Merged
Jinwoo-H merged 1 commit into
mainfrom
fix/connector-carry-askers
Nov 25, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
fix/connector-carry-askers

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor

Follow-up to #48493. Fixes STA-18053, STA-18060, STA-18062.

What changed

  • Carried messages keep their senders' authority (STA-18053). When a Slack message fails to start (agent signed out, CLI missing…), the conversation's next message carries it into its turn. That turn was stamped with only the newest sender, so an owner's reply could carry a member's request and run it with owner rights. The carrying message now records every carried sender (nested carries included) as a host-only carriedAskers field, and the acting-turn reader counts them as stamped askers, so the existing least-trusted rule covers them. A carried message whose sender couldn't be read counts as unknown, as it does on its own.
  • The same carry now keeps a batch that couldn't leave its thread from becoming leave-eligible when carried again.
  • Image cap (STA-18060). Carried cards are taken oldest first while the total images (carried plus the new message's own) stay within the 20-image message cap. Cards that don't fit stay returned and ride the next message.
  • Returned-card query (STA-18062). Uses INDEXED BY journal_queue_order, the pattern the same file already uses, so it no longer walks the chat's whole queue history when the database has no planner stats.

Nothing is refused that wasn't before: every eligible card is still carried, some just one message later when images don't fit.

carriedAskers is in the journal storage schema and the send-payload strip list, like carriedCards, so it is never sent to the agent and doesn't change body fingerprints. Messages saved before this change have no carriedAskers and read exactly as before (tested).

Testing

  • New tests in external-conversation-returned-carry.test.ts drive the real journal writer and the real acting-turn reader:
    • a member's failed message carried by the owner's message doesn't act for the owner, and still doesn't when that carrying message fails and is carried again. Against main's code this fails with expected true to be false.
    • a carrying message saved without carriedAskers reads as it did before.
    • three cards with 8 + 8 + 4 images and a 4-image new message: the first two are carried (20 images), the third stays returned.
  • pnpm tc:node, oxlint, and the changed/adjacent test files (returned-carry, chat-send, bot-request-asker, leave-thread-authority): 38 passed.

Performance

  • The image budget is one pass over the carried cards' blocks, once per connector delivery, and only when a carry happens.
  • Reading carriedAskers adds one map over a small array per message in the acting turn's window.
  • The returned-card query now searches journal_queue_order directly. Measured earlier on the real schema: 0.65 ms at 10,000 cards and 12.6 ms at 100,000 cards before, 0.001 ms at 100,000 after. It runs on a journal reader worker thread.
Files Added Deleted Net
Test 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​73 $\color{#cf222e}{\Huge{\mathbf{−}}}$​7 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​66
Prod 8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​115 $\color{#cf222e}{\Huge{\mathbf{−}}}$​31 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​84

@coderabbitai

coderabbitai Bot commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Carried messages now include asker metadata, including nested carried askers and unknown asker entries. Carry selection accounts for outgoing images and carries eligible cards oldest-first within the image limit. Bot conversation and turn resolution incorporate carried askers. The message payload excludes carried asker metadata.

Merge Risk: Minimal · up to d4a66

Carried Slack messages now record their senders, including nested carries, so the existing least-trusted rule applies when resolving who a bot turn acts for. Carried cards are selected oldest first within the image cap, and the returned-card query is faster. No merge-blocking risk was found. Messages saved before this change keep their previous behavior.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the fix (carried messages keep senders' authority) and the image cap. Both appear in the changeset: carriedAskers feed the acting-turn authority check, and carriedMessages caps carried…
Description check Passed The description follows the template. It has What Changed, Why (via the mechanism and the alternative of carrying one message later), Testing with a checklist, a Performance section with a concrete li…
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.
Full details: Title check

Explanation

The title names the fix (carried messages keep senders' authority) and the image cap. Both appear in the changeset: carriedAskers feed the acting-turn authority check, and carriedMessages caps carried images at 20. The title covers the two main changes and omits the indexed query fix, which is an expected omission.

Full details: Description check

Explanation

The description follows the template. It has What Changed, Why (via the mechanism and the alternative of carrying one message later), Testing with a checklist, a Performance section with a concrete line, and tests and measurements. It has no Linked Issue section content, since it cites STA-18053, STA-18060, and STA-18062 but not a GitHub issue. It omits the ELI5, Visual Proof, Risk level, AI Disclosure, and Review sections.

Resolution

Optional improvements: add the ELI5 summary, a Visual Proof line (for example 'N/A' with the reason, since this is a backend behavior change), a Risk level with the backout method (a plain revert, noting that carriedAskers rows stay in saved journal data), a Linked Issue entry (Fixes #<issue> if a GitHub issue exists), and the AI Disclosure section if applicable.

  • 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

Recent 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: 36ec85b8-73db-4e70-9cb2-a43ca6d2a479
Commits

Reviewing files that changed from the base of the PR and between 4843fe1 and d4a6620.

Files selected for processing: 9

  • src/main/bots/bot-request-asker.ts
  • src/main/bots/bot-stamped-askers.ts
  • src/main/external-conversations/external-conversation-chat-send.ts
  • src/main/external-conversations/external-conversation-returned-carry.test.ts
  • src/main/external-conversations/external-conversation-returned-carry.ts
  • src/main/native-chat/agent-session-journal/durable-rows/journal-storage-schema.ts
  • src/main/native-chat/agent-session-journal/journal-domain-queue-reads.ts
  • src/shared/agent-session/journal/agent-journal-bot-message-fields.ts
  • src/shared/agent-session/requests/structured-agent-session-send-mutation.ts

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

@Jinwoo-H
Jinwoo-H merged commit 937606a into main Nov 25, 2026
56 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