zai-org / zai-org/feedback

[Bug] Session is named "Untitled session" when pasting a large amount of text from the clipboard (it becomes a .txt attachment).

Open
#217 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2 status: 待评估 type: Bug
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

提交前确认 · Pre-submission checklist
  • 我已搜索过现有 issue,确认这不是重复 / I searched existing issues and confirmed this isn't a duplicate.
  • 我已阅读 CONTRIBUTING.md / I've read CONTRIBUTING.md.
问题类别 · Category

对话 / Agent 交互 · Agent chat

涉及的 Agent 框架 · Agent framework

ZCode Agent(自研)

严重程度 · Severity

影响体验 · Major (功能可用但体验受损 / works but degraded)

复现频率 · Reproducibility

必现 · Always

问题描述 · Description

When the first (and only) user message in a session is a large pasted text,
ZCode converts that text into a .txt file attachment (a file message part)
instead of an inline text part. The session therefore ends up with an empty
or file-name-based title, and in the Command Palette / session list it is
displayed as "Untitled session".

Root cause (traced in the v3.6.5 bundle):

  1. Paste handler (renderer composer). When pasted plain text is >= 5 KB
    (threshold cJe = 5*1024), it is converted to a temp attachment via
    createTempTextAttachment({ text, filename }), where filename is
    generated as pasted-text-YYYYMMDD-HHMMSS.txt, mimeType text/plain,
    sourceKind clipboard-text. So the user's input becomes a file part,
    not a text part.

  2. Title derivation ignores file parts. textFromZCodeMessageParts filters
    message parts by type === "text" only — file parts are skipped.
    resolveZCodeVisibleSessionTitle therefore finds nothing and falls back
    to "New session" / "Untitled".

  3. createTask title fallback is a filename. deriveSessionTitle(content, attachments) returns the first 50 chars of inline text, but when there
    is none it returns attachments[0].filename ("pasted-text-*.txt"). This
    is then typically overwritten by the LLM title generator; if that
    generation is disabled (e.g. cron automations set titleGenerationEnabled: false) or fails/returns empty, the title degrades and aqe() in the
    Command Palette renders the hardcoded literal "Untitled session".

Net effect: any session whose first message is only a large paste ends up
nameless in the session list, making history hard to navigate.

复现步骤 · Steps to reproduce
  1. Open ZCode and start a new session in any workspace.
  2. Copy a piece of text of >= 5 KB (e.g. ~6000 chars of code/docs) to the
    clipboard.
  3. In the chat composer, paste (Cmd+V) the text WITHOUT typing any other
    text alongside it.
  4. Confirm the pasted content is rendered as an attached file
    "pasted-text-*.txt" rather than as inline text in the input box.
  5. Send the message.
  6. Open the Command Palette / session list and look at the title of the
    newly created session — it appears as "Untitled session" (or briefly as
    "pasted-text-*.txt" until the LLM title generation completes; if the
    generation is absent or fails, it ends up as "Untitled session").
期望表现 · Expected behavior

The session title should be derived meaningfully from the pasted content —
for example, from the first lines of the .txt attachment, or at minimum
from its filename — and should never appear as "Untitled session".

Ideally, the text of a clipboard-text attachment (sourceKind:
"clipboard-text", mimeType: "text/plain") should be treated in title
derivation the same way as inline text message parts.

实际表现 · Actual behavior

The session shows up as "Untitled session" in the Command Palette. In the
sidebar / task list it may also appear as "New task" (i18n key
taskList.untitled) or as "pasted-text-*.txt", but degrades to
"Untitled session" in the palette when the LLM title generator does not run
or returns empty.

ZCode 版本 · ZCode version

v3.6.5

设备 / 系统 / 浏览器 · Device / OS / Browser

macOS (darwin 25.6.0, arm64) / ZCode Desktop App

截图 / 录屏 / 日志 · Screenshots / Recordings / Logs

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the v3.6.5 bundle's paste handler and the title paths named in the report: textFromZCodeMessageParts, resolveZCodeVisibleSessionTitle, deriveSessionTitle, and aqe(). Reproduce the large clipboard paste case, then verify that a clipboard-text attachment produces a meaningful session title and never "Untitled session" when title generation is disabled or empty.

Written by the indexing model from the issue text.

Assessment

Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.