Skip to content

fix: surface automation Run now failures on the row (#85) - #197

Merged
currentbits merged 1 commit into
mainfrom
coder/automation-run-now-failure-is-an-unhandl-30a68c
Aug 16, 2026
Merged

currentbits merged 1 commit into
mainfrom
coder/automation-run-now-failure-is-an-unhandl-30a68c

Conversation

@currentbits

@currentbits currentbits commented Aug 16, 2026 •

Copy link
Copy Markdown
Owner

Closes #85.

void onRunNow(auto.id) turned a failed automation run into an unhandled rejection, and useCoder.runAutomationNow threw before refreshAutomations() — so the lastError the main process had already written stayed invisible until a full reload. The user got no feedback at all.

What changed

  • src/useCoder.ts — runAutomationNow refreshes in a finally, so the throwing path resyncs the store too and the row picks up lastError.
  • src/components/AutomationsView.tsx — toggle / Run now / delete all route through one runRowAction helper that catches and parks the message on that row's existing error line. That also covers transport-level failures which never reach lastError.
  • src/App.tsx — setArchived now reports whether it worked, so a mid-loop failure in handleClearSettled no longer offers undo for threads that never archived. It already swallows its own error into the run-error banner, so nothing was going to reject there — the real defect was the lying undo toast.

Verification

  • New case in test/automationsView.test.tsx: a rejecting onRunNow renders on the row.
  • npm run typecheck clean; npm run test:renderer 704/704.

Not done: Sidebar.runBatchArchive reports "N archived" with the same optimism; its prop type returns void, so widening it is a separate change.

🤖 Generated with Claude Code

  • PR created by the Claude Code agent

`void onRunNow(id)` swallowed a rejected run into an unhandled rejection,
and useCoder's await threw before refreshAutomations(), so even the
lastError the main process had already written stayed invisible until a
full reload.

- useCoder: refresh in a finally so the throwing path resyncs too.
- AutomationsView: run the three row actions (toggle/run/delete) through
  one helper that parks the failure on that row's error line.
- App: setArchived now reports success, so a mid-loop failure in
  handleClearSettled no longer offers undo for threads that never
  archived (its message already lands in the run-error banner).

Co-Authored-By: Claude Opus 5 <[email protected]>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@currentbits
currentbits merged commit c528ab4 into main Aug 16, 2026
1 check 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.

Automation 'Run now' failure is an unhandled rejection with no feedback

1 participant