[Bug] Session is named "Untitled session" when pasting a large amount of text from the clipboard (it becomes a .txt attachment).
Nobody has claimed this yet.
- 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):
-
Paste handler (renderer composer). When pasted plain text is >= 5 KB
(thresholdcJe = 5*1024), it is converted to a temp attachment via
createTempTextAttachment({ text, filename }), where filename is
generated aspasted-text-YYYYMMDD-HHMMSS.txt, mimeTypetext/plain,
sourceKindclipboard-text. So the user's input becomes afilepart,
not atextpart. -
Title derivation ignores file parts.
textFromZCodeMessagePartsfilters
message parts bytype === "text"only — file parts are skipped.
resolveZCodeVisibleSessionTitletherefore finds nothing and falls back
to "New session" / "Untitled". -
createTask title fallback is a filename.
deriveSessionTitle(content, attachments)returns the first 50 chars of inline text, but when there
is none it returnsattachments[0].filename("pasted-text-*.txt"). This
is then typically overwritten by the LLM title generator; if that
generation is disabled (e.g. cron automations settitleGenerationEnabled: false) or fails/returns empty, the title degrades andaqe()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
- Open ZCode and start a new session in any workspace.
- Copy a piece of text of >= 5 KB (e.g. ~6000 chars of code/docs) to the
clipboard. - In the chat composer, paste (Cmd+V) the text WITHOUT typing any other
text alongside it. - Confirm the pasted content is rendered as an attached file
"pasted-text-*.txt" rather than as inline text in the input box. - Send the message.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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