Skip to content

fix(automations): a run answered together with another message no longer reads as failed - #47043

Merged
Jinwoo-H merged 1 commit into
mainfrom
fix/automation-answered-together-not-failed
Nov 22, 2026
Merged

Jinwoo-H merged 1 commit into
mainfrom
fix/automation-answered-together-not-failed

Conversation

@Jinwoo-H

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

Copy link
Copy Markdown
Contributor

Problem

A scheduled/event run whose prompt reached a chat mid-turn is answered in that same turn. Its prompt was handled; only its own result post is skipped. It was still stored as dispatch_failed, so the automation row, its hover and the run list showed a red Failed icon and offered a rerun.

Fix

  • A run whose turn was shared with another message now completes (completed, no output) and keeps the existing notice as its run detail: "This run's message was answered together with another message, so its result wasn't posted." That is the same shape as other completed runs whose result could not be posted.
  • Runs stored as failed by earlier builds with exactly that notice are read back as completed when the profile loads (and saved that way).
  • Other result-unavailable cases (message removed or edited before it went, unattributed, unreadable) keep failing as before.

Readers checked

Status icons and tones (automation-last-run, row status, mobile rows), failure filters/counts (runs dashboard, list groups), rerun (canRerunAutomationRun), run details banner, CLI format and webhook outcomes all key on dispatch_failed, so they now treat these runs as completed. The shared case never sent a could-not-finish notice, so notifications are unchanged.

Test

src/main/bots/bot-run-results.test.ts: the shared turn end completes, and a stored failed row with the notice loads as completed. Both fail with the fix reverted.

Performance

None, because the change only picks a different run status for one result case and adds one string comparison per stored run at profile load.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

When a shared turn is unavailable because a prompt was answered with another message, the bot run result is now completed, with a null output snapshot and a shared-answer notice. During loading, saved runs with dispatch_failed status and that exact notice are changed to completed. Tests cover the result, matching status repair, and preservation of other failed runs.

Merge Risk: Minimal · up to 44a40

Automation runs answered together with another message will now show as completed instead of failed. Earlier matching failed rows are repaired when loaded. The change is small and well covered by tests, so the merge risk is minimal.

Pre-merge checks: Passed 3 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Description check Warning The description explains the problem, the fix, the readers checked, the tests, and the performance impact, so it covers the substance of the change. It does not follow the repository template. It has … Add the missing template sections: ELI5 (plain-language summary); What Changed and Why (the before/after as a user sees it, and why this approach over alternatives); Linked Issue (an actual issue reference, since this is required for outsid…
Passed Passed checks: 3 passed

Check name Status Explanation
Title check Passed The title names the main change: a run answered together with another message no longer appears failed. It is specific and matches the changeset, which returns completed for shared turns and repairs s…
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 main change: a run answered together with another message no longer appears failed. It is specific and matches the changeset, which returns completed for shared turns and repairs stored dispatch_failed rows with the notice. The title uses the conventional fix(automations) prefix and is 88 characters long, slightly above typical length but still readable.

Full details: Description check

Explanation

The description explains the problem, the fix, the readers checked, the tests, and the performance impact, so it covers the substance of the change. It does not follow the repository template. It has no ELI5, Why, Linked Issue, Visual Proof, Testing checklist, Risk level, AI Disclosure, or Notes sections. The Performance section is present and filled in. The author gives no reason for the lack of a visual proof section, which the template requires for behavior changes. No linked issue is given (Fixes # is missing). The Risk section is missing, which the template calls for when saved data is touched, and this PR rewrites persisted run status at profile load. The testing checklist is absent.

Resolution

Add the missing template sections: ELI5 (plain-language summary); What Changed and Why (the before/after as a user sees it, and why this approach over alternatives); Linked Issue (an actual issue reference, since this is required for outside contributors, or confirm that you are a maintainer); Visual Proof (before and after evidence for the status icon and run list change, or N/A with reason); Testing (manual test steps, platforms tested, and the checked testing boxes); Risk (level, the riskiest part, and how to back it out, covering the saved-data rewrite at profile load); AI Disclosure if applicable; and the Review, Agent skill upstream boundary, and Checklist sections.

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

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: 2a83239c-c49a-4f51-8f19-443ba8d3c788
Commits

Reviewing files that changed from the base of the PR and between fad7986 and 44a401f.

Files selected for processing: 4

  • src/main/bots/bot-run-results.test.ts
  • src/main/bots/bot-run-results.ts
  • src/main/persistence/loading-store/profile-loading/normalize-loaded-state-collections.ts
  • src/shared/automations/history/automation-run-answered-together.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.

@Jinwoo-H
Jinwoo-H merged commit b51f439 into main Nov 22, 2026
38 of 42 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