fix: reinforce no-project-inference in system prompt; filter tool messages from title generation

This commit is contained in:
2026-04-07 12:45:08 -04:00
parent d290bebad2
commit b3cf42863a
2 changed files with 10 additions and 2 deletions
@@ -122,10 +122,13 @@ async def _generate_title(messages: list[dict], user_id: int) -> str:
# Build conversation text like summarize_conversation_as_note
conv_lines = []
for m in messages:
if m["role"] == "system":
if m["role"] in ("system", "tool"):
continue
label = "User" if m["role"] == "user" else "Assistant"
conv_lines.append(f"{label}: {m['content']}")
content = m.get("content", "")
if not content:
continue
conv_lines.append(f"{label}: {content}")
# Keep only last 6 pairs worth of text
conv_lines = conv_lines[-12:]