fix: report runAction failures in desktop app instead of failing silently - #4518
fix: report runAction failures in desktop app instead of failing silently#4518praisonai-triage-agent[bot] wants to merge 1 commit into
Conversation
β¦ntly (fixes #4502) Wrap the settings runAction body in runActionInner and catch failures with a toast, so Export/Check for updates/MCP no longer resolve into silence when the engine is unreachable. Export additionally throws on non-ok responses so a 500 cannot slip past, and the clipboard is only written on success -- a failed export can no longer masquerade as a backup via a stale paste. Co-authored-by: MervinPraison <MervinPraison@users.noreply.github.com>
|
@coderabbitai review |
|
/review |
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more β On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
Greptile SummaryThe PR makes desktop Settings actions report rejected operations instead of silently discarding them.
Confidence Score: 5/5The PR appears safe to merge, with no actionable changed-code defects identified. The wrapper preserves successful action behavior while catching previously discarded failures, and export now writes to the clipboard only after all required HTTP responses succeed.
|
| Filename | Overview |
|---|---|
| src/praisonai-desktop/ui/index.html | Adds centralized action error reporting and prevents failed or partial HTTP exports from being presented as successful clipboard backups. |
| src/praisonai-desktop/frontend/tests/engine-down.test.mjs | Adds coverage proving an unreachable engine produces an error toast without modifying the clipboard. |
Sequence Diagram
sequenceDiagram
actor User
participant UI as Desktop Settings
participant Engine
participant Clipboard
User->>UI: Select Export
UI->>Engine: GET /chats
alt Request fails or response is not OK
UI-->>User: Show failure toast
else Conversation list succeeds
loop Each conversation
UI->>Engine: GET /chats/:id
end
alt Any detail request fails
UI-->>User: Show failure toast
else All details succeed
UI->>Clipboard: Write complete export
UI-->>User: Show success toast
end
end
Reviews (1): Last reviewed commit: "fix: report runAction failures in deskto..." | Re-trigger Greptile
|
@claude You are the FINAL architecture reviewer. If the branch is under MervinPraison/PraisonAI (not a fork), you are able to make modifications to this branch and push directly. SCOPE: Review changes in this PR. Python SDK: praisonaiagents, praisonai. TypeScript SDK: src/praisonai-ts/. Do NOT modify src/praisonai-rust. Read ALL comments above from Gemini, Qodo, CodeRabbit, and Copilot carefully before responding. Phase 1: Review per AGENTS.md
Phase 2: FIX Valid Issues Phase 3: Final Verdict |
|
Claude finished @MervinPraison's task ββ View job Final Architecture Review β PR #4518
Verdict: β Approve β no changes neededScope: Desktop app UI only ( Phase 1 checks
Independent verification (things I checked beyond the reviewers)
Tests run locally
Files modified by me: none. Skipped: no code fixes β no valid blocking issues from any reviewer or from my own pass; the PR is correct, minimal, and tested. |
Fixes #4502
Problem
In the desktop app's Settings panel, every
runActionbranch was a bareawait fetch(...), andb.onclick = () => runAction(def)discarded the returned promise. When the engine was unreachable (restart/crash with Settings open β the same panel that restarts the engine), the fetch rejected and the click resolved into silence. Worst on Export, the app's only backup path:navigator.clipboard.writeTextwas never reached, no toast appeared, and the user could paste stale clipboard content into a file believing it was a backup.Fix (
src/praisonai-desktop/ui/index.html)runActioninto an outer wrapper thattry/catch-es and surfaces failures viatoast('That did not run: β¦'), andrunActionInnerholding the existing branch logic (unchanged behaviour on success).if(!r.ok) throwon each fetch (a 500 does not reject), so the clipboard is written only on success β a failed export can no longer masquerade as a backup.Test (
frontend/tests/engine-down.test.mjs)Added a case: with the engine stub throwing a network error, calling the export action asserts (a)
navigator.clipboard.writeTextwas not called with stale content, and (b) an error toast is visible. All 6 tests in the suite pass;buttonsandsettings-effectssuites show no regressions.Generated with Claude Code