Skip to content

fix(mcp): ask agents to name their thread with the first tool call - #4315

Merged
LHagfoss merged 1 commit into
mainfrom
fix/mcp-thread-naming-first
Nov 24, 2026
Merged

LHagfoss merged 1 commit into
mainfrom
fix/mcp-thread-naming-first

Conversation

@LHagfoss

Copy link
Copy Markdown
Owner

What

Threads sometimes keep their automatic title (the first prompt, cut off). In the last 10 days only about 75% of threads with RustCode's tools named themselves: Claude Code 110/149, Codex 46/61.

The rule was the last paragraph of the MCP instructions and read "when its title is still automatic, call update_thread once". The agent has no way to check whether a title is automatic, so it often skipped the call.

  • MCP instructions (v16+): the naming rule now comes first, right after "Rules first". It reads: if you have not named this thread yet, make update_thread your first tool call, even when the thread already has a title. A title the user chose still stays, and the answer says title_kept.
  • PROMPT_HINT_V16 and the update_thread tool description use the same wording.
  • Tests pin the new wording. The instructions stay under the 4,000-character limit (2,809 characters before the jobs and tool notes are added).

Changelog

Agents now name a new thread with their first tool call, so fewer threads keep the raw first prompt as their title.

Testing

cargo fmt --all -- --check, scripts/check-comments.py and scripts/check-rust-size.py pass. Nothing was compiled locally because this runs on the VPS, so CI runs the Rust checks and the orchestration tests.

@github-actions github-actions Bot added the fix A bug fix label Nov 24, 2026
@LHagfoss
LHagfoss merged commit 6101b50 into main Nov 24, 2026
7 checks passed
@LHagfoss
LHagfoss deleted the fix/mcp-thread-naming-first branch November 24, 2026 14:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix A bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants