Repository navigation
Description
What happens
An action with type: 'ask_ai' (ADR-0160 D7) placed on record_header / record_more is never drawn on a record page — not inline, not in the ⋯ menu — even where every gate ADR-0160 D7 names is open.
Seen on a deployed console (ObjectStack 19.0.0-next.0, console build 1dbf19a1):
- the AI drawer is up (the assistant icon is in the header);
GET /api/v1/ai/agentsanswers{"name":"ask", …, "capabilities":{…,"focus":true}};- the app's object declares
{ name: 'brightrule_policy_ask', type: 'ask_ai', locations: ['record_header', 'list_item'] }, and the action is in the installed metadata; - the record header shows only 编辑 and ⋯ (刷新 / 分享 / 更改负责人 / 删除).
Cause
useAskAiHandler() is wired once, in useConsoleActionRuntime → GlobalActionRuntimeProvider (ConsoleShell.tsx), as onAskAi on the shell's <ActionProvider>. RecordDetailView mounts its own <ActionProvider> (ui/packages/app-shell/src/views/RecordDetailView.tsx, around line 6413), which shadows the shell's for every action on the record page and does not pass onAskAi. ActionContext does not fall back to a parent's handler (hasAskAi = onAskAi !== undefined), so under the record page the runner answers "no handler" and the action is absent. Still the case on main (44ccf94).
Proposed fix
Hand the record page's provider the same handler, as it already does for confirm / toast / navigate / param collection:
import { useActionModal } from '../hooks/useActionModal.js';
+import { useAskAiHandler } from '../hooks/useAskAiHandler.js';
…
const { modalHandler, modalElement, resolveModalTarget } = useActionModal(dataSource);
+ const askAiHandler = useAskAiHandler();
…
onResultDialog={resultDialogHandler}
+ {...(askAiHandler ? { onAskAi: askAiHandler } : {})}
onModal={modalHandler}Checked locally with a test through the real RecordDetailView under a real ChatDockControlProvider (only useAgents stubbed): with a focus-honouring agent the button is drawn and a click calls open({ agent: 'ask', fresh: true }) and setChatFocus({ object, id }, { follow: true }); with no agent declaring focus it stays absent. The first case fails without the change and passes with it. Happy to hand over the test file.
Other providers that shadow the shell's (ObjectView, DeclaredActionsBar) use useConsoleActionRuntime, so they already carry it; RecordDetailView is the one that builds its handler set by hand.
Activity
objectstack-fleet commentedon Nov 27, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Triage: lands in area:ai · domain:ui · Bug · p2 · pm:blocked · size XS; rationale: a configured
ask_aiaction is silently absent on record pages (confirmed onmain:RecordDetailView.tsx:6413builds its ownActionProviderwithoutonAskAi, andActionContext.tsx:173does not inherit it). The header assistant still reaches the record, so this is a user-facing UX defect (p2), not a wrong answer.Paused by the maintainer, verbatim, 2026-11-27T06:12Z: 「37827 暂停」. The fate of
ask_aiis now on decision card #37834 (one entry, default context, preset-question shortcut). This card waits for that ruling. ⛔ Do not claim it before then.Blocked-by: #37834
objectstack-fleet commentedon Nov 27, 2026
epic:#5027#1 · hotlong · session_01Q4EjjMUfmNYTem26rXLFUf
Superseded 2026-11-27T07:26Z. The maintainer ruled on 2026-11-27 to retire the
ask_aiaction type before 19.0 GA (decision #37834, option B; topic #37853). Card #37856 removes the type and closes this card in the same PR, so there is nothing to fix here. ⛔ Do not claim this card for a fix.Blocked-by: #37856
objectstack-fleet commentedon Nov 27, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Re-block · #37827 · 2026-11-27T07:30Z: decision card #37834 was ruled option B, which retires
ask_aibefore 19.0 GA. This card's fix (wireonAskAiintoRecordDetailView) is therefore not to be done. The retirement card #37856 removes the action type and closes this card. Keep it parked until then.Blocked-by: #37856
objectstack-fleet commentedon Nov 27, 2026
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU
Claim: PM loop round 1
Session:
session_01L9qibyUSf2nKJWW6qBemSUThread session:
session_01L9qibzCKZkVMWDVKhZVdRKAccount:
os-teslaBranch:
claude/project-thread-vjrz36Worktree:
objectstack-issue-37827Domain:
uiSeat:
repo:objectstack#3File surface: none of its own: closed by the C1 #37856 PR #37924 (the
ask_aiaction type is retired, so a record page has noask_aiaction left to hide); the surface is C1's claim 7215658608 (stop on breach; explain in the report)Container & model:
L,mode:thread,model: default tier — dispatch-gates.mjs --tier: "no path-derived mandate",effort: highClause-②: no (narrowing)
Metadata-protocol: narrowed
Responsibility: closed by PR #37924 (C1 #37856) as the C1 card says ("#37827 … is closed by this card"); no separate change
Thread-read: 7212541804
Premise: C1 card #37856 body (Dedupe line) and its claim 7215658608
Serial constraints cleared:
overlap-check.mjs runs on the thread's first push (branch not yet pushed); no in-flight claim on these files named by any seatClaimed so that the PR-body guard check:closing-target-claim reads the
Fixes #37827target as claimed by this branch.