Conversation
Use a dedicated prompt variable when constructing the title-generation ChatPromptTemplate so rendered message text is treated as data instead of format syntax. This prevents ValueError crashes when recent messages include brace patterns that appear in local/Ollama outputs. Add a regression test that covers the failing conversion-spec and nested-brace cases.
📝 WalkthroughWalkthroughFormats and truncates recent messages, moves system prompt text into a Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Pipeline
participant Formatter
participant LLM
participant Logger
participant HistoryFilter
Client->>Pipeline: invoke(current_title, recent_messages, user_language)
Pipeline->>HistoryFilter: filter recent history (remove empty/whitespace messages)
HistoryFilter-->>Pipeline: filtered_history
Pipeline->>Formatter: format_recent_messages(filtered_history)
Formatter-->>Pipeline: formatted_recent_messages
Pipeline->>LLM: call(system prompt "{prompt_text}" + user prompt with current_title, formatted_recent_messages, user_language)
LLM-->>Pipeline: raw_response
Pipeline->>Logger: log(raw_response)
alt raw_response empty
Pipeline->>LLM: retry call (require single non-empty line)
LLM-->>Pipeline: retry_response
Pipeline->>Logger: log(retry_response)
Pipeline-->>Client: return final_title (from retry_response)
else raw_response non-empty
Pipeline-->>Client: return final_title (from raw_response)
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Pylint (4.0.4)iris/src/iris/domain/data/text_message_content_dto.pyiris/src/iris/pipeline/abstract_agent_pipeline.pyThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Local models often return minor variations of the title decision format (case/spacing, multiline context, or localized keywords). Relax session title decision parsing to accept UPDATE/KEEP variants while keeping strict line-anchored matching to avoid false positives. Add parser-focused tests and keep the brace-regression test.
Add an info log in the session title generation pipeline that records the raw model decision output (truncated) to simplify debugging local/cloud behavior differences.
Revert the relaxed title decision parser and keep strict KEEP/UPDATE parsing. Focus on the root issue instead: local models sometimes return empty output for the title decision call. Add a user-turn prompt and a single fallback retry when attempt 1 is empty, with raw output logging per attempt. Add regression coverage for the retry path.
Refactor title generation to a two-role prompt (system policy + user data), pass recent messages as formatted newline text instead of Python list repr, cap title context to the most recent 10 messages with per-line truncation, and make decoding deterministic with temperature=0 and max_tokens=128. Remove retry-specific test and add coverage for message formatting limits.
Iris: Fix session title generation crash with brace contentIris: Fix local session titles not updating
Artemis can send chat history entries with {'type': 'text'} but no
textContent field, causing Pyris to reject the request with 422.
Default textContent to "" and filter out empty messages before they
reach any pipeline.
Summary
Fix local session title generation so titles update reliably with local Ollama models.
The main issue was that the title decision prompt shape could produce empty model output (
"") in local mode, even when regular chat responses worked.Changes
system: decision policy/rulesuser: current title + recent messages + strict output instructiontemperature=0.0max_tokens=128Session title raw LLM output).Test plan
cd iris && poetry run pytest -qcd iris && poetry run black --check src/iris/pipeline/session_title_generation_pipeline.py tests/test_session_title_generation_pipeline.pySummary by CodeRabbit
New Features
Tests