Session titled with a paste's own tag, e.g. <pasted_content id="8f8e">
メンテナーはふだん 1 日以内に返信
評価
調査の方向性
Start with core/session/title.go, especially titleRules, firstLine, quickRank, and the comments around TestScreenedRules_CoversEveryHighRankingTag. Compare core/observe/claude/harvest.go's stripWrapperTag and pasted_content allowlist, then add coverage for the four cases listed in the issue. Done means pasted tags no longer become titles, other wrapper output and prose mentioning the tag remain intact, and the screened title ranking stays sound.
索引モデルが issue の本文から書いたものです。
説明
What happens
A Claude Code session whose opening message is a paste gets the session title <pasted_content id="8f8e">: the paste's opening tag, not anything the user wrote. Titles are first-wins, so it keeps that title for the rest of the session.
Seen on a live laptop proxy on 2026-10-21. GET /v1/sessions served:
{"id": "7aa5f31e-…", "title": "<pasted_content id=\"8f8e\">", "agent": "claude-code", "eventCount": 492}
agentop shows the served title whenever its transcript harvest can't name a session. It couldn't name this one: the session ran under a second Claude Code config directory that the harvest doesn't read (a separate gap). So the tag is what the user saw in the TITLE column.
Why
The title came from Claude Code's own title-generation request rather than from a conversation turn. That request wraps the user's opening message in <session>…</session> and asks the model to write a title:
<session>
<pasted_content id="8f8e">
The list screener is showing
ONS_057: 1 run(s) | UNPLACED 1 -- nothing outstanding
MuPDF error: library error: FT_New_Memory_Face(*Tahoma-Bold-12379): unknown file format
</pasted_content id="8f8e">
</session>
Write the title in the predominant language of the session — …
core/session/title.go has a <session> rule (titleRules, the takeFirstLine row) that takes the first non-blank line inside the wrapper (firstLine). Here that line is <pasted_content id="8f8e">. No rule in core/session recognises <pasted_content>, so the tag is returned as the title. sanitizeTitle only folds whitespace and control runes, and foldsBlank passes it because it isn't blank.
A bare pasted opening message, with no <session> wrapper, probably goes wrong the same way through the generic prose rule. It opens with the tag, nothing anchors on it, and its first line is the tag. I haven't confirmed that path.
The harvester already handles this
core/observe/claude/harvest.go solved the same problem for transcript titles, in #1101. stripWrapperTag unwraps a leading content-bearing wrapper to its body. contentBearingWrappers is an allowlist whose only entry is pasted_content, and the result is re-tested so that an empty body, a nested wrapper or leftover markup still can't become a title. Its comments explain why it's an allowlist: unwrapping anything tag-shaped once put <bash-stdout> output in a title.
The proxy keeps its own copy of the title logic and doesn't import the harvester. A comment in title.go says that is deliberate. So the fix belongs in core/session, applying the same rule there rather than calling the harvester.
Expected
For the event above, The list screener is showing. That is the first line of what the user pasted, which is also what the harvester would choose. Claude Code's own title for the session was "MuPDF FT_New_Memory_Face error", but the proxy takes a line from the user's text rather than summarising, so matching that isn't the goal.
Suggested fix
- In
core/session/title.go, unwrap a leading<pasted_content …>(with or without attributes) before a line is chosen, both inside a<session>/<conversation>/<bash-input>body (beforefirstLine) and at the start of a plain user message. - Allowlist only
pasted_content, for the reasons the harvester gives. A wrapper that holds harness output must still fall through to the next candidate. - Re-test the result so leftover markup names nothing (rank none) instead of becoming the title. The empty-body and nested-wrapper cases the harvester covers apply here too.
- The close tag carries the id as well (
</pasted_content id="8f8e">), so a match that expects a bare</pasted_content>would miss it. - Keep
quickRank's guess sound: the unwrapped result must not rank above what the screen guessed. See the comments onquickRankandTestScreenedRules_CoversEveryHighRankingTag. - Tests:
- the
<session>-wrapped paste above - a bare pasted opening message
- a paste with an empty body
- prose that only mentions
<pasted_content>partway through, which must keep its own words
- the
Not this issue
agentop's harvest reads one Claude Code config directory (CLAUDE_CONFIG_DIR, else ~/.claude), so sessions run under another profile such as ~/.claude-pro are never named from their transcripts, even when Claude Code wrote a good ai-title for them. That is why the served title was visible at all here, and it needs its own fix.
Assisted-By: Claude (Anthropic AI) [email protected]
- 主要言語
- Go
- スター
- 18
- フォーク
- 42
- 平均マージ
- 12時間 20分
- マージ済み PR(30日)
- 229
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
rossoctl/cortex のほかの issue
-
UI shows costs for all sessions even when drilled into a session対応中かも @esnible が 12 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
rossoctl/cortex#1116 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
enhancement laptop
難易度 5/5 1週間以上 初心者へのやさしさ 40/100
メンテナーはふだん 1 日以内に返信
-
Decouple plugins from Go pipeline internals: parser test data, session facts, serializable recordsオープンenhancement laptop
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
enhancement laptop
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
メンテナーはふだん 1 日以内に返信
-
enhancement laptop
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
rossoctl/cortex の issue をすべて見る
似ている issue
-
[flaky test] TestValidatorCommitterDropsEmptyStatusBatch: submits to the mock VC before its stream is registered対応中かも @liran-funaro が今日担当しました。 オープンcoordinator flaky-test race-condition testing
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
hyperledger/fabric-x-committer#876 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
garethgeorge/backrest#1426 ·
メンテナーはふだん 1 日以内に返信
-
enhancement nav-pilot
難易度 2/5 半日 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
valkey-io/valkey-operator#549 · コメント 1 件 ·
メンテナーはふだん 3 日以内に返信
-
kind/features
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
TencentBlueKing/bk-nodemgr#3804 ·
メンテナーはふだん 1 日以内に返信