Skip to content

route_clarify's structured question/options are discarded before reaching the frontend; no HITL UI state exists #1930

Closed

Description

@malibio

Overview

route_clarify (Stage-1's typed clarification tool, packages/agent/src/local_agent/routing.rs:75-97) produces structured question: string + options: Vec<String> data specifically so the UI has something concrete to render instead of a bare "what do you mean?" — per ADR-038's own stated rationale. That structure is discarded before it ever reaches the frontend.

What actually happens

agent_loop.rs:2014-2029 matches RouteDecision::Clarify and calls format_clarification(&question, &options) (agent_loop.rs:558), which flattens both fields into one markdown string — "{opener}. {question}\n\n- opt1\n- opt2..." — then pushes it as ChatMessage::text(Role::Assistant, clarification) (agent_loop.rs:815-824): the exact same shape used for every ordinary assistant reply. There is no reference to route_clarify/RouteDecision anywhere in packages/desktop-app (confirmed by grep) — the structured data simply never crosses the Rust/frontend boundary.

On the frontend, DisplayMessage (packages/desktop-app/src/lib/components/chat/types.ts:15-23) has only id, role, content: string, toolExecutions, timestamp, reasoning? — no clarify/options field. chat-message.svelte renders message.content through <ChatMarkdown> unconditionally, with no branch on message type/state beyond role. The markdown - bullets from format_clarification render as prose, not clickable options.

Consequence: this is true for route_clarify (a designed, structured HITL mechanism) and equally true for an ordinary Stage-2 zero-tool-call reply that happens to phrase itself as a question (the observed failure mode on agent-matrix scenarios 6/8c — see #1922, #1927, both closed/tracked as a model-capability limit where resolve_query is never called). Both collapse into indistinguishable plain assistant text. There is no "the agent is asking for input" UI state anywhere in the chat surface — no disabled/different input affordance, no clickable option chips, no visual marker distinguishing a completed answer from an open question.

Why it matters

Proposed acceptance criteria

Reference Files

  • packages/agent/src/local_agent/routing.rs:75-97 — RouteDecision::Clarify, route_clarify tool schema
  • packages/agent/src/local_agent/agent_loop.rs:558 — format_clarification (the flattening point)
  • packages/agent/src/local_agent/agent_loop.rs:2014-2029, 815-824 — where the flattened string is pushed as an ordinary ChatMessage
  • packages/desktop-app/src/lib/components/chat/types.ts:15-23 — DisplayMessage shape, no clarify/options field
  • packages/desktop-app/src/lib/components/chat/chat-message.svelte — renders content unconditionally via <ChatMarkdown>, no state branch beyond role

Related Issues

Activity

  1. malibio commented on Aug 3, 2026

    @malibio
    CollaboratorAuthor

    Frontend baseline: 171 test files passed, 4108 tests passed.

  2. self-assigned this
    on Aug 3, 2026
  3. added a commit that references this issue on Aug 3, 2026
    d43c9f2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions