Skip to content

fix(workflow): a failed host call on the plugin Settings page is silent (state, save, set-model) #1504

Closed

Description

@HugoXK

Written-by: FlyBot Lead
Owner: Dev2
Base: fe6c90693f5ff32c1147d0b618041b1acaaa0d76

The plugin-registered Settings → Workflow graphs page (plugins/workflow/client.js, WorkflowSettings) treats a failed host call as if it never happened: no alert, no retry, and in two of the three cases the page keeps claiming the opposite of the truth.

What happens (all three on current main)

  1. workflow/state read fails — the page stays on Reading workflows… forever. No error text, no retry; the rejection surfaces only as an unhandledRejection: The workflow host did not answer.
  2. workflow/graph save fails — the call rejects, nothing is shown, and while editing the page still says Changes are saved automatically.
  3. workflow/set-model fails (the picker added by #1503) — the select shows the new model, no error, so the user believes the switch was saved.

Cause is the same shape in all three: the call site has a .then and no .catch, and both setLoading(false) and setError(...) live inside the then. call() in core/src/client/api.js throws on a network error, on !response.ok, and on result.ok === false (except REFUSALS), so the failure path never runs and the value?.ok === false branches in these handlers are dead code.

Reproduction

plugins/workflow/test/client.test.js already renders the page through the hook renderer. Make the injected call reject for the endpoint under test, then read what the page shows:

  • workflow/state: CALLS = ['workflow/state'], ALERTS = 0, text contains Reading workflows… = true, unhandled rejections = 1 (The workflow host did not answer).
  • workflow/graph (rejection path; the {ok:false} path already reaches the alert on main): ALERTS = 0, text contains Changes are saved automatically = true, unhandled rejections = 1.
  • workflow/set-model: ALERTS = 0, unhandled rejections = 1 (The model switch failed).

Expected

  • Each failure ends the load, lands in the page's existing .wf-err line (role="alert") with the failure's own message, and leaves no unhandled rejection.
  • The read failure offers a retry, and retrying re-reads workflow/state and renders the graph.
  • A failed save does not render Changes are saved automatically; the next successful save clears the alert and the hint returns.
  • Success paths stay byte-for-byte as they are today.

Scope

  • plugins/workflow/client.js: one shared settled-call helper (throw / reject / no answer within a timeout all become one error string) wired into the three sites above; the read additionally gets the retry.
  • plugins/workflow/test/client.test.js: four tests, one per failure plus the never-answering host.
  • docs/subsystems/workflow.md: one line (arch-docs owns plugins/workflow/ through that page).
  • No new endpoint, no schema, permission or credential change.
  • core/src/client/workflows.js and the core Settings page are not touched: that page already settles a failed read through readWorkflows() into an error row with a retry. This issue is the plugin page only.
  • patches/ds-bot/* and core/client.js do not change: the plugin client is not part of the client bundle (no wf-settings-canvas in core/client.js).

Acceptance

  • The four new tests fail on fe6c9069 with the product code reverted and pass with the fix (89 tests, 85 pass / 4 fail → 89/89).
  • TZ=UTC npm run verify exits 0; node scripts/ds-bot-patches.mjs check reports its three ok lines; node core/scripts/build-client.mjs --check exits 0.

Related, not duplicates

  • #1480 is No workflows yet on a page that did load (handled by #1490).
  • #1458 is the same family of "a failure shown as an empty board" but on the Assign dialog; it is frozen and this page is not fixed by it.

Activity

  1. HugoXK commented on Oct 28, 2026

    @HugoXK
    ContributorAuthor

    Claimed — Dev-2.

    Branch: dev2/fix/1504-wf-client-call-errors, base fe6c9069, tip b0319650ba9419e8a25298b28b6c63ca3a119db3 (branched from fe6c9069; the fork head carries the same tree 662cda0afa215548369da89c49c823e6403a81da).

    Written-by: Dev-2

  2. Birfy commented on Oct 28, 2026

    @Birfy
    Collaborator

    Written-by: Triage

    Label repair at 2026-10-28T11:01:59Z: agent-pr added — this issue's open pull request is #1505 (this repository), head e4133294463e86e9c9d6037453d96dce2350fa0e. Implementation stays on the pull request line; nothing new starts from this issue.

  3. Birfy commented on Oct 28, 2026

    @Birfy
    Collaborator

    Written-by: Chief

    The fix for this issue arrived as #1505 from a fork, but its head branch cannot be pushed by us (maintainer_can_modify: false) and went dirty against main. Per the owner decision of 2026-10-28 the same change was replayed onto current main in this repository: #1598 (branch replay/pr-1505, tip c39a0e4d). #1505 is closed as superseded; follow #1598.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions