You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(connectors): a Slack turn with no answer says so plainly, and warns when tools already ran - #47901
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.
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.
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: 4
Check name
Status
Explanation
Title check
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
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Description check
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.
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)
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.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.
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:
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.
Ownership multiplication: none. There is one evaluation per ended turn, the same as the existing prose read.
Thread / storage cost: main thread, CPU only, over data already in memory. One nullable column per outbox row.
Growth / progress: nothing accumulates. The cost tracks the turn's window size and command lengths, and both are already bounded.
Execution host: main process, on the turn-end and recovery paths that already exist.
Cancellation / cleanup: nothing new to cancel or dispose: no listeners, timers or caches.
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.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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".
What Changed
structuredAgentSessionTurnReply, its own file now), both on the live turn end and in boot recovery.tool-call-side-effects.tsdecides 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 itsunwrapShell.no_answerfill stores it in a newtools_rancolumn on the reply outbox row, added the same way as the earlier columns (nouser_versionchange; an older build never reads it).toolsRan: true(TypeScript contract and the connector contract schema). Rows that differ only in it go out as separate events.connector-reply-outcome-sentence.ts, split out of the outbox file).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
journal-connector-tools-ran.test.ts(persistence): a reply table an earlier build made gains the column; ano_answerrow 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:changedpasses on macOS. The service side was run against this branch's contract: ano_answerevent withtoolsRanposts 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_ranand 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
Notes
Stacked on #47896.
Ensure no issues in: Security, Cross-platform support (Linux, Windows, Mac), Remote SSH, Mobile, general backwards compatibility, performance
Checklist
N/Awith reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm buildpass (or CI will cover; local preferred)