Skip to content

记录 AI 问询 6:「问 AI」动作类型 ask_ai(spec 与控制台执行器同一 PR) #37142

Description

@objectstack-fleet

repo:cloud#1 · os-warren · session_01JQwxbZSA7o5vcLjQjM1myV

Filing gate: ③ maintainer-directed. Source: topic #36996. Key words (maintainer, 2026-11-24 19:17Z, handing the epic to this seat): 「36996 你接手整个专题的任务,现在就开专区派发」.
Grading: area:cloud (the epic routes children 3, 4 and 6 there: they serve only editions with the in-app assistant) · Feature · p2 (topic child at the epic's level) · reach: n/a (new capability) · evidence: read.

维护者速读

  • 做什么:动作类型新增 ask_ai。应用作者在记录页放一个「问 AI」按钮,用户点了以后助手展开,并钉在这条记录上。它和对话焦点的钉选按钮走同一个入口,不发消息,也不调服务端。
  • 谁受益:有应用内助手的版本的最终用户。作者不写脚本就能放「问这个客户」「问这份制度」按钮。
  • 不做会怎样:专题的完成条件(记录页上有 ask_ai 动作)达不到。开源版没有应用内助手,按钮不出现。
  • 需要你做的:无。

What

Implements ADR-0160 D7:

  1. packages/spec/src/ui/action.zod.ts#ActionType gains ask_ai. It sits outside TARGET_REQUIRED_TYPES. A target on it is refused at parse, and so is ai.exposed: true.
  2. Console executor in ui/packages/core/src/actions/ActionRunner.ts, whose table is typed over RunnableActionType. It calls the focus setter from conversation focus: a pinned record in the chat request, shown as a chip, kept across navigation #36999 with the record and expands the assistant. It sends no message and makes no server call.
  3. Server: packages/runtime/src/action-execution.ts#isHeadlessInvokableAction does not admit it. So list_actions and run_action do not serve it, and no action_ tool materialises.
  4. The action is drawn only when the assistant surface is on (useAiSurfaceEnabled) and the AI service advertises focus (conversation focus: a pinned record in the chat request, shown as a chip, kept across navigation #36999's capability flag). Otherwise it is absent, not disabled.

Acceptance

  • The spec member and the console executor land in one PR. Metadata-protocol: added, with its Skills-docs: line.
  • Tests:
    • parse refusals (target, ai.exposed: true);
    • the headless refusal;
    • the action is absent without the surface or the flag;
    • a click sets the focus and opens the assistant, and sends nothing.
  • An ask_ai action where there is no single record (list_toolbar, multi-select) is absent.

Note (added 2026-11-25)

Added by the maintainer's session (maintainer · os-bob · session_012dn2AecKpLaYkUtNRiqtby) after an independent Fable review of rows 5–10, which the maintainer accepted: 「同意你的建议」.

  • D7 makes ask_ai an action on one record. The acceptance line about list_toolbar and multi-select was added for that reason.
  • The button stays invisible in the product until objectstack-ai/cloud#4978 (row 9a) advertises the focus capability. This card is verified by tests, not in the running product. That is by design, not a defect.

Blocked-by: #36999

Parent: #36996 (row 6). Reader: the epic's owning seat (repo:cloud#1), which dispatches it when #36999 merges.
Dedupe (objectstack, is:issue, open and closed): "ask_ai" 4 (#36996 epic, #36997 ADR, #36998 and #36999 siblings, no overlap) · "ActionType" ask 38 (closed page-action-row work, unrelated).

Activity

  1. added
    priority:p2
    pm:blocked
    on Nov 24, 2026
  2. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor
  3. added
    pm:queue
    and removed
    pm:blocked
    on Nov 25, 2026
  4. objectstack-fleet commented on Nov 25, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:cloud#1 · os-warren · session_01JQwxbZNHwt6dj15KeoAPMP

    Claim: PM loop round 1 (epic #36996 owner seat, card thread)
    Session: session_01JQwxbZNHwt6dj15KeoAPMP
    Thread session: session_01JQwxbZNHwt6dj15KeoAPMP
    Account: os-warren
    Branch: claude/project-thread-1nmo7q
    Worktree: objectstack (the card thread's own checkout)
    Domain: domain:spec + domain:ui + domain:server (ADR-0160 implementation split, row 6: "spec + ui"; the server half is one message in headlessActionTypeError; no domain:* label on the card yet)
    Seat: repo:cloud#1
    File surface: packages/spec/src/ui/action.zod.ts (+ its tests, generated schema/surface baselines the build owes), packages/runtime/src/action-execution.ts (headlessActionTypeError wording + test), ui/packages/types/** (the runnable-type union, if a pin moves), ui/packages/core/src/actions/** (ask_ai executor + ActionEngine presence filter), ui/packages/react/src/context/ActionContext.tsx + ui/packages/react/src/hooks/** (the assistant hand-off prop and the presence gate), ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx + ui/packages/app-shell/src/console/ConsoleShell.tsx (the console's hand-off: setChatFocus + open the drawer), the action-drawing surfaces that already gate on isActionSwitchedOff (ui/packages/components/src/renderers/**, ui/packages/plugin-grid/src/**, ui/packages/plugin-detail/src/RelatedList.tsx, ui/packages/app-shell/src/views/DeclaredActionsBar.tsx), Studio action-type pickers if their pins iterate ActionType.options, changesets
    Container & model: L, mode:thread, model: default (dispatch-gates --repo objectstack-ai/objectstack --tier at 95734fef: "no path-derived mandate … floor sonnet · default opus · ceiling fable"; Clause ② SUSPECT on packages/spec/src/** → contract review owed at CONTRACT_REVIEW_TIER), effort: high
    Clause-②: yes
    Metadata-protocol: added
    Responsibility: n/a — not a defect card
    Thread-read: 7149736821
    Premise: holds (origin/main 95734fe: ActionType is ['script','url','modal','flow','api','form'] at packages/spec/src/ui/action.zod.ts:693; ask_ai appears only in comments at ui/packages/app-shell/src/layout/chatFocus.ts and ui/packages/app-shell/src/index.ts; isHeadlessInvokableAction already answers false for an unknown type at packages/runtime/src/action-execution.ts:1363; setChatFocus exported from @object-ui/app-shell by #36999 at 06c1f54)
    Serial constraints cleared: none — #37140 (row 5, draft PR #37173) touches packages/spec/src/ai/**, kernel, mcp, a new service package: disjoint from this surface

    Rulings carried: ADR-0160 D7 (merged 32c197e): ask_ai joins script outside TARGET_REQUIRED_TYPES; a target and ai.exposed: true are refused at parse; no server dispatch; the console executor calls the D6 setter and expands the assistant, sends no message and makes no server call; absent (not disabled) unless the assistant surface is on and the AI service advertises focus. The ActionType docblock's #14092 note ("a member added here stops the console compiling until an executor exists") is met by D7's one-PR rule, not overturned. L1 review: objectstack seat (repo:objectstack#1). L2 contract review owed (Clause-②: yes) at the contract-review tier.

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

    @objectstack-fleet
    ContributorAuthor

    repo:cloud#1 · os-warren · session_01JQwxbZNHwt6dj15KeoAPMP
    os-dev-report · 2026-11-25T04:08Z

    {
      "issue": 37142,
      "status": "done",
      "branch": "claude/project-thread-1nmo7q",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/37215",
      "session": "session_01JQwxbZNHwt6dj15KeoAPMP",
      "premise_still_valid": true,
      "summary": "ActionType gains ask_ai (no target; target and ai.exposed: true refused at parse; a dashboard header refuses it). The runtime gives it no server dispatch (not headless-invokable; REST door sentence about the in-app assistant). The console ActionRunner hands { object, id } to a host-installed AssistantFocusHandler, which app-shell sets to setChatFocus + dock.open() only when the chat drawer is hosted and an agent advertises capabilities.focus; every action surface leaves ask_ai out (useDrawsAction) when no handler is installed.",
      "tests": "@objectstack/spec full suite 892 files / 28329 pass; runtime ask_ai headless 4 pass; @object-ui/core 4789, react 1601, components 4966, plugin-grid 2783, plugin-detail 3941 pass; app-shell hooks/console/metadata-admin/studio-design/DeclaredActionsBar pass after two pin fixes (36 + 44 re-run pass); type-check exit 0 on runtime and the six ui packages. Ablation: removing the DeclaredActionsBar drawsAction filter turns its ask_ai test red (1 failed), restored, git diff empty.",
      "gates": "dispatch-gates --commands at 076ed686: 131 commands, each exit captured before any pipe; all exit 0 except not-measured prerequisites: check-plugin-teardown-shape --self-test (shallow clone) and check:dual-build-cjs-loads (dists of unrelated packages absent). Found and fixed locally: check:skill-identifier-liveness (Action Types row added) and check:test-source-alias (module-top imports). CI check-runs on the PR are the authority.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "4 — POST /repos/objectstack-ai/objectstack/pulls; POST /issues/37215/assignees; POST /pulls/37215/requested_reviewers (422, author); this comment",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": ["Studio's action inspector Type picker does not offer ask_ai (hand-written option list) · noted in PR Acceptance notes, not filed", "skills/objectstack-ai/SKILL.md does not yet say ask_ai can never be an AI tool · Skills-docs follow-up owed"]
    }

    Generated by Claude Code

  7. removed
    pm:dispatched
    on Nov 25, 2026
  8. added 2 commits that reference this issue on Dec 1, 2026
    b7dee0e
    1f939b1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:cloudpriority:p2

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions