Skip to content

fix(cli): use terminal-safe diagram guidance in Ask mode - #13696

Merged
marius-kilocode merged 1 commit into
mainfrom
accurate-noise
Sep 2, 2026
Merged

fix(cli): use terminal-safe diagram guidance in Ask mode#13696
marius-kilocode merged 1 commit into
mainfrom
accurate-noise

Conversation

@marius-kilocode

Copy link
Copy Markdown
Collaborator

What Problem This Solves

The built-in Ask prompt recommends Mermaid diagrams in every client, but the terminal displays Mermaid source instead of rendering a diagram.

Why This Change Was Made

Use the existing client flag and a named set of Mermaid-capable clients to keep the change in Kilo-owned agent setup. VS Code and JetBrains retain the original prompt; CLI, unset, ACP, and unknown clients receive plain-text or ASCII guidance. No renderer or shared upstream prompt changes are needed.

User Impact

CLI Ask mode no longer recommends unreadable Mermaid blocks for visual explanations. Explicit requests for Mermaid source remain allowed. Editor diagram support, read-only restrictions, and custom agent prompts are unchanged.

Detection remains server-process-wide: a terminal attached to an editor-owned backend still follows that backend client flag. Per-viewer capability negotiation is outside this fix.

Evidence

  • The regression matrix failed for all four non-rendering client cases before the fix and passes afterward; both editor cases retain the exact original prompt.
  • All 28 focused prompt and chart-gating tests pass, as do CLI typecheck, targeted lint, diff whitespace checks, and the annotation guard. Lint reports three existing assertions in the test file; existing unrelated formatting warnings were left unchanged.
  • An isolated source CLI debug agent ask smoke test confirms the final generated prompt contains ASCII guidance and no Mermaid recommendation, without making an LLM request.
  • Manual check: in CLI Ask mode, request a flow diagram and expect plain text; explicitly request Mermaid source and confirm it remains allowed.

@kilo-code-bot

kilo-code-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (3 files)
  • .changeset/cli-ask-plain-text-diagrams.md
  • packages/opencode/src/kilocode/agent/index.ts
  • packages/opencode/test/kilocode/system-prompt.test.ts

Reviewed by grok-4.6 · Input: 58.7K · Output: 8K · Cached: 391K

Review guidance: REVIEW.md from base branch main

@marius-kilocode
marius-kilocode merged commit 011fa7d into main Sep 2, 2026
32 checks passed
@marius-kilocode
marius-kilocode deleted the accurate-noise branch September 2, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants