Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins
TypeScript ai-agentcoding-agentdesktop-appelectronglobali18nlocal-firstmcppipi-agentpi-desktoppluginsreactrusttypescript
fix(asktool): keep descriptions plain text
vastsaf6a31c795ef9
diff --git a/apps/desktop/src/components/AskToolCard.tsx b/apps/desktop/src/components/AskToolCard.tsxindex 793665e8c..4b75134d4 100644--- a/apps/desktop/src/components/AskToolCard.tsx+++ b/apps/desktop/src/components/AskToolCard.tsx@@ -189,9 +189,7 @@ export function AskToolCard({ request, queued = 0 }: { request: PendingAsk; queu<AskToolRichText source={label} /></span>{description ? (- <span className="asktool-option-description">- <AskToolRichText source={description} />- </span>+ <span className="asktool-option-description">{description}</span>) : null}</span></button>diff --git a/apps/desktop/test/asktool-rich-options.test.mjs b/apps/desktop/test/asktool-rich-options.test.mjsindex 611abf032..17c3192dd 100644--- a/apps/desktop/test/asktool-rich-options.test.mjs+++ b/apps/desktop/test/asktool-rich-options.test.mjs@@ -43,7 +43,8 @@ test("asktool keeps legacy strings and normalizes rich labels and descriptions",test("asktool renders rich question and option content while keeping label answers intact", () => {assert.match(cardSource, /<AskToolRichText source=\{current\.question\} \/>/);assert.match(cardSource, /<AskToolRichText source=\{label\} \/>/);- assert.match(cardSource, /<AskToolRichText source=\{description\} \/>/);+ assert.match(cardSource, /<span className="asktool-option-description">\{description\}<\/span>/);+ assert.doesNotMatch(cardSource, /<AskToolRichText source=\{description\}/);assert.match(cardSource, /onClick=\{\(\) => selectOption\(label\)\}/);assert.match(richTextSource, /remarkPlugins: \[remarkGfm\]/);assert.match(styleSource, /\.asktool-rich-code\s*\{/);diff --git a/docs/spec/03-runtime/17-asktool-questions.md b/docs/spec/03-runtime/17-asktool-questions.mdindex e257fddec..a123d54d4 100644--- a/docs/spec/03-runtime/17-asktool-questions.md+++ b/docs/spec/03-runtime/17-asktool-questions.md@@ -13,16 +13,16 @@ The tool accepts a non-empty `questions` array. Each question contains:- `question`: the prompt text, which may include Markdown;- `options`: one or more selectable answer labels, each either a Markdown- string or an object with a required Markdown `label` and optional Markdown+ string or an object with a required Markdown `label` and optional plain-text`description`;- `multiSelect`: optional; when true, more than one selectable answer is allowed.Plain string options remain supported. The card renders CommonMark/GFM textformatting such as emphasis, inline code, paragraphs, and lists. Links render as-non-interactive text, images as alt text, and raw HTML is ignored. An object's-label and optional description use the same renderer. Rendering never rewrites-the option value: selection and the model-facing answer use its normalized-source label. The desktop card always adds one extra `Enter another answer`+non-interactive text, images as alt text, and raw HTML is ignored. Question+text and option labels use the same renderer; optional descriptions remain plain+text. Rendering never rewrites the option value: selection and the model-facing+answer use its normalized source label. The desktop card always adds one extra `Enter another answer`option with a text field. The model does not need to add a special free-textchoice to the tool arguments.diff --git a/docs/spec/04-ux/11-asktool-question-card.md b/docs/spec/04-ux/11-asktool-question-card.mdindex 832a53e37..910ff5d0a 100644--- a/docs/spec/04-ux/11-asktool-question-card.md+++ b/docs/spec/04-ux/11-asktool-question-card.md@@ -36,9 +36,10 @@ including emphasis, inline code, paragraphs, and lists. The card renders thiscontent inline with its existing compact typography. In option buttons links arenon-interactive text, images render as alt text, and raw HTML is ignored; thisavoids nested interactive controls and external image loading. Plain strings-remain supported, and `{ label, description? }` options render both text fields-with the same Markdown rules. Selecting an option returns its normalized source-label unchanged; formatting is display-only. The custom-answer option is not+remain supported, and `{ label, description? }` options render the label as+Markdown while keeping the optional description as plain supporting text.+Selecting an option returns its normalized source label unchanged; formatting+is display-only. The custom-answer option is notMarkdown-interpreted.## Typography hierarchydiff --git a/packages/agent-runtime/src/runtime.ts b/packages/agent-runtime/src/runtime.tsindex 60f54f068..5ba8c7dbe 100644--- a/packages/agent-runtime/src/runtime.ts+++ b/packages/agent-runtime/src/runtime.ts@@ -2919,7 +2919,7 @@ Do not invent objections or turn speculative risks into blockers. Stop when thecase "Bash":return `${commandShellToolDescription(this.commandShell, this.scratchDir)} Use Edit or Write instead of apply_patch, git apply, or patch; do not retry a failed shell patch command repeatedly.`;case ASK_TOOL_NAME:- return "Ask the user one or more questions. Use Markdown in question text and option labels when formatting helps (for example, emphasis, inline code, or lists); the desktop card renders it safely. Plain strings and existing `{ label, description? }` options are accepted, and answers return the selected source label. The card always provides a custom user-input option.";+ return "Ask the user one or more questions. Use Markdown in question text and option labels when formatting helps (for example, emphasis, inline code, or lists); the desktop card renders it safely. Plain strings and existing `{ label, description? }` options are accepted; descriptions remain plain text and answers return the selected source label. The card always provides a custom user-input option.";case "PluginScaffold":return "Create a PI-Desktop plugin from a template and load it for development. `directory` is workspace-relative and must be empty or new; `template` is one of panel-basic, agent-tool-basic, skill-pack, full-demo. Use this instead of hand-writing plugin files.";case "PluginCheck":