mirror of
https://github.com/Alishahryar1/free-claude-code.git
synced 2026-04-28 03:20:01 +00:00
refactor: drop legacy title-generation detection copy
Some checks are pending
CI / checks (push) Waiting to run
Some checks are pending
CI / checks (push) Waiting to run
Remove new-conversation-topic heuristic; keep sentence-case and JSON session title patterns. Update unit and smoke E2E payloads accordingly.
This commit is contained in:
parent
080ebefc7b
commit
40951c145a
4 changed files with 23 additions and 21 deletions
|
|
@ -32,22 +32,18 @@ def is_title_generation_request(request_data: MessagesRequest) -> bool:
|
|||
Title generation requests are detected by a system prompt containing
|
||||
title extraction instructions, no tools, and a single user message.
|
||||
|
||||
Matches both legacy phrasing and Claude Code 2.1+ session title prompts
|
||||
(JSON \"title\" field, sentence-case title instructions, etc.).
|
||||
Matches Claude Code session title prompts (sentence-case title, JSON
|
||||
\"title\" field, etc.).
|
||||
"""
|
||||
if not request_data.system or request_data.tools:
|
||||
return False
|
||||
system_text = extract_text_from_content(request_data.system).lower()
|
||||
if "title" not in system_text:
|
||||
return False
|
||||
return (
|
||||
"new conversation topic" in system_text
|
||||
or "sentence-case title" in system_text
|
||||
or (
|
||||
"return json" in system_text
|
||||
and "field" in system_text
|
||||
and ("coding session" in system_text or "this session" in system_text)
|
||||
)
|
||||
return "sentence-case title" in system_text or (
|
||||
"return json" in system_text
|
||||
and "field" in system_text
|
||||
and ("coding session" in system_text or "this session" in system_text)
|
||||
)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue