The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(setup): each setup card answers only its own call (#130062)
Siddharth Balyana2065efd51b2
diff --git a/agent/message_sanitization.py b/agent/message_sanitization.pyindex 1377f5de8b5..e4551877092 100644--- a/agent/message_sanitization.py+++ b/agent/message_sanitization.py@@ -12,7 +12,7 @@ import jsonimport loggingimport refrom functools import partial-from typing import Any, Callable+from typing import Any, Callable, Iterablefrom agent.message_metadata import DB_ROW_SNAPSHOTfrom agent.vision_message_prep import _provider_model_key@@ -528,16 +528,19 @@ def coalesce_tool_call_id(tc: Any) -> str:return ""-def uniquify_tool_call_ids(tool_calls: list) -> list:- """Ensure every tool call in one assistant turn has a distinct id.+def uniquify_tool_call_ids(tool_calls: list, taken: Iterable[str] = ()) -> list:+ """Ensure every tool call in one assistant turn has an id no other call in the session has.- Some providers reuse one id across a batch; the pre-API sanitizer then keeps only the- first call/result pair per id and strict providers reject duplicates. Later collisions- get a deterministic ``<id>_d<n>`` suffix (never uuid4 — cache-prefix stability). Mutates- entries (SDK models / SimpleNamespace / dicts) in place. Blank ids are left for the- deterministic fallback in ``build_assistant_message``.+ Some providers reuse one id across a batch, and some name every call ``call_0`` turn after+ turn; the pre-API sanitizer then keeps only the first call/result pair per id, strict+ providers reject duplicates, and the desktop binds a tool card to the wrong call. ``taken``+ is the ids already in this session's history: they are never rewritten (prompt cache), so+ the incoming call is renamed instead. Collisions get a deterministic ``<id>_d<n>`` suffix+ (never uuid4 — cache-prefix stability). Mutates entries (SDK models / SimpleNamespace /+ dicts) in place. Blank ids are left for the deterministic fallback in+ ``build_assistant_message``."""- seen: set = set()+ seen: set = set(taken)for tc in tool_calls or []:# Same coalescing rule as coalesce_tool_call_id, tolerant of non-string ids.raw = _tc_field(tc, "call_id") or _tc_field(tc, "id") or ""@@ -564,8 +567,8 @@ def uniquify_tool_call_ids(tool_calls: list) -> list:continue_fn_name = _tc_field(_tc_field(tc, "function"), "name") or "?"logger.warning(- "Model reused tool call id %s within one turn; renamed the duplicate to %s (tool=%s) to keep "- "call/result pairing lossless.", cid, new_id, _fn_name,+ "Model reused tool call id %s; renamed the duplicate to %s (tool=%s) to keep call/result "+ "pairing lossless.", cid, new_id, _fn_name,)return tool_callsdiff --git a/agent/turn_tool_validation.py b/agent/turn_tool_validation.pyindex 27d10e5e52c..7358ea33efa 100644--- a/agent/turn_tool_validation.py+++ b/agent/turn_tool_validation.py@@ -86,8 +86,15 @@ def validate_tool_calls(return ToolValidationVerdict(action=action, result=result, mixed_invalid_batch=_mixed_invalid_batch)# Uniquify duplicate tool-call ids BEFORE any downstream consumer: the- # pre-API sanitizer keeps only the first call/result per id.- agent._uniquify_tool_call_ids(tool_calls)+ # pre-API sanitizer keeps only the first call/result per id, and the desktop+ # binds each tool card to its call id. Some providers name every call+ # "call_0", so an id already used earlier in the session counts as taken.+ taken = {+ coalesce_tool_call_id(tc)+ for msg in messages if msg.get("role") == "assistant"+ for tc in msg.get("tool_calls") or ()+ }+ agent._uniquify_tool_call_ids(tool_calls, taken=taken)# Repair mismatched tool names before validating (model hallucinations).repaired_ids = set()diff --git a/apps/desktop/src/components/assistant-ui/clarify/index.tsx b/apps/desktop/src/components/assistant-ui/clarify/index.tsxindex e6c03afb72f..b49c2e575be 100644--- a/apps/desktop/src/components/assistant-ui/clarify/index.tsx+++ b/apps/desktop/src/components/assistant-ui/clarify/index.tsx@@ -29,7 +29,9 @@ export const ClarifyTool = (props: ToolCallMessagePartProps) => {// The request each tool row asked, remembered past its clearing and past a// remount (a session switch, a stopped turn): a skip or a typed answer settles-// it in the store before (or without) `tool.complete`.+// it in the store before (or without) `tool.complete`. Keyed by session,+// message and call: some providers name every call "call_0", and a bare call id+// would show a later card the answer of an earlier one.const requestIdByToolCall = new Map<string, string>()function ClarifyToolLive(props: ToolCallMessagePartProps) {@@ -43,16 +45,18 @@ function ClarifyToolLive(props: ToolCallMessagePartProps) {const fromArgs = useMemo(() => readClarifyArgs(props.args), [props.args])const setupArgs = useMemo(() => normalizeSetupChoose(parseMaybeObject(props.args)), [props.args])const messageRunning = useAuiState(selectMessageRunning)+ const messageId = useAuiState(s => s.message.id)+ const rowKey = `${sessionId ?? ''}:${messageId}:${props.toolCallId}`// Answering clears the request a beat before `tool.complete` swaps in the// settled card. Latch submit so that gap doesn't demote; Stop also clears// the request and must still collapse an unanswered card.const [answered, setAnswered] = useState(false)const settledResults = useStore($settledClarifyResults)- const requestId = requestIdByToolCall.get(props.toolCallId)+ const requestId = requestIdByToolCall.get(rowKey)const settledResult = requestId && request?.requestId !== requestId ? settledResults[requestId] : undefinedif (request && !settledResult && request.requestId !== requestId) {- requestIdByToolCall.set(props.toolCallId, request.requestId)+ requestIdByToolCall.set(rowKey, request.requestId)}const undelivered = useUndeliveredClarify(sessionId, messageRunning && !request && !answered && !settledResult)diff --git a/apps/desktop/src/components/assistant-ui/clarify/setup-pending.tsx b/apps/desktop/src/components/assistant-ui/clarify/setup-pending.tsxindex 9f7802e1a5e..1cb7efbd5f2 100644--- a/apps/desktop/src/components/assistant-ui/clarify/setup-pending.tsx+++ b/apps/desktop/src/components/assistant-ui/clarify/setup-pending.tsx@@ -36,6 +36,12 @@ import { UndeliveredNotice } from './undelivered-notice'type SetupSource = Pick<ClarifyRequest, 'questions' | 'setup'>+function sameLabels(a: Record<string, string>, b: Record<string, string>): boolean {+ const ids = Object.keys(a)++ return ids.length === Object.keys(b).length && ids.every(id => a[id] === b[id])+}+const KIND_ICONS: Record<SetupChooseKind, ComponentType<{ className?: string }>> = {accent: Palette,connectors: Plug,@@ -79,13 +85,23 @@ export function SetupChoosePending({const preselected = setup?.preselectedconst rowLabels = useMemo(() => Object.fromEntries((rows ?? []).map(row => [row.id, row.label])), [rows])- // Start the card with the rows the scan saw in use, once its list is known; the card may not list them all.+ // Once the list is known, record its names (composer text is matched against them) and start the card with+ // the rows the scan saw in use; the card may not list them all.useEffect(() => {- if (requestId && rows && preselected?.length && !$setupChooseStages.get()[requestId]) {- const ids = new Set(rows.map(row => row.id))+ if (!requestId || !rows) {+ return+ }- stageSetupChoose(requestId, { labels: rowLabels, picked: preselected.filter(id => ids.has(id)) })+ const current = $setupChooseStages.get()[requestId]++ if (current && sameLabels(current.labels, rowLabels)) {+ return}++ const ids = new Set(rows.map(row => row.id))+ const scanned = !current && preselected?.length ? { picked: preselected.filter(id => ids.has(id)) } : {}++ stageSetupChoose(requestId, { labels: rowLabels, ...scanned })}, [preselected, requestId, rowLabels, rows])const question: ClarifyQuestion = useMemo(diff --git a/apps/desktop/src/components/assistant-ui/clarify/setup-settled.tsx b/apps/desktop/src/components/assistant-ui/clarify/setup-settled.tsxindex ed93a1e5943..190c09e2234 100644--- a/apps/desktop/src/components/assistant-ui/clarify/setup-settled.tsx+++ b/apps/desktop/src/components/assistant-ui/clarify/setup-settled.tsx@@ -14,7 +14,7 @@ import { parseMaybeObject } from '../tool/fallback-model/format'import { ClarifyShell } from './core/shell'import { useSetupLabel } from './setup-rows'-const OUTCOMES = new Set(['cancelled', 'no_answer', 'submitted'])+const OUTCOMES = new Set(['cancelled', 'no_answer', 'submitted', 'typed'])function readSetupChooseResult(result: unknown) {const row = parseMaybeObject(result)@@ -27,7 +27,10 @@ function readSetupChooseResult(result: unknown) {// Rows the backend filled (tour, fork) are not in the call's args; the result names the pick.const labels = Array.isArray(row.label) ? row.label.map(String) : typeof row.label === 'string' ? [row.label] : null- return { labels, outcome: row.outcome, picked }+ // Composer words that named no row: shown as written, never as a pick.+ const said = row.outcome === 'typed' && typeof row.said === 'string' ? row.said : null++ return { labels, outcome: row.outcome, picked, said }}export function SetupChooseSettled(props: ToolCallMessagePartProps) {@@ -42,7 +45,7 @@ export function SetupChooseSettled(props: ToolCallMessagePartProps) {return <ToolFallback {...props} />}- const answer = (result.labels ?? result.picked.map(label)).join(', ')+ const answer = result.said ?? (result.labels ?? result.picked.map(label)).join(', ')const question = source?.questions[0]?.questiondiff --git a/apps/desktop/src/store/clarify.ts b/apps/desktop/src/store/clarify.tsindex 9c138beb300..ffe05e16aae 100644--- a/apps/desktop/src/store/clarify.ts+++ b/apps/desktop/src/store/clarify.ts@@ -245,7 +245,10 @@ export function clearClarifyRequest(requestId?: string, sessionId?: string | nulexport interface SetupChooseStage {draft: string- /** The name each staged row showed, by id, so a typed answer still names the rows staged with it. */+ /**+ * The name each row of the card shows, by id: a typed answer still names the rows staged with it, and+ * composer text is matched against the rows of a card whose list the app owns.+ */labels: Record<string, string>picked: string[]revert: (() => void) | null@@ -367,23 +370,7 @@ export function answerClarifyRequest(sessionId: string | null | undefined, text:}if (request.setup) {- // A multi-select picker keeps the rows already staged on the card, the- // same as its own Confirm: the typed words are one more pick.- const stage = setupChooseStage(request.requestId)- const answer = setupChooseAnswer(request.setup.multiSelect ? [...stage.picked, text] : text, stage.labels)-- if (!respondToServerRequest(request.requestId, answer)) {- return false- }-- if (request.setup.multiSelect) {- commitSetupChoose(request.requestId)- }-- clearClarifyRequest(request.requestId, request.sessionId)- settleClarify(request, { outcome: 'submitted', ...answer })-- return true+ return answerSetupChoose(request, request.setup, text)}// A reconnect replay can arrive with answers already locked server-side;@@ -406,6 +393,54 @@ export function answerClarifyRequest(sessionId: string | null | undefined, text:return true}+/** The row typed text names, by id or label (any case). */+function matchSetupRow(labels: Record<string, string>, text: string): string | undefined {+ const typed = text.trim().toLowerCase()++ return Object.keys(labels).find(id => id.toLowerCase() === typed || labels[id].trim().toLowerCase() === typed)+}++function answerSetupChoose(request: ClarifyRequest, setup: SetupChooseSpec, text: string): boolean {+ const stage = setupChooseStage(request.requestId)+ // The backend fills its own rows into the request; the app's lists are known to the card that drew them.+ const labels = setup.options ? Object.fromEntries(setup.options.map(row => [row.id, row.label])) : stage.labels+ const freeText = setup.kind === 'question' && !setup.options+ const id = freeText ? text : matchSetupRow(labels, text)++ if (id === undefined) {+ // Words that name no row are not a pick: the model reads them and asks again.+ if (!respondToServerRequest(request.requestId, { said: text })) {+ return false+ }++ clearClarifyRequest(request.requestId, request.sessionId)+ settleClarify(request, { outcome: 'typed', picked: null, said: text })++ return true+ }++ // A multi-select picker keeps the rows already staged on the card, the+ // same as its own Confirm: the typed row is one more pick.+ const answer = setupChooseAnswer(+ setup.multiSelect ? [...new Set([...stage.picked, id])] : id,+ freeText ? stage.labels : { ...stage.labels, ...labels }+ )++ if (!respondToServerRequest(request.requestId, answer)) {+ return false+ }++ // Keep the look of a row already previewed on the card; any other preview reverts with the request.+ if (setup.multiSelect || stage.picked.includes(id)) {+ commitSetupChoose(request.requestId)+ }++ clearClarifyRequest(request.requestId, request.sessionId)+ settleClarify(request, { outcome: 'submitted', ...answer })++ return true+}+/** One row of a clarify result, shaped like `tools/clarify_tool.py::_result`. */function settledResponse(question: ClarifyQuestion, answers: Record<string, null | string>) {const raw = answers[question.qid]diff --git a/apps/shared/src/gateway-contract.generated.ts b/apps/shared/src/gateway-contract.generated.tsindex 25692f7f3a9..e1bf8ad8a74 100644--- a/apps/shared/src/gateway-contract.generated.ts+++ b/apps/shared/src/gateway-contract.generated.ts@@ -4397,6 +4397,7 @@ export interface SetupChooseOption {export interface SetupChooseResult {picked?: string | string[] | nulllabel?: string | string[] | null+ said?: string | null}/** ``tui_gateway/server.py::_approval_request_payload`` — the command is redacted server-side. */export interface ApprovalRequestParams {diff --git a/apps/shared/src/gateway-contract.openrpc.json b/apps/shared/src/gateway-contract.openrpc.jsonindex 0f756251bfd..bfe9b538528 100644--- a/apps/shared/src/gateway-contract.openrpc.json+++ b/apps/shared/src/gateway-contract.openrpc.json@@ -32471,6 +32471,18 @@],"default": null,"title": "Label"+ },+ "said": {+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "null"+ }+ ],+ "default": null,+ "title": "Said"}},"title": "SetupChooseResult",diff --git a/optional-skills/productivity/initiate-setup/SKILL.md b/optional-skills/productivity/initiate-setup/SKILL.mdindex 626fff861e1..dc55851205d 100644--- a/optional-skills/productivity/initiate-setup/SKILL.md+++ b/optional-skills/productivity/initiate-setup/SKILL.md@@ -27,7 +27,7 @@ Never inside a task chat. When `setup_completed_at` is set, or `start_chat` alreThe setup profile's desktop tools:-- `setup_choose` shows one card and blocks until the user answers. Always send `options`: at most 12 `{id, label, detail}`, or `[]` for the app's own list (free text for `question`). Returns `{outcome, picked, label, next, handoff}`: name a pick by its `label`, never its id; do what `next` says in the same turn; the fork's result carries `handoff` for beat 7.+- `setup_choose` shows one card and blocks until the user answers. Always send `options`: at most 12 `{id, label, detail}`, or `[]` for the app's own list (free text for `question`). Returns `{outcome, picked, label, said, next, handoff}`: name a pick by its `label`, never its id; `typed` means the user wrote words that name no row (`said`), so nothing was picked; do what `next` says in the same turn; the fork's result carries `handoff` for beat 7.- `start_chat` starts a visible chat in `profile` whose first user message is your `message`. Returns `{status: "started", ...}` or `{status: "rejected", reason}`.- `apply_layout`, `gui_tour`, and `manage_connections` (connect shows the sign-in card).@@ -89,7 +89,7 @@ start_chat {"profile":"<primary_profile>","title":"<task name, at most- Before a card: the acknowledgment of the last answer, then at most one sentence of your own, all statements. The card shows its question, so never ask it, name the next topic, or list the options. No lead-in words (Now, Next, Let's).- Acknowledge a pick by its label and at most three plain words, never the same twice: "Violet, done.", "Gmail, noted." No opinion after a pick.- Short plain sentences, no em dashes, no exclamation marks. When `account.locale_is_english` is false, write in that language, labels included.-- Text typed instead of using the card is the answer. Never repeat a tool call that succeeded.+- Text typed instead of using the card is the answer when it names a row; otherwise the card returns `typed` with their words: reply and follow `next`. Never repeat a tool call that succeeded.- Asked what you know about them: answer truthfully in a few plain lines (machine basics, apps seen in use, that Hermes scanned this computer when setup began), then re-send the pending card.### Openingdiff --git a/tests/agent/test_message_sanitization_policy.py b/tests/agent/test_message_sanitization_policy.pyindex 7548f038900..ddcea86ef74 100644--- a/tests/agent/test_message_sanitization_policy.py+++ b/tests/agent/test_message_sanitization_policy.py@@ -108,6 +108,18 @@ class TestUniquifyToolCallIds:uniquify_tool_call_ids(tcs)assert tcs[2]["id"] == "z_d3"+ def test_id_used_earlier_in_the_session_is_renamed_and_history_is_not(self):+ # Providers that name every call "call_0" turn after turn: the session's+ # earlier ids stay as stored (prompt cache); the incoming call moves.+ taken = {"call_0", "call_0_d2"}+ tcs = [+ {"id": "call_0", "function": {"name": "f", "arguments": "{}"}},+ {"id": "call_fresh", "function": {"name": "g", "arguments": "{}"}},+ ]+ uniquify_tool_call_ids(tcs, taken=taken)+ assert [tc["id"] for tc in tcs] == ["call_0_d3", "call_fresh"]+ assert taken == {"call_0", "call_0_d2"}+def test_blank_and_non_string_ids_skipped(self):tcs = [{"id": "", "function": {"name": "a", "arguments": "{}"}},diff --git a/tests/hermes_cli/test_shared_metrics_model.py b/tests/hermes_cli/test_shared_metrics_model.pyindex 92afc781274..b5baaa15aaa 100644--- a/tests/hermes_cli/test_shared_metrics_model.py+++ b/tests/hermes_cli/test_shared_metrics_model.py@@ -33,7 +33,7 @@ def _agent(provider, model):return SimpleNamespace(provider=provider, model=model, session_id="s1", tools=tools,valid_tool_names={"read_file", "todo"}, log_prefix="", _invalid_tool_retries=0, _invalid_json_retries=0,- _uniquify_tool_call_ids=lambda calls: None,+ _uniquify_tool_call_ids=lambda calls, taken=(): None,_repair_tool_call=lambda name: "read_file" if name == "Read_File" else None,_vprint=lambda *a, **k: None, _buffer_vprint=lambda *a, **k: None, _flush_status_buffer=lambda: None,_build_assistant_message=lambda message, finish_reason: {"role": "assistant", "content": ""},diff --git a/tools/setup_choose_tool.py b/tools/setup_choose_tool.pyindex 5d35079c0c1..6b67728bed9 100644--- a/tools/setup_choose_tool.py+++ b/tools/setup_choose_tool.py@@ -42,6 +42,12 @@ _FIGURE = "Hand off now with start_chat; the ask is \"Let's figure out a first t_MACHINE_USE_SKIPPED = "Hand off with the machine-setup plan and leave their use out."_RESEND = ("If this text does not answer the card, answer it in a sentence or two, then send this card again in ""the same turn: {card}")+# Composer text that names no row of a card with fixed rows: their words, not a pick.+_TYPED = ("They typed this instead of picking. Reply to it in a sentence or two, then send this card again in the "+ "same turn so they can pick: {card}")+# On a first-task card typed words can be the task itself.+_TYPED_TASK = ("They typed this instead of picking. If it names a task, that is their first task: hand off with it. "+ "Otherwise reply to it in a sentence or two, then send this card again in the same turn: {card}")def _card(kind: str, question: str, multi_select: bool = False, options: Optional[list] = None) -> str:@@ -91,6 +97,10 @@ def _normalize_options(options) -> tuple:def _result(reply: Optional[dict], options: Optional[list]) -> dict:if reply is None:return {"outcome": "no_answer", "picked": None, "notice": _NO_ANSWER}+ # The desktop sends `said` only after matching the text against the card's rows by id and label.+ said = reply.get("said")+ if isinstance(said, str) and said.strip():+ return {"outcome": "typed", "picked": None, "said": said.strip()}picked = reply.get("picked")if picked is None:return {"outcome": "cancelled", "picked": None}@@ -124,6 +134,9 @@ def _follow_up(kind: str, card: str, result: dict, rows: Optional[list], cards:extra["handoff"] = {"message": handoff["message"], "plan": handoff[plan]}state["plan_sent"] = planstate["fork_seen"] = True+ if outcome == "typed":+ task_card = kind == "fork" or (kind == "question" and state.get("fork_seen"))+ return {**extra, "next": (_TYPED_TASK if task_card else _TYPED).format(card=card)}, statestep = state.get("step", -1)skipped = outcome == "cancelled" or (kind == "fork" and picked == "skip")if skipped and kind == "machine_use":@@ -261,10 +274,12 @@ SETUP_CHOOSE_SCHEMA = {"app's own list for the pickers, tour, fork and machine_use, and free text ""for kind='question'. With options the user may still type an answer. ""multi_select lets the user pick several rows. Result: {outcome, picked, "- "label?, next?, handoff?}. outcome is submitted, cancelled or no_answer (with "- "a notice saying why; an app list with nothing to offer returns it at once, "- "with no card). picked is the chosen option id (or the typed text) as a "- "string, or a list of ids with multi_select; label is the name the user saw "+ "label?, said?, next?, handoff?}. outcome is submitted, typed, cancelled or "+ "no_answer (with a notice saying why; an app list with nothing to offer "+ "returns it at once, with no card). typed means the user wrote words that "+ "match no row: `said` holds them and nothing was picked. picked is the "+ "chosen option id (or the free-text answer) as a string, or a list of ids "+ "with multi_select; label is the name the user saw ""for each pick, so say the label, never the id. ""Do what `next` says. `handoff` holds the start_chat message's parts and plan."),diff --git a/tui_gateway/contracts/server_requests.py b/tui_gateway/contracts/server_requests.pyindex f1d9a9895c7..4aa3e77bd2a 100644--- a/tui_gateway/contracts/server_requests.py+++ b/tui_gateway/contracts/server_requests.py@@ -85,6 +85,8 @@ class SetupChooseResult(Result):picked: str | list[str] | None = None# The name the card showed for each picked row (one per id in ``picked``); the model says it, not the id.label: str | list[str] | None = None+ # Composer text that named no row of the card: the user's words, never a pick.+ said: str | None = Noneserver_request("setup_choose", params=SetupChooseRequestParams, result=SetupChooseResult)diff --git a/website/docs/reference/tools-reference.md b/website/docs/reference/tools-reference.mdindex deb969a1a39..d30aa185f6b 100644--- a/website/docs/reference/tools-reference.md+++ b/website/docs/reference/tools-reference.md@@ -194,7 +194,7 @@ Enabled by the desktop setup profile's own config (`platform_toolsets.cli`). Onl| Tool | Description | Requires environment ||------|-------------|----------------------|-| `setup_choose` | Only through the `setup` toolset, desktop sessions only; never deferred unless a `tools.tool_search.defer` list names it. Shows one card in the setup chat: `kind` is `question`, `accent`, `theme`, `layout`, `connectors`, `plugins`, `tour` or `fork`, and `question` is the card's heading. `options` is required: up to 12 `{id, label, detail?}` rows (unique ids) replace the app's own list, and `[]` shows the app's list for a picker or asks for free text for kind `question`. `tour` (Quick tour, Show me everything, Skip) and `fork` (two first tasks built, when the card shows, from the apps and plugins picked earlier and the setup scan, then "I have something in mind", "Help me set up this <machine>" and "Let's figure it out together") always show the backend's rows. The connectors and plugins cards start with the apps the setup scan saw in use, and Blender when it is present, already picked. A card with options still takes a typed answer. `multi_select` lets the user pick several rows. An accent, theme or layout pick applies in the app as soon as the user picks it. The result has `outcome` (`submitted`, `cancelled` or `no_answer` with a `notice`), `picked` (an option id or typed text, or a list of ids with `multi_select`), and `label` (the name the card showed for each pick, such as `Ultraviolet` for `#8a2be2`) when the pick is one of the card's rows. When the connectors list is unavailable (no Nous identity, after one guest sign-up attempt) or the plugins list is empty, the call returns `no_answer` with a `notice` at once and shows no card. It records the picks for the handoff: `start_chat` hands the picked apps and plugins to the task chat, which connects and installs them first. Anywhere else the call returns an error. | — |+| `setup_choose` | Only through the `setup` toolset, desktop sessions only; never deferred unless a `tools.tool_search.defer` list names it. Shows one card in the setup chat: `kind` is `question`, `accent`, `theme`, `layout`, `connectors`, `plugins`, `tour` or `fork`, and `question` is the card's heading. `options` is required: up to 12 `{id, label, detail?}` rows (unique ids) replace the app's own list, and `[]` shows the app's list for a picker or asks for free text for kind `question`. `tour` (Quick tour, Show me everything, Skip) and `fork` (two first tasks built, when the card shows, from the apps and plugins picked earlier and the setup scan, then "I have something in mind", "Help me set up this <machine>" and "Let's figure it out together") always show the backend's rows. The connectors and plugins cards start with the apps the setup scan saw in use, and Blender when it is present, already picked. A card with options still takes a typed answer. `multi_select` lets the user pick several rows. An accent, theme or layout pick applies in the app as soon as the user picks it. The result has `outcome` (`submitted`, `typed`, `cancelled` or `no_answer` with a `notice`), `picked` (an option id, the free-text answer, or a list of ids with `multi_select`), `said` (with `typed`: words typed in the chat box that name none of the card's rows by id or label; nothing is picked or recorded), and `label` (the name the card showed for each pick, such as `Ultraviolet` for `#8a2be2`) when the pick is one of the card's rows. When the connectors list is unavailable (no Nous identity, after one guest sign-up attempt) or the plugins list is empty, the call returns `no_answer` with a `notice` at once and shows no card. It records the picks for the handoff: `start_chat` hands the picked apps and plugins to the task chat, which connects and installs them first. Anywhere else the call returns an error. | — |## `start_chat` toolsetdiff --git a/website/docs/user-guide/skills/optional/productivity/productivity-initiate-setup.md b/website/docs/user-guide/skills/optional/productivity/productivity-initiate-setup.mdindex 36e733fc9f4..2a2857b98fe 100644--- a/website/docs/user-guide/skills/optional/productivity/productivity-initiate-setup.md+++ b/website/docs/user-guide/skills/optional/productivity/productivity-initiate-setup.md@@ -44,7 +44,7 @@ Never inside a task chat. When `setup_completed_at` is set, or `start_chat` alreThe setup profile's desktop tools:-- `setup_choose` shows one card and blocks until the user answers. Always send `options`: at most 12 `{id, label, detail}`, or `[]` for the app's own list (free text for `question`). Returns `{outcome, picked, label, next, handoff}`: name a pick by its `label`, never its id; do what `next` says in the same turn; the fork's result carries `handoff` for beat 7.+- `setup_choose` shows one card and blocks until the user answers. Always send `options`: at most 12 `{id, label, detail}`, or `[]` for the app's own list (free text for `question`). Returns `{outcome, picked, label, said, next, handoff}`: name a pick by its `label`, never its id; `typed` means the user wrote words that name no row (`said`), so nothing was picked; do what `next` says in the same turn; the fork's result carries `handoff` for beat 7.- `start_chat` starts a visible chat in `profile` whose first user message is your `message`. Returns `{status: "started", ...}` or `{status: "rejected", reason}`.- `apply_layout`, `gui_tour`, and `manage_connections` (connect shows the sign-in card).@@ -106,7 +106,7 @@ start_chat {"profile":"<primary_profile>","title":"<task name, at most- Before a card: the acknowledgment of the last answer, then at most one sentence of your own, all statements. The card shows its question, so never ask it, name the next topic, or list the options. No lead-in words (Now, Next, Let's).- Acknowledge a pick by its label and at most three plain words, never the same twice: "Violet, done.", "Gmail, noted." No opinion after a pick.- Short plain sentences, no em dashes, no exclamation marks. When `account.locale_is_english` is false, write in that language, labels included.-- Text typed instead of using the card is the answer. Never repeat a tool call that succeeded.+- Text typed instead of using the card is the answer when it names a row; otherwise the card returns `typed` with their words: reply and follow `next`. Never repeat a tool call that succeeded.- Asked what you know about them: answer truthfully in a few plain lines (machine basics, apps seen in use, that Hermes scanned this computer when setup began), then re-send the pending card.### Opening