Skip to content

A type chat's opening message shows only its first paragraph, and the types it names are not linked #4198

Closed

Description

@malibio

Overview

A chat opened on a type starts with a deterministic description of the type: whether it is built in, what it extends, and each field. The chat view displays only the first line of it, so the user never sees that explanation and has to ask for it. The description also names the parent type and each inherited field's owner as plain code spans, so they are not links.

Problem Statement

Observed on the Software Project type:

  • The stored opening message holds the whole description, ending with "What would you like to change?". The local model receives all of it as its first turn (confirmed in the prompt dump).
  • The rendered message is one paragraph: "Here is what Software Project is." followed by the option chips. In chat-message.svelte, clarifyHeaderText is message.content.split('\n\n')[0] whenever a message has options. That was written for clarify messages (an opener plus bullets rendered as chips). A bound-chat opening message also carries options ("Explain this type", "Add a field", ...), so it takes the same path and loses every paragraph after the first.
  • Asking "Explain this type" then makes the model rewrite a description the user could not see. The rewrite was degraded (invented parent, wrong field provenance).
  • describe_schema renders the parent as `project` (core/src/schema/description.rs, "It extends {parent}...") and each inherited field's owner as "From project". Only the type itself is a link. The model copied the link pattern for the type and emitted $\text{Project}$ for the unlinked parent; the chat renderer shows that literally.

Proposed Solution

Show the full opening message with its options beneath it, keeping the clarify behavior for messages that really are clarify prompts. Render the parent type and each field owner as node links in the description.

Documentation

  • ADR-100 §3 (the first option is always to ask) and §5 (a schema is described in plain language from stored data) - what the opening message is.
  • No prior doc covers how the chat view truncates messages with options.

Acceptance Criteria

  • A bound chat's opening message renders in full: the description, the closing question, then the option chips.
  • A clarify message (opener plus bullet options) still renders its opener with the options as chips.
  • describe_schema renders the parent type and each inherited field's owner as [Name](nodespace://<id>) links; a test asserts the output for a type that extends another.
  • The links resolve in the chat view the same way the type's own link does.
  • A frontend test covers both message shapes (bound opening, clarify) so the first-paragraph rule cannot swallow a bound opening again.
  • Code passes bun run quality:fix; bun run test:changed passes. Model-facing text changes regenerate the prompt snapshots (UPDATE_GOLDEN=1) and the diff is reviewed.

Technical Specifications

Reference Files

  • packages/desktop-app/src/lib/components/chat/chat-message.svelte - clarifyHeaderText (the first-paragraph split) and the options block
  • packages/core/src/schema/description.rs - describe_schema, the "It extends" sentence and the per-field owner text
  • packages/daemon/src/services/bound_chat.rs - opening_message, describe_schema_node, the "{}\n\nWhat would you like to change?" template

Related Issues

  • None

Activity

  1. added
    bug
    on Oct 31, 2026
  2. self-assigned this
    on Nov 2, 2026
  3. mstomar125 commented on Nov 2, 2026

    @mstomar125
    Contributor

    Picking this up (sweep drain).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugfrontendui

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions