Skip to content

console: a per-record bulk flow action counts runs the flow refused (status "refused") as succeeded, and shows only one of the refusal messages #36915

Description

@sunhaolin

Summary

On a list view whose bulkActions names a type: 'flow' action in the bare-string form (per-record dispatch), the selection bar's result dialog counts a run that the flow refused as a success. A flow that ends on an end node with outcome: 'refused' answers 200 with data.status: "refused" and a refusalMessage; the bulk result still reads "Succeeded N / N" and lists the refused rows as done. In the same run only one refusal dialog is shown, whichever refused row it belongs to; the other refused rows' reasons are never displayed.

The same action launched from a row menu behaves correctly: the refusal dialog replaces the success toast.

Environment

  • @objectstack/* 18.6.0, console at /_console, zh-CN locale (same in en)
  • App: HotCRM 6.6.0 (objectstack-ai/hotcrm), action create_campaign on crm_lead (type: 'flow', target: 'campaign_lead_member_enroll', recordIdParam: 'leadId', one lookup param), wired as bulkActions: ['create_campaign'] on the All Leads grid

Steps

  1. Open the leads list, tick three leads: two with email_opt_out = true, one without.
  2. Selection bar → Add to Campaign, pick an open campaign, Next, confirm the three listed records, Run.

Actual

Three POST /api/v1/actions/crm_lead/create_campaign calls, all 200:

// two of them
{"success":true,"data":{"success":true,"status":"refused",
  "refusalMessage":"<lead name> has opted out of email, so the lead was not added to the campaign.",
  "output":{"enrolled":false,"addedCount":0,"alreadyCount":0}, ...}}
// one of them
{"success":true,"data":{"success":true,
  "output":{"enrolled":true,"campaignName":"…","addedCount":1,"alreadyCount":0}, ...}}

The console then shows two dialogs at once:

  • the bulk result dialog: "Succeeded 3 / 3", listing all three leads;
  • on top of it, one refusal dialog with the message of one of the two refused leads.

Closing the refusal dialog does not reveal a second one. One member row was created, not three. With a single opted-out lead selected the result reads "Succeeded 1 / 1" next to a dialog that says the lead was not added.

Expected

  • A per-record dispatch whose response carries status: "refused" is not counted as succeeded. The result dialog reports it apart (for example "1 succeeded, 2 refused") and shows each refused row with its own refusalMessage.
  • No separate refusal dialog is stacked on the result dialog; or, if one is kept, it carries every refused row's message.

Why it matters

The user reads "Succeeded 3 / 3" and takes the whole selection as enrolled. The one refusal they are shown names one person, so the other refused people are lost silently. Any app that puts a gate in a flow as an outcome: 'refused' end (the documented way to refuse with per-record text, #14945) gets a wrong count on the bulk door.

Related: #34269 fixed the same symptom for the aggregate contract (BulkActionResult dropped, all rows reported succeeded). This is the per-record fan-out contract, where each call's own status is the per-row verdict.

Activity

  1. added
    bug
    priority:p1
    domain:ui
    on Nov 24, 2026
  2. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    triage#1 · os-warren · session_01JQwxbZKP5YM48rWMWTS7wE

    Triage: lands in area:ux · domain:ui · priority:p1 · Bug · pm:queue · size S.
    Rationale: the p1 grade is the filer's and stays as set. The defect is in the console's selection-bar bulk executor and its result dialog: a per-record type: 'flow' dispatch reads a 200 with data.status: "refused" as success, and only one refusal message is shown. The row-menu path already handles a refusal, so the fix is to make the bulk path count refused runs apart and list each refusal message in the result dialog. Routed to repo:objectstack#3 (area:ux) by the maintainer's seat routing.

  3. added
    pm:queue
    on Nov 24, 2026
  4. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#3 · os-support-ai · session_01WGufzhoBbwh8URjwQHde8v

    Claim: PM loop round 1 (area ux-B)
    Session: session_01WGufzhoBbwh8URjwQHde8v
    Account: os-support-ai
    Branch: claude/issue-36915-bulk-flow-refused-count
    Worktree: objectstack-issue-36915
    Domain: domain:ui
    Seat: repo:objectstack#3
    Area: ux-B
    File surface: ui/packages/plugin-grid/src/hooks/useBulkExecutor.ts (a per-record dispatch whose answer is a refused run counts as refused, never succeeded, and keeps its own message), ui/packages/plugin-grid/src/components/BulkActionDialog.tsx (the result reports refused rows apart, each with its own refusalMessage), ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx (the per-record handler hands the refusal back as the row's verdict instead of opening one stacked FlowRefusalNotice), ui/packages/app-shell/src/utils/flowLaunch.ts only if the bulk path needs the launch judgement in another shape, their existing tests, the i18n packs if a "refused" count string is added (all packs, key parity), one changeset listing every published package touched. ui/packages/app-shell/src/utils/flowResponse.ts (open PR #36845) and ui/packages/core/src/actions/ActionRunner.ts (open draft PR #36919) are read, not edited; a needed edit there stops the dev
    Container & model: S, mode:subagent, model: default (dispatch-gates --tier at 4f19091997f: "no path-derived mandate"), effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: the per-record bulk fan-out reads each call's transport success; the refused-run arm (#14945, read by judgeFlowLaunch for the row-menu path since objectui#9973) was never wired into it. #34269 fixed the aggregate contract only
    Thread-read: 7127583168
    Premise: holds (read on 4f19091997f: the row-menu path routes a refused run to setFlowRefusal (useConsoleActionRuntime.tsx:820-823), a single notice state, so a fan-out of N refused rows can show one message; useBulkExecutor.ts carries BulkRowError.userMessage for a promoted per-record refusal but has no refused arm for a 2xx status: "refused". Not yet run in a browser; the card's HotCRM repro is the live evidence)
    Serial constraints cleared: open PR #36845 edits flowResponse.ts and draft PR #36919 edits ActionRunner.ts; this card does not edit either. No open PR touches useBulkExecutor.ts, BulkActionDialog.tsx, useConsoleActionRuntime.tsx or flowLaunch.ts (open-PR file sweep at 09:3xZ)
    Pre-claim lane: domain:ui. Console bulk executor and its dialog; no spec key; the per-record contract (each call's own status is the row's verdict) is the card's, and the aggregate BulkActionResult path (#34269) is unchanged. This lane
    Pre-claim deps: none
    Prior rulings read: maintainer ruling on objectstack#14945 (a flow refuses with per-record text through an end node with outcome: 'refused'; the console shows the engine's sentence), as cited in flowResponse.ts:90-102; #34269 (aggregate contract) for the sibling shape. check-prior-rulings.mjs --card 36915: 0 ruling comments on the card's thread; no conflict

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 24, 2026
  6. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#3 · os-support-ai · session_01WGufzhoBbwh8URjwQHde8v
    os-dev-report

    {
      "issue": 36915,
      "status": "blocked",
      "branch": "claude/issue-36915-bulk-flow-refused-count",
      "pr": null,
      "session": "session_01WGufzhoBbwh8URjwQHde8v",
      "premise_still_valid": true,
      "summary": "The defect holds on 4f19091997f, read from code (no browser run). The fix needs files outside the claimed surface, so no code was written and no PR was opened, as the dispatch asked. The chain: ObjectGrid.tsx runBulkActionRecord calls executeAction, the ActionRunner calls the console flowHandler / flowDispatch (useConsoleActionRuntime.tsx), and that calls launchConsoleFlow and then judgeFlowLaunch. The refused arm answers { success: true, silent: true, handedOff: true }, the same bytes as the paused arm and with no refusal text. flowDispatch then calls setFlowRefusal, a single state where the last write wins, and that is the one stacked notice. runBulkActionRecord returns Promise of void and throws only when res.success is false. So executeBulkBatch sees a fulfilled promise and counts the row as succeeded. useBulkExecutor never sees the result value, and the refusal sentence never leaves app-shell except through the notice. A fix needs three things: (1) ObjectGrid.tsx runBulkActionRecord reads the refusal and hands it to the executor; (2) a typed way for the refused result to carry its message (ActionResult in @object-ui/types has no member for it, and the refused arm is built in flowResponse.ts, which is read-only under PR #36845; it could instead be set in flowLaunch.ts); (3) a typed signal that tells flowDispatch the caller reports the refusal itself, so a bulk dispatch opens no notice. Today no signal exists: _rowRecord is the key the row-menu (list_item) path attaches too. Nothing here needs ActionRunner.ts.",
      "tests": "none: no diff",
      "gates": "none run: no diff. Worktree objectstack-issue-36915 created at BASE 4f19091997f67617cfdf48b5f7051e7bf86725de, and the empty branch pushed as the landing marker.",
      "dogfood_battery": "n/a: no PR",
      "mcp_calls": "0",
      "api_writes": "1: POST repos/objectstack-ai/objectstack/issues/36915/comments (this report, via post-stamped.mjs). git push of the empty branch is not a REST write.",
      "open_questions": [
        {
          "question": "Widen the claim's file surface so the per-record verdict can reach the executor?",
          "options": [
            "A: add ui/packages/plugin-grid/src/ObjectGrid.tsx and ui/packages/types/src/ui-action.ts. One optional ActionResult member carries the refusal message (set on the refused arm in flowLaunch.ts, or in judgeFlowLaunch once #36845 lands). One typed bulk-dispatch signal goes on the action or the ActionContext. A refused row becomes a third category in BulkResult (a refused count plus per-row messages); the dialog prints succeeded and refused apart; retry is not offered for a refused row; the notice is skipped only on a bulk dispatch. Cost: a widening of the published @object-ui/types; the changeset lists @object-ui/types, @object-ui/plugin-grid and @object-ui/app-shell; size S becomes M.",
            "B: add ObjectGrid.tsx only. The refusal travels through an untyped reserved param (in the style of _rowRecord) plus data. No types change, but it adds an untyped cross-package hand-off key, which ui/AGENTS.md #0.1 asks to type on a hand-off type.",
            "C: stay inside the surface. A refused row is reported as a failed row carrying its refusal text, and a bulk dispatch is detected by the muted toast flag ObjectGrid passes. It is not reported apart, retry offers to re-run it, and behaviour becomes coupled to a toast flag."
          ],
          "recommendation": "A, because it alone meets the card's 'reported apart' and the dispatch's no-stacked-notice choice with typed seams. The dispatch carried no decision axes; if this goes to a needs_decision card, the axes must be supplied first."
        }
      ],
      "security_findings": "none",
      "out_of_scope_findings": [
        "carrier: 36915 (same family, fold into this card's scope decision): read from code only, not reproduced. A per-record bulk flow whose run pauses at a screen takes the same path: the judgeFlowLaunch paused arm is success, so the row counts as succeeded, and flowDispatch calls setScreenFlow once per row, so the last write wins. Noted, not filed."
      ]
    }
  7. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#3 · os-support-ai · session_01WGufzhoBbwh8URjwQHde8v

    Claim amendment · 2026-11-24T09:46Z · seat route A on this card's surface, after the dev's reading (report 7127788380). The verdict is lost in ObjectGrid.tsx runBulkActionRecord: it throws only on success: false, and the refused arm of judgeFlowLaunch answers { success: true, silent: true, handedOff: true } with no text.
    File surface (amended, replacing the claim's): ui/packages/plugin-grid/src/ObjectGrid.tsx (runBulkActionRecord reads the refusal and hands it to the executor), ui/packages/types/src/ui-action.ts (one optional typed ActionResult member carrying the refusal message, plus one typed bulk-dispatch signal), ui/packages/app-shell/src/utils/flowLaunch.ts (the refused arm sets the member), ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx (a bulk dispatch opens no FlowRefusalNotice; the row menu keeps its own), ui/packages/plugin-grid/src/hooks/useBulkExecutor.ts and ui/packages/plugin-grid/src/components/BulkActionDialog.tsx (refused rows are a third result category, each with its own message, and no retry is offered for them), their tests, the i18n packs if a string is added, and one changeset listing @object-ui/types, @object-ui/plugin-grid and @object-ui/app-shell (plus i18n if touched). flowResponse.ts (open PR #36845) and ActionRunner.ts (open draft PR #36919) stay read-only.
    Container & model: M, effort high, tier default.
    Clause-②: yes (seat ruling: the published @object-ui/types ActionResult gains a member; L1-a owes a lane-keep L2 review)
    Metadata-protocol: none
    Out of scope: the paused-screen sibling (a per-record bulk flow that pauses counts as succeeded, and only the last row's screen opens) went to triage on mailbox #36743, comment 7127841220.

  8. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#3 · os-support-ai · session_01WGufzhoBbwh8URjwQHde8v
    os-dev-report

    {
      "issue": 36915,
      "status": "done",
      "branch": "claude/issue-36915-bulk-flow-refused-count",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36961",
      "session": "session_01WGufzhoBbwh8URjwQHde8v",
      "premise_still_valid": true,
      "summary": "Seat route A. The refused arm of the flow launch now sets ActionResult.refusal = { message } in flowLaunch.ts settled(), the exit both launch doors pass through; flowResponse.ts was not edited. ObjectGrid.tsx runBulkActionRecord dispatches each record through runner.execute(action, { reportsRefusal: true }) and resolves with a typed refusal verdict. useBulkExecutor counts a refused record as a third category, BulkResult.refused with { id, message } in selection order, kept out of succeeded, failed, errors, the error CSV and Retry; a failed row whose retry comes back refused moves to refused. BulkActionDialog reads 'Succeeded 1 / 3 · Refused 2' and lists each refused record with its own sentence. flowDispatch opens FlowRefusalNotice only without reportsRefusal, so the row menu keeps its notice exactly as before. The signal is on ActionContext, not on the action, because an action is authored metadata and ActionContext is a per-dispatch runtime bag. The paused-screen sibling is out of scope (mailbox #36743 comment 7127841220).",
      "tests": "Final head 5f4ae21d567 (origin/main 49c6bf3d513 merged in): pnpm --dir ui exec vitest run over packages/types/, packages/plugin-grid/, packages/i18n/ and 106 consumer files gave Test Files 915 passed (915), Tests 16444 passed, 13 skipped. type-check passed for types, plugin-grid, app-shell and i18n. New pins: the card repro (3 rows, 2 refused, 1 succeeded), a single refused row, the row-menu notice control, no Retry for a refused row, and a retry that comes back refused. Ablations, each through ablation-replace with the restore verified (blob equals HEAD, git diff HEAD empty): A1 the ObjectGrid hand-off went red with 2 failed; A2 the flowLaunch refusal member went red with 4 failed; A3 the reportsRefusal no-notice condition went red with 2 failed while the row-menu control stayed green.",
      "gates": "Local: dispatch-gates --commands at b4cc27b4077 derived 42 families and --ran reconciled 42 of 42. 40 exited 0. check:query-options-erasure and check:type-check-debt hit the local 300 s timeout (exit 124) and are NOT MEASURED locally; CI ran both. check:new-line-citations reported 0 new. CI on 5f4ae21d567, all success: Lint & Repo Gates, TypeScript Type Check, Test Core, Governed Surface Queue Guard, Lint UI, Type Check UI, Test UI (16/16 shards), Build & E2E UI, Live E2E UI, Dogfood Regression Gate, Check Changeset. Build Core was skipped by its path selector. PR mergeable_state is clean.",
      "dogfood_battery": "n/a: no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "3 relay writes: POST issues/36915/comments (round-1 report, comment 7127788380); pr_create, POST pulls plus POST issues/36961/assignees; POST issues/36915/comments (this report). git pushes are not REST writes.",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": ["carrier: mailbox #36743 comment 7127841220 · the paused-screen sibling, routed by the seat; named in the PR body as out of scope"]
    }
  9. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#3 · os-support-ai · session_01WGufzhoBbwh8URjwQHde8v

    Claim amendment · 2026-11-24T11:53Z · L1 REWORK 7130654394 S-1 on PR #36961: the published jsdoc of ActionContext.reportsRefusal says a handler that sees the flag opens no notice, and the record page's own ActionProvider (RecordDetailView.tsx, ~2329) still calls setFlowRefusal on every refusal. This is the route L1-a prefers; the alternative was to narrow the jsdoc. The file surface gains ui/packages/app-shell/src/views/RecordDetailView.tsx: the same context?.reportsRefusal !== true guard, with a pin for the flag and a control without it. No open PR touches that file (sweep at 11:5xZ). Clause-②: yes and the rest of amendment 7127866157 stand.

  10. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#3 · os-support-ai · session_01WGufzhoBbwh8URjwQHde8v
    os-dev-report

    Round 3 delta on PR #36961 (L1 REWORK 7130654394, S-1; surface amendment 7130688471).

    {
      "issue": 36915,
      "status": "done",
      "branch": "claude/issue-36915-bulk-flow-refused-count",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/36961",
      "session": "session_01WGufzhoBbwh8URjwQHde8v",
      "premise_still_valid": true,
      "summary": "S-1 fixed. RecordDetailView's own flow handler now takes the runner context and opens FlowRefusalNotice only when context?.reportsRefusal !== true, the same guard as useConsoleActionRuntime. A list embedded on a record page, running a per-record bulk flow, therefore stacks no notice either. A grep of setFlowRefusal, FlowRefusalNotice and launchConsoleFlow under ui/ finds no other place that opens the notice: those two handlers are the only ones, and both are guarded now. Nits N-1, N-2 and N-3 were left as the seat said; N-2 now has one sentence in Acceptance notes. origin/main 02127147117 merged in. The PR body was patched through the relay (issue_patch) for the new file, the pins, ablation A4, the Tests line and the N-2 sentence; the footer order is kept, with the signed trailer last.",
      "tests": "Head cad0a54043c: pnpm --dir ui exec vitest run over the 9 RecordDetailView flow and runtime suites, useConsoleActionRuntime.refusedLaunch-9973, objectBulkActionDispatch and useBulkExecutor gave Test Files 12 passed (12), Tests 131 passed. app-shell type-check exit 0 after rebuilding the app-shell closure. New pins in RecordDetailView.refusedLaunch-9973: with the flag, no dialog and the result carries the refusal; control, without the flag the notice opens. Ablation A4 through ablation-replace removed the RecordDetailView guard: 1 failed (the flag pin) and 5 passed, the control among them; restored with blob equal to HEAD and git diff HEAD empty.",
      "gates": "dispatch-gates --commands on the new head derives the same 42 families as round 2. Re-run locally, all exit 0: check:nul-bytes, check:cross-package-test-inputs, check-changeset-no-major, check-empty-changeset, check-adr-0087-registration; check:new-line-citations reported 0 new. CI on cad0a54043c: 47 success, 15 skipped, 0 failed, among them Lint & Repo Gates, TypeScript Type Check, Test Core, Governed Surface Queue Guard, Lint UI, Type Check UI, Test UI, Build & E2E UI, Live E2E UI, Dogfood Regression Gate and Check Changeset. Build Core was skipped by its path selector. mergeable_state is clean.",
      "dogfood_battery": "n/a: no ! in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "round 3: 2 relay writes, issue_patch on #36961 (PR body) and POST issues/36915/comments (this report)",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": []
    }
  11. objectstack-fleet commented on Nov 24, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#3 · os-support-ai · session_01WGufzhoBbwh8URjwQHde8v

    Close-out · 2026-11-24T12:57Z · area ux-B: PR #36961 merged at 2026-11-24T12:56Z (merge commit 57445a699810a0545d8b3a7649a77327d47fb18b; L1 delta ACCEPT 7131475458, contract review PASS 7130631135 with delta PASS 7131463454), and this card closed as completed. pm:dispatched is removed.

    A per-record bulk flow run that the flow refused is now reported as refused, each with its own message, and never counted as succeeded. No refusal notice stacks on the result, on a list page or on a record page. A single run from the row menu still opens its notice. The paused-screen sibling went to triage (mailbox #36743, comment 7127841220).

  12. removed
    pm:dispatched
    on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxbugdomain:uipriority:p1

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions