Skip to content

fix(harness): improve auto-rename prompt quality#422

Open
dimakis wants to merge 3 commits into
mainfrom
fix/auto-rename-quality
Open

fix(harness): improve auto-rename prompt quality#422
dimakis wants to merge 3 commits into
mainfrom
fix/auto-rename-quality

Conversation

@dimakis

@dimakis dimakis commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Rewrites the Haiku system prompt with few-shot examples and strict constraints to produce specific, action-oriented session titles instead of conversational responses
  • Adds sanitizeSessionName() that strips quotes, truncates at newlines, and rejects known bad patterns (apologies, generic starters, conversational filler)
  • Separates prompts with --- delimiters instead of bare newlines for clearer multi-prompt input
  • Logs rejected/empty titles for observability

Problem

Haiku was producing garbage session titles in production:

  • "I apologize, but I cannot access the specific Jira ticket li" — full conversational response
  • "\"OpenShift OpenCode Agent Integration\"\n\nWould you like me to" — embedded quotes + trailing conversation
  • "Start a Conversation" — generic filler when it couldn't extract intent

Test plan

  • 31 tests pass including new sanitization + integration tests
  • Full suite shows no regressions (pre-existing failures unrelated)
  • Deploy and observe auto-rename log quality over a day of sessions

🤖 Generated with Claude Code

dimakis and others added 3 commits July 2, 2026 00:21
Haiku was generating conversational responses ("I apologize..."),
generic titles ("Start a Conversation"), and titles with embedded
quotes/newlines instead of clean session names. Rewrites the system
prompt with few-shot examples and strict constraints, adds a
sanitization layer that strips quotes, truncates at newlines, and
rejects known bad patterns (apologies, filler, generic starters).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update server-level auto-rename test to use partial matching for prompt
content (exact separator format is tested in the harness test). Remove
duplicate unicode chars from quote-stripping regex.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant