Skip to content

feat(console): a refusal that names several reasons lists every one in its alert box - #37538

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-37403-refusal-lines-list
Nov 26, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/issue-37403-refusal-lines-list

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #37403

Clause-②: yes (widening)
Metadata-protocol: none

The widening: @object-ui/types adds the export ActionRefusalLine and the optional member ActionResult.refusals, and @object-ui/core adds the optional member ActionResponseOutcome.refusals. Nothing is narrowed; every package ships patch.

维护者速读

  • 用户能看到什么变化:在控制台的操作弹窗里,一次拒绝带多条原因时,红色提示框逐行列出每一条原因,最后一行是总结句;不再只显示第一句、其余藏在「更多」里。只有一句的拒绝照旧显示。
  • 为什么做:接服务端「一次拒绝给出多条已翻译原因」那张卡(多原因拒绝),让批量提交被整体拒绝的用户一眼看到每一条为什么不行。
  • 出错会怎样:只影响带多条原因的拒绝提示;最坏是提示框少显示总结句,原因本身仍全部列出;可直接撤回本改动,恢复成「首句 + 更多」。
  • 要你做什么:无。

What changes

Ruling on #36877, term (6), verbatim: "Console: a ui follow-up card under this one renders a multi-line userMessage as a list in the alert box."

  • The carrier. The /actions door answers a multi-reason refusal's sentences on error.details.refusals: [{ reason, message }] (PR feat(refusals)!: one refusal names several declared reasons, each in the person's language #37395), but the console dropped details before the refusal box: interpretActionResponse read only fields and userMessage, and ActionResult had no member for the list. Now refusalLines (ui/packages/core/src/actions/actionResponse.ts) reads the list whole or not at all, by the element rule of the server's reader (declaredRefusalLines): a non-empty list, every element { reason: string, message: string }. It does not re-check that reader's userMessage condition, because it reads only what the server answered. createServerActionHandler relays it on the new ActionResult.refusals (ui/packages/types/src/ui-action.ts, element type ActionRefusalLine), next to userMessage.
  • The dialog. ActionParamDialog keeps the refused run's refusals with its text and passes them to RefusalMessage as lines.
  • The box. With lines, RefusalMessage renders one list: every listed reason in order, then the refusal's closing sentence, and no "More" toggle. Following the zone note on the card (7181225232), the reasons come from details.refusals and are never split out of the text. The closing sentence is not on that list. The server sends it only as the last line of the text, after the reasons joined by line breaks, so it is read from there, and only when the text still starts with exactly those reasons. If the text was cut inside the reasons (the /data door cuts userMessage at 500 characters), every reason is still shown and the closing sentence is left out. Without lines, or with an empty list, the component behaves as before.

Read first, by risk:

  1. ui/packages/app-shell/src/components/RefusalMessage.tsx: refusalListItems, which picks the closing sentence.
  2. ui/packages/core/src/actions/actionResponse.ts: refusalLines, the shape reader.
  3. ui/packages/app-shell/src/views/ActionParamDialog.tsx: the refusalLines state set next to refusal.

Two-minute check: pnpm --dir ui exec vitest run packages/app-shell/src/components/RefusalMessage.test.tsx. Expect the new (objectstack#37403) describe to pass: three list items in order (two reasons, then "Nothing was submitted."), no refusal-more.

Tests

  • RefusalMessage.test.tsx: a new top-level describe. Multi-reason (every line in order, closing line last, one list, no More). Text cut inside the reasons (both reasons shown from the list, no closing line). CONTROL: a single-sentence refusal with no list renders as text alone. CONTROL: an empty list is no list.
  • ActionParamDialog.refusalKeepsInput-13161.test.tsx: a new top-level describe. A refused run with refusals lists them in the action-param-refusal alert box.
  • ui/packages/core/src/actions/__tests__/actionResponse.test.ts: details.refusals carried in order and copied to reason/message. CONTROL: an absent list, an empty list, a malformed element or a non-list carries none.
  • ui/packages/core/src/actions/__tests__/serverActionHandler.test.ts: the handler relays refusals beside error and userMessage.
  • The fixture sentences match the /actions door answer pinned on the server side in action-refusal-catalogue.test.ts (the [#36877] an action's reasons list describe), in English.
Ablation (one, on the list branch)

node scripts/ablation-replace.mjs on RefusalMessage.tsx, anchor if (!lines || lines.length === 0) return null; replaced by if (/* ABLATED_37403 */ true) return null; (anchor 1 to 0, blob 10d87495 to 81dba40e): 3 failed / 21 passed. The three failures are the multi-reason case, the cut-text case and the dialog case. The controls stay green. Restored: blob equals HEAD (10d87495), git diff HEAD empty. The tests import the component from src/, so no rebuild was needed.

Acceptance notes

  • Reach: today the console renders RefusalMessage for an action refusal only in the param dialog. An action without params reports its refusal as a toast, which shows userMessage (the joined lines) and is not part of this card. The /data door (record save) does not reach RefusalMessage.
  • A closing line that the 500-character cut lands inside, after all the reasons, is shown as the cut text ends, with its ellipsis. The console cannot tell a cut closing line from one that ends in an ellipsis without knowing the server's bound. The /actions door, the only door that reaches this box, does not cut.
  • The card's pins live in the existing harness files as top-level describes (AGENTS.md, ruling record 6583487846), not in a new file named for the card as the claim's file surface said.

Verification

Rework round 1 (head e0d4fddd36, changeset and jsdoc only): the changeset declares Clause-②: yes (widening) and names ActionResponseOutcome.refusals in its "New:" bullet. The refusalLines jsdoc now says it applies the element rule of the server's declaredRefusalLines and does not re-check that rule's userMessage condition. Local: check-adr-0087-registration --base origin/main, check-changeset-no-major --base origin/main, check-empty-changeset --base origin/main, check:changeset-gate-self-tests, check:nul-bytes and check:closed-ceremony-text all exit 0. actionResponse.test.ts: Test Files 1 passed, Tests 12 passed. The readings below are from head 7556f528a1; that round's source is unchanged here.

Readings at head 7556f528a1 (after merging origin/main), under the verify lock:

Type-check and tests (local)
  • pnpm --filter @object-ui/types --filter @object-ui/core build: exit 0.
  • type-check for @object-ui/types, @object-ui/core and @object-ui/app-shell: each exit 0.
  • pnpm --dir ui exec vitest run --maxWorkers=2 packages/types/ packages/core/ packages/app-shell/src/components/RefusalMessage packages/app-shell/src/views/ActionParamDialog packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime: Test Files 687 passed (687), Tests 15780 passed, 27 skipped. Exit 0.
  • Declared narrowing: the whole @object-ui/app-shell suite was started but stopped after about 30 minutes holding the shared lock, so only the app-shell files around the refusal box ran locally. CI's Test UI runs the rest.
Derived gates (local)

node scripts/pm/dispatch-gates.mjs --commands derived 39 families. 38 ran locally, each exit 0 (check:type-check-debt re-run once it got the lock: 0 raw tsc error(s) total). --ran reconciliation: 39 derived, 38 run, 1 UNRUN. The UNRUN family is pnpm --dir ui exec vitest run scripts/: it timed out locally behind a sibling's lock, and CI's Test UI carries it. node scripts/pm/overlap-check.mjs --branch=HEAD: clean, merges cleanly into origin/main.


Generated by Claude Code

…n its alert box

The /actions door answers each reason's sentence on error.details.refusals.
The core response reader and the server action handler carry the list on
ActionResult.refusals, the param dialog hands it to RefusalMessage, and
RefusalMessage lists every reason in order, then the closing sentence read
from the text, with no More toggle. A refusal without a list renders as before.

Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 7556f52 · 2026-11-26T11:55Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: TIER_DEFAULT
Head-sha: 7556f528a1f8cd259a3b8047ad774312d6e7ab4c
Local-runs: none

Inputs: card #37403 (body and all 7 comments, including claim 7188742050, os-dev-report 7191297031 and claim amendment 7191329678), PR #37538 body, the net diff origin/main...7556f528a1 (11 files, +255/-3), and the 58 check-runs on the head: 45 success, 13 skipped, 0 failure. Test UI 16/16, Type Check UI, Lint UI, Build & E2E UI, Live E2E UI, Check Changeset and Governed Surface Queue Guard are all success.

① Derived judgments

  • Wire shape matches main. Right. On main, declaredAnswer (packages/runtime/src/sandbox/hook-refusal-catalogue.ts) builds refusals: [{ reason, message }] and the text [...reasons, closing].join('\n'). That text is set as both innerMessage and userMessage. resolveThrownHttpError (packages/types/src/thrown-http-error.ts) puts the list on details.refusals through declaredRefusalLines, and the /data rider withDeclaredRefusalLines does the same. The server pin (action-refusal-catalogue.test.ts, [#36877] describe) reads response.body.error.details.refusals and response.body.error.userMessage. The client refusalLines reads body.error.details.refusals, with the same reason/message names and the same body (innerFailed ? envelope : json) that refusalUserMessage reads. The names and the path agree.
  • Whole-or-nothing read. Right. refusalLines returns undefined for a non-array, an empty array, or any element that is null, not an object, or lacks a string reason or message. It copies each element to exactly those two members. A null or non-object details is handled by ?.. On undefined, the handler, the dialog and the component all take the old path (lead plus More), and that path is pinned by the CONTROL cases in actionResponse.test.ts and RefusalMessage.test.tsx.
  • Relay. Right. createServerActionHandler spreads refusals only when it is present, next to userMessage. Pinned with toEqual, so no extra member can leak through.
  • Dialog prop. Right. refusalText(result) reads result.error, which actionErrorDetail takes from error.message. On the /actions door, error.message is the sandbox business message, the same joined text as userMessage, so the startsWith test holds there. setRefusalLines is called only in the same update that sets refusal, which is the only place refusal becomes non-null, so a stale list can never sit beside a new text. The list is not cleared on reopen, but the box is hidden while refusal is null.
  • Closing-line rule. Right. refusalListItems shows the closing line only when text.startsWith(reasons.join('\n') + '\n'), and the remainder after trim() is not empty. A text cut inside the reasons fails the prefix test, so every reason is shown and the closing line is dropped (pinned). A cut that falls inside the closing line shows that line cut, with its ellipsis, and the PR's Acceptance notes declare this. See N3 for the one edge case.
  • Public surface. @object-ui/types (published) gains the export ActionRefusalLine and the optional member ActionResult.refusals. @object-ui/core (published) gains the optional member ActionResponseOutcome.refusals, which is public through actions/index.ts. refusalLines stays off core's entry point, as the dev report says. @object-ui/app-shell is private: true, and RefusalMessage gains an optional lines prop. All of these are additive and optional, and nothing is narrowed.

② Semver level

  • Levels are right. @object-ui/types, @object-ui/core and @object-ui/app-shell each take patch, and Metadata-protocol: none is right because no authorable key changes. AGENTS.md Post-Task Checklist item 3 says a change with none and no protocol change ships patch, whether it widens or not. Check Changeset is success.
  • S1 (should-fix): the Clause-②: line is wrong. The changeset body and the PR body both still say Clause-②: no. The diff adds a public export and a public member to published @object-ui/types, and a public member to @object-ui/core. That is a widening of a published contract (ADR-0150: "changes a published contract (spec, protocol, SDK, …)"). It matches the seat's S7 ruling on PR fix(kanban): a list view board laned by a lookup counts and totals each whole lane, and draws a lane past the first page #37511 (7191238306) and the claim amendment 7191329678. Both lines should read Clause-②: yes (widening), naming @object-ui/types ActionRefusalLine and ActionResult.refusals, and @object-ui/core ActionResponseOutcome.refusals. The level stays patch.
  • N1 (nit): the changeset's "New:" bullet names ActionResult.refusals but not ActionResponseOutcome.refusals, which ships in core's public types too.

③ Boundary flags

  • open_questions[0] (should Clause-② be yes (widening)?): answered, B. See S1. This needs a changeset commit as well as the PR body edit, because the changeset line is in the committed tree.
  • Deviation, file surface widened to the carrier chain: accepted. Claim amendment 7191329678 names the files, and each one is a step in the chain the card needs (details was dropped in interpretActionResponse). No fenced path is touched.
  • Deviation, no new pin file named for the card: accepted. The pins are top-level describes in the existing harness files, under the AGENTS.md ruling the dev cites.
  • Deviation, local app-shell run narrowed: answered by CI. Test UI is 16/16 success on this head.
  • Out of scope, toast path for actions without params: agreed. The card names only the alert box, and the PR's Acceptance notes record it.
  • N2 (nit): the refusalLines jsdoc says it reads by "the same rule the server's own reader applies". declaredRefusalLines also requires a declared userMessage. This has no effect, because the client reads only what the server answered, but the sentence overstates.
  • N3 (nit): if a /data cut (499 characters plus …) lands exactly after the last reason's line break, the remainder is a bare …, and it becomes a list item. This has no effect today, because the PR's Acceptance notes state that the /data door does not reach RefusalMessage.
  • SQL push-down: not applicable. The change is UI only, with no new id materialisation or in-app join.

Implemented-by: claude/issue-37403-refusal-lines-list
Reviewed-by: contract-reviewer session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: 7556f528a1f8cd259a3b8047ad774312d6e7ab4c
REWORK — L1, seat repo:objectstack#5

  1. Shape: open draft against main, Fixes #37403. 11 files, +255/−3, not governed. No review face, so the declaration face applies at TIER_DEFAULT. Claim amendment 7191329678 brings the carrier chain into scope (dispatch A2).
  2. Premise: the alert box lists each refusal reason in order, then the closing sentence. The list is read whole or not at all from details.refusals, and the field names match what the server builds on main. A malformed or empty list falls back to today's box.
  3. Gates: contract record 7191427569 reads PASS, with one should-fix. CI on this head: 45 success, 13 skipped, 0 failed.
  4. Owed for the delta (changeset and PR body only):
    • S1: Clause-②: yes (widening) in both the changeset and the PR body, naming @object-ui/types ActionRefusalLine and ActionResult.refusals, and @object-ui/core ActionResponseOutcome.refusals. The level stays patch and Metadata-protocol: none stands.
    • N1: add ActionResponseOutcome.refusals to the changeset's "New:" bullet (same edit).
    • N2: the refusalLines jsdoc says it uses "the same rule" as the server's declaredRefusalLines, but the server also requires a userMessage. Reword it if cheap.
    • N3 (a bare … closing line on a /data text cut right after the last reason) is an accepted deviation: that path does not reach this box today.
  5. Out of scope and where it went: a param-less action refusal still shows as a toast with the joined lines. This is outside the card's alert-box scope and is accepted as not filed.
  6. Next: push, then knock. The delta reads S1 alone. After ACCEPT, Bill names it on a card for landing.

…e.refusals

The changeset now reads Clause-②: yes (widening): @object-ui/types gains
ActionRefusalLine and ActionResult.refusals, and @object-ui/core gains
ActionResponseOutcome.refusals. All three packages still ship patch. The
refusalLines jsdoc now says it applies the element rule of the server's
reader, and that it does not re-check the server's userMessage condition.

Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head e0d4fdd · 2026-11-26T12:51Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: TIER_DEFAULT
Head-sha: e0d4fddd365912b82a093961e0924292fb06b355
Local-runs: none

Delta round 1 against record 7191427569 (head 7556f528a1, PASS, S1 open) and the seat's REWORK 7191443129. This round read:

  • The delta 7556f528a1..e0d4fddd36. It is a fast-forward that touches 2 files: the changeset (+3/−2) and a jsdoc-only edit in ui/packages/core/src/actions/actionResponse.ts.
  • The current PR body.
  • The os-dev report 7192513924.
  • The 62 check-runs on the new head: 47 success, 15 skipped, 0 failure. Check Changeset, PR-body guards, Test UI, Type Check UI, Lint & Repo Gates, TypeScript Type Check and Governed Surface Queue Guard are all success.

① Derived judgments

  • No code changed. The only change in actionResponse.ts is inside the refusalLines jsdoc, so every judgment in 7191427569 still holds: the wire names match main, the whole-or-nothing read and its fallback are correct, the closing-line rule is correct, and so are the relay and the dialog prop.
  • The public surface is unchanged from the last round. @object-ui/types adds ActionRefusalLine and ActionResult.refusals. @object-ui/core adds ActionResponseOutcome.refusals. All of these are additive and optional.

② Semver level

  • S1: closed. The changeset body and the PR body now both have the bare line Clause-②: yes (widening). Right after it, a sentence names @object-ui/types ActionRefusalLine and ActionResult.refusals, and @object-ui/core ActionResponseOutcome.refusals. Keeping the line bare and putting the names in the next sentence is fine, because the line readers see the canonical shape. Check Changeset is green on this head.
  • N1: closed. The "New:" bullet now names ActionResponseOutcome.refusals (@object-ui/core).
  • The levels are unchanged and still right. @object-ui/types, @object-ui/core and @object-ui/app-shell each ship patch, with Metadata-protocol: none.

③ Boundary flags

  • N2: closed. The jsdoc now says that refusalLines applies the element rule of declaredRefusalLines, and that it does not re-check that reader's userMessage condition. The PR body's "What changes" sentence says the same.
  • N3: accepted by the seat (7191443129) and left as it was.
  • open_questions: none this round. The one deviation is the bare Clause-② line with the names on the next sentence, and it is accepted under S1 above.
  • SQL push-down: not applicable. The change is UI only, and this round changes only prose.

Implemented-by: claude/issue-37403-refusal-lines-list
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: e0d4fddd365912b82a093961e0924292fb06b355
ACCEPT — L1, seat repo:objectstack#5

  1. Shape: open draft against main, Fixes #37403. Not governed, no narrowing. Clause-②: yes (widening) names @object-ui/types ActionRefusalLine and ActionResult.refusals, and @object-ui/core ActionResponseOutcome.refusals. Metadata-protocol: none, all three packages at patch. Claim amendment 7191329678 brings the carrier chain into the fence (dispatch A2). No review face, so the declaration face applies at TIER_DEFAULT.
  2. Premise: the refusal alert box lists each reason in order, then the closing sentence. The list is read whole or not at all from details.refusals, with the server's field names on main. A malformed or empty list falls back to today's box.
  3. Gates: delta record 7192595998 (same reviewer) reads PASS. S1, N1 and N2 are closed. CI on this head: 47 success, 15 skipped, 0 failed, with Check Changeset green after the body edit.
  4. Accepted deviations: N3 (a bare … closing line on a /data text cut right after the last reason; that path does not reach this box today).
  5. Out of scope and where it went: a param-less action refusal stays a toast showing the joined lines. It is outside the card's alert-box scope.
  6. Landing terms: ungoverned, default tier. The seat lands it with --land once the maintainer names it, because area o5-U cannot run --land.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Probe Reading
check-governed-merges --pr 37538 NOT governed. No narrowing declared (Clause-②: yes (widening), Metadata-protocol: none)
landing-k --pr 37538 K = 12 first-parent commits on main since the merge base (< 15), measured by hand where the tool could not answer
pr-state --pr 37538 at e0d4fddd36 all checks green, 0 failed, 0 pending
os-regen paths in diff none (git check-attr reads no os-regen)

Landing on seat ACCEPT 7192606088, which sits on the same-head delta PASS 7192595998. The maintainer named this PR on the seat thread's decision card: 「合并 #37538」 on 「合并已 ACCEPT 的非受管 PR #37538(操作被拒时逐条列出原因)吗?」, at 12:56Z. Action: ready + auto-merge. Closes #37403 on merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 26, 2026 12:57
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit c385d3b Nov 26, 2026
63 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-37403-refusal-lines-list branch November 26, 2026 13:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

控制台:一次拒绝带多条原因时,提示框逐行列出全部原因(接 #36877)

2 participants