Skip to content

fix(connectors): a Slack turn with no answer says so plainly, and warns when tools already ran - #47901

Merged
brennanb2025 merged 11 commits into
mainfrom
brennanb2025/no-answer-fallback-line
Nov 25, 2026
Merged

brennanb2025 merged 11 commits into
mainfrom
brennanb2025/no-answer-fallback-line

Conversation

@brennanb2025

@brennanb2025 brennanb2025 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

When a bot finishes a Slack request without writing any answer, the thread now says "I finished without writing a reply. Ask again if you still need one." If the bot ran tools during that turn, the line adds "I may have already taken some actions, so check before asking again." It posts as the bot, so it speaks as "I".

Files Added Deleted Net
Test 3 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​115 $\color{#cf222e}{\Huge{\mathbf{−}}}$​1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​114
Prod 14 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​411 $\color{#cf222e}{\Huge{\mathbf{−}}}$​47 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​364

What Changed

  • Before: a turn that succeeded with no written answer read "Done on , without a written answer." in the thread, whether or not it had already run commands or other tools.
  • After: that turn reads "I finished without writing a reply. Ask again if you still need one." When a tool call inside the turn may have changed something, the line ends with "I may have already taken some actions, so check before asking again." Reads never add it. Other outcomes keep their own lines.
  • Mechanism:
    • The turn end reads whether work inside the turn may have acted from the journal items it already has (structuredAgentSessionTurnReply, its own file now), both on the live turn end and in boot recovery.
    • tool-call-side-effects.ts decides that. A file edit recorded as a diff acts. A tool call acts unless it is a known read: read, search, list, web fetch or search, plan and to-do tools, across Claude, Codex, OpenCode and Gemini names. A shell command counts as a read only when every command in it is a known read program with no writing flag (cat, rg, ls, sed -n 'Np', git log|show|diff|status, gh pr view|list, Orca's own read commands, and so on), with no redirection, substitution or background job, and every word plain or wholly quoted. Anything it can't read plainly counts as acting, so the note errs toward showing. The look-around policy now shares its unwrapShell.
    • A no_answer fill stores it in a new tools_ran column on the reply outbox row, added the same way as the earlier columns (no user_version change; an older build never reads it).
    • The reply event carries an optional toolsRan: true (TypeScript contract and the connector contract schema). Rows that differ only in it go out as separate events.
    • The kill-switch drain, which posts its own sentence, now uses the same line and note (connector-reply-outcome-sentence.ts, split out of the outbox file).
    • The service renders the line from the event; its change ships separately and reads the new field once its contract pin includes it. Until then it shows the plain line.

Why

"Done … without a written answer" reads like success, so people did not know to ask again. And a turn that ran tools before going silent may already have changed something, so asking again blindly can repeat it. The note asks them to check first.

Linked Issue

N/A (internal).

Visual Proof

N/A: no Orca UI change. This changes the text a Slack thread gets for a turn with no answer.

Testing

  • I manually tested these changes locally
  • Automated tests added/updated, or explained why not below
  • Every added test fails without this change and avoids the test anti-patterns

journal-connector-tools-ran.test.ts (persistence): a reply table an earlier build made gains the column; a no_answer row filled with tools-ran keeps it through the store, and reaches the event apart from a row without it. It fails without the change. pnpm check:changed passes on macOS. The service side was run against this branch's contract: a no_answer event with toolsRan posts the line with the note.

Performance

None, because whether a tool ran is read from the turn's items the turn end already holds, once per ended turn; the outbox row gets one more small column.

Risk

A newer row read by an older build ignores tools_ran and sends no note; an older service ignores the event field. Back out with a plain revert; the added column stays unused.

Level: Low

AI Disclosure

Review

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.

Notes

Stacked on #47896.

Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance

Checklist

  • This PR is small and focused
  • 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)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

@coderabbitai

coderabbitai Bot commented Nov 23, 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

The change classifies tool calls that may have side effects and tracks that status through turn replies and connector reply storage. No-answer reply events can include toolsRan, and fallback text can include a note when tools ran.

Merge Risk: Low · previous review 00433

Slack no-answer replies after read-only tool use will not include the "check before asking again" note that the PR intends. This is a narrow wording gap with a one-line fix, so the change is mergeable once it is corrected.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: a Slack turn that ends with no answer now says so plainly and warns when tools already ran. The changeset matches this: it adds the new no-answer wording, the toolsRan…
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 description follows the repository template closely. It has a clear ELI5, a detailed What Changed section with before and after behavior and the mechanism, a Why section, a Visual Proof marked N/A…
Full details: Title check

Explanation

The title names the main change: a Slack turn that ends with no answer now says so plainly and warns when tools already ran. The changeset matches this: it adds the new no-answer wording, the toolsRan flag, and the tools_ran column. The title is long (94 characters) but specific and accurate.

Full details: Description check

Explanation

The description follows the repository template closely. It has a clear ELI5, a detailed What Changed section with before and after behavior and the mechanism, a Why section, a Visual Proof marked N/A with a reason, a Testing section naming a regression test and the platform used, a Performance line, a Risk section with a level and a back-out plan, and a completed checklist. Gaps: the Linked Issue section says N/A (internal) rather than linking an issue, and the template says an issue should always exist for outside contributors. The author appears to be an internal contributor, so this is likely acceptable. The AI Disclosure section is empty. The Testing section mentions a manual service-side run but the first manual-testing box is unchecked, which is consistent with the text. The Risk section names the riskiest part only loosely. Overall the description is mostly complete.

  • 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

@brennanb2025
brennanb2025 force-pushed the brennanb2025/no-answer-fallback-line branch from 2bfa6c1 to a9c0cee Compare November 23, 2026 23:20
@brennanb2025
brennanb2025 changed the base branch from main to brennanb2025/no-reply-keeps-words November 23, 2026 23:20
@brennanb2025

brennanb2025 commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor Author

Review status

Problem. A bot's Slack, GitHub or Linear turn that succeeded without writing an answer read "Done on , without a written answer." That looked like success, and it said nothing about actions already taken.

User-facing change. The thread reads "I finished without writing a reply. Ask again if you still need one." It posts as the bot, so it speaks as "I". When work in the turn may have changed something, it adds "I may have already taken some actions, so check before asking again." That covers a write, an edit, a send, a spawn or a shell command not known to only read. Reads never add it. The service side ships separately and reads the event field.

Fixed during review (four Claude rounds, five audits):

  • File edits that Codex, Pi and ACP agents record as diff items now count as actions.
  • Shell writes no longer pass as reads:
    • process substitution and bundled or shortened flags (sort -uo, --o=, gh api -iX, git grep -nO)
    • sed scripts beyond -n 'Np'
    • tree -o|-R, file -C, clock-setting date
    • gh extensions and aliases, gh browser flags
    • orca orchestration check (it marks mail read), --offer
    • any word the shell would rewrite (inner quotes, \\, $, braces)
  • More read-only tool names across providers.
  • Rebased onto main after fix(bots): to stay silent a bot writes only NO_REPLY; any other words are its reply #47962 and fix(connectors): a bot's words before a trailing NO_REPLY post in every Slack conversation #47896; main's new quiet_rule column kept beside tools_ran. Rebased again for main's look-around shell refactor; this PR no longer touches look-around.
  • Final round: a shell wrapper unwraps only from a bare or system shell path; only a whole 2>&1 is stripped; a glob given to a program with writing flags counts as acting.

Deferred.

  • Read-only forms the classifier doesn't know (for example gh api --jq '..|..') count as acting, so the note sometimes shows after reads. This errs toward showing.

Verified.

  • Classifier invariant test: every listed read passes and every listed write acts. It fails if a guard is removed.
  • Persistence test for tools_ran from an older table. pnpm check:changed passes.
  • Final blinded audit: SAFE. Last Claude review: no findings at should-fix or above.
  • Perf: one early-exit pass at turn end over rows already loaded; linear regexes.
  • CI green. The service side: the connector suite passes with the new line.

@brennanb2025
brennanb2025 force-pushed the brennanb2025/no-reply-keeps-words branch from 1b270d3 to 0723174 Compare November 24, 2026 03:54
@brennanb2025
brennanb2025 force-pushed the brennanb2025/no-answer-fallback-line branch from a9c0cee to 9f3b600 Compare November 24, 2026 03:54
@brennanb2025
brennanb2025 changed the base branch from brennanb2025/no-reply-keeps-words to main November 24, 2026 05:29
@brennanb2025
brennanb2025 force-pushed the brennanb2025/no-answer-fallback-line branch 2 times, most recently from 5218b88 to 7f8a7b3 Compare November 24, 2026 20:08

@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: 3

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: 8b3bf365-4c77-4ce6-9af0-c5bfdaa397ad
Commits

Reviewing files that changed from the base of the PR and between 5218b88 and 7f8a7b3.

Files selected for processing: 12

  • cloud/packages/connector-contract/src/event-messages.ts
  • src/main/external-conversations/external-conversation-ended-turn.ts
  • src/main/external-conversations/external-conversation-reply-fill.ts
  • src/main/external-conversations/external-conversation-reply-turn-fill.ts
  • src/main/external-conversations/external-conversation-turn-ends.ts
  • src/main/native-chat/agent-session-journal/connector-replies/journal-connector-replies-read.ts
  • src/main/native-chat/agent-session-journal/connector-replies/journal-connector-replies-schema.ts
  • src/shared/agent-session/journal/journal-connector-reply.ts
  • src/shared/agent-session/requests/structured-agent-session-turn-reply.ts
  • src/shared/agent-session/requests/tool-call-side-effects.test.ts
  • src/shared/agent-session/requests/tool-call-side-effects.ts
  • src/shared/connectors/connector-cloud-contract.ts

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

@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: f56cae68-1aac-410a-9a9b-e5b556b69500
Commits

Reviewing files that changed from the base of the PR and between 7f8a7b3 and 004331d.

Files selected for processing: 3

  • src/shared/agent-session/requests/structured-agent-session-turn-reply.ts
  • src/shared/agent-session/requests/tool-call-side-effects.test.ts
  • src/shared/agent-session/requests/tool-call-side-effects.ts

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

@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf scan, hot-path surface (fresh reviewer, head 978bf4f)

NOTHING NEEDED: perf scan of d47901 is finished and found no performance problems.

The new work only runs when a turn tied to a connector ends, or when recovery fills a turn. All of it stays inside data that is already loaded.

Changed work Trigger / population Bound New scans / timers / I/O / state
structuredAgentSessionTurnReply (structured-agent-session-turn-reply.ts) Runs when readTurn is called for a connector turn that ended, and once per turn in recovery (fillRecoveredTurn) One items.some pass over the journal window that is already loaded. operationWindow reads that window anchors-only, without tool output, and cut at the cursor. The pass stops at the first item that may have acted. One added pass over the same items array that the existing prose scan already walks. No I/O and no timers.
toolCallHasSideEffects / shellCommandOnlyReads Only tool-call and diff items whose turnScope is this turn Cost grows with the length of each command. Each regex is anchored or uses alternatives that can't overlap: unwrapShell's (?:[^']|'\\'')*, the lookbehind-gated WORD, and the reject test. None of them can backtrack catastrophically. The word lists are small fixed sets. None. The module holds only constant sets and tables.
tools_ran column (schema, fill, page read) Fill: once per row. Read: an outbox page. One nullable INTEGER per row, added through the existing ADDED_COLUMNS path. It is not indexed and the WHERE clauses don't change. Each row keeps one more column for as long as the row lives.
replyEventsOf group key gets toolsRan Outbox fill and resend, per page of rows O(rows on the page). The extra key part can only split groups further, and each group is still capped by maxReplyDeliveryIds. None
outcomeSentence moved to its own file, with a toolsRan branch Drain post, per owed row Builds a constant string None
Wire and contract fields toolsRan?: true Per reply event A single literal flag None

Six questions:

  1. Work before skip gates: the flag is worked out even for answered turns, which never use it. That costs one pass in memory and stops early, so it's negligible.
  2. Ownership multiplication: none. There is one evaluation per ended turn, the same as the existing prose read.
  3. Thread / storage cost: main thread, CPU only, over data already in memory. One nullable column per outbox row.
  4. Growth / progress: nothing accumulates. The cost tracks the turn's window size and command lengths, and both are already bounded.
  5. Execution host: main process, on the turn-end and recovery paths that already exist.
  6. Cancellation / cleanup: nothing new to cancel or dispose: no listeners, timers or caches.

@brennanb2025
brennanb2025 force-pushed the brennanb2025/no-answer-fallback-line branch from 978bf4f to becaa1e Compare November 25, 2026 00:27
@brennanb2025

Copy link
Copy Markdown
Contributor Author

Perf scan, hot-path surface (fresh reviewer, head 309b74a)

NOTHING NEEDED: perf scan of d47901 is clean, nothing waiting on you.

Changed work Trigger / population Bound New scans, timers, I/O, state
structuredAgentSessionTurnReply (structured-agent-session-turn-reply.ts:9) Runs once per ended connector turn (outboxTurn), and once per owed turn during recovery (fillRecoveredTurn). Recovery only runs for sessions that still have unfilled rows. One extra items.some pass over the snapshot it is given. It stops at the first call that acts, and only items in this turn reach the classifier. This is the same order of work as the existing scan in structuredAgentSessionTurnAssistantMessage. One linear pass. No I/O, no timers, nothing kept.
toolCallHasSideEffects / shellCommandOnlyReads (tool-call-side-effects.ts:745) Runs per tool-call item in that turn, with the same population as above. Linear in the command's length. The unwrapShell regex has alternatives that can't overlap ([^'] vs '). The WORD regex can only start a match after whitespace (lookbehind), so its backtracking stays inside one word. Lines with <<, $( or > bail before word parsing, so large here-docs exit early. No pattern can backtrack catastrophically. Module-level constant Sets and the READ_PROGRAMS map. Nothing grows.
Outbox: replyEventsOf group key, drain outcomeSentence (connector-reply-outbox.ts:97) Runs per owed row on each outbox page. Adds one field to the key and one branch. None.
Store: tools_ran column (schema, fill UPDATE, OWED_COLUMNS) Runs per fill and per page read. One nullable INTEGER per row, already inside the existing paged read. It is added to ADDED_COLUMNS, so an older table gets one cheap ALTER at schema setup. One column per row, same lifetime as the row.
outcomeSentence moved to its own file Same callers as before. Unchanged. None.

Six questions: hot path = turn end and recovery, each running once per ended or owed connector turn · population = journal items in one turn's snapshot (tool calls go through the classifier) · bound = linear in items and in command length, stopping at the first call that acts · new scans = one linear pass per turn, no worse in order than the scan already there · timers/I/O = none new, apart from one column in existing SQL statements · retained state/growth = one nullable column per outbox row, with no in-memory growth.

@brennanb2025
brennanb2025 merged commit 0c2388d into main Nov 25, 2026
62 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