Skip to content

[Feature Request] Inline, collapsible threads anchored to selected Agent output (distinct from /side) #4711

Open

Description

@Yuanming-Wang

What feature would you like to see?

Bring local clarification to the place where the question arises — without fragmenting the main Agent session.

A long-running coding Agent may produce a multi-page explanation, an execution trace, or a detailed plan. Users frequently want to ask why a particular step was taken or what a specific line means. Today's linear follow-up sends that question to the bottom of the session, breaks reading flow, and risks accidentally influencing the Agent's main task. A separate fork requires leaving the original flow.

I propose Inline Branch Threads for the Kimi Code Web/VS Code conversation UI, with a possible CLI-compatible conversation model later:

  1. Anchor to a precise selection. Highlight an already-rendered sentence, paragraph, or visible tool-result segment, then click Ask in thread.
  2. Expand directly at the source. The side conversation appears as a compact, embedded multi-turn thread beside/beneath the selected passage, not as another top-level session. It can be collapsed to a small marker and reopened later.
  3. Preserve the relationship. Save the selected excerpt, source message, thread messages and provenance. Multiple threads can attach to different parts of a long answer.
  4. Let the user decide what the main Agent sees.
    • Isolated (default): a local, read-only clarification that does not affect the parent Agent's instructions or model context.
    • Share summary: inject only a source-labeled conclusion into a later parent turn.
    • Share full thread: allow future parent turns to retrieve the full thread, respecting context limits and authorization.
  5. Agent observation (later): optionally let the thread inspect observed progress, tools and approval state while the parent continues executing, without modifying or interrupting that run.

Illustration:

Main response:
  1. Proposed approach ...
  2. Test results: 3 checks failed. [Ask in thread]
     ↳ Why did check B fail?
       ↳ The validation rejected ...
     [Collapse: 2 messages] [Share with main: off/on]
  3. Next steps ...

Why this is not a duplicate of #4378

#4378 requests a persistent side conversation complementing /btw, with optional merge/back-to-main. I support that direction. This request is specifically about a selection-anchored, inline and collapsible presentation in the output itself, plus fine-grained, user-controlled context exposure. It should be complementary to any persistent /side infrastructure, not a second competing side-chat backend.

It is also not simply /fork: a fork navigates to a separate session, whereas an inline thread should preserve the parent text, scroll position and multiple local discussions in one view.

Suggested small first slice

Start with selection → inline expand/collapse → multi-turn, persistent isolated thread, and source-message linkage. Add selective parent-context sharing and live execution observation only in subsequent increments. In-flight parent requests must not be retroactively changed.

Questions for the maintainers: Does the Web/VS Code UI roadmap include anchored inline discussions? Can this reuse the existing side-conversation/session abstraction? What would be the smallest acceptable UI scope?

I am interested in producing a minimal prototype and contributing implementation if explicitly invited. I understand the current contribution policy does not accept unsolicited external feature PRs, so this is a design request, not an unsolicited PR.

Additional information

Value beyond UI polish:

  • Reading continuity: local follow-ups stay next to the source.
  • Agent safety: side questions remain isolated until explicitly shared.
  • Explainability & traceability: conclusions retain a provenance link to the original step/output.
  • Context efficiency: later parent turns can consume summaries or retrieve the full thread as needed, instead of always flattening all branches.

Activity

  1. Yuanming-Wang commented on Nov 6, 2026

    @Yuanming-Wang
    Author

    Update: interactive proof-of-concept completed (2026-11-06)

    I have built a standalone browser-based interaction prototype for the proposed Inline Branch Chat concept.

    17-second prototype walkthrough video (Google Drive; link-sharing permissions are being configured).

    The recording illustrates:

    • An inline discussion attached to a specific segment of the main assistant response.
    • A collapsible branch that keeps the parent response visible.
    • An in-place multi-turn question/answer flow.
    • A UI control for choosing whether to share branch information back to the parent conversation.

    Scope clarification: This is an independent UI/interaction PoC, not a PR against this repository and not evidence that production-grade anchoring, persistence, model-context routing, or live Agent observation is already implemented. Those behaviors would need integration and tests.

    I am sharing this to make the UX proposal concrete before attempting implementation.

    For Kimi Code, this is a design demonstration only. I am not opening an unsolicited implementation PR. If maintainers find the direction valuable, I would appreciate guidance about any appropriate collaboration channel under the repository's contribution policy.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions