Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Session titled with a paste's own tag, e.g. <pasted_content id="8f8e">

オープン
#1,492 コメント 0 件 リアクション 0 件 担当者 1 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@esnible がすでに取り組んでいます。

2026年10月23日 から。

  • #1493 @esnible による — オープン

評価

難易度
4/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go
領域
backend

調査の方向性

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 の本文から書いたものです。

説明

bug

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 (before firstLine) 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 on quickRank and TestScreenedRules_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

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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rossoctl/cortex のほかの issue

rossoctl/cortex の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。