Skip to content

fix(recall): rebuild summary on current main (undo stale-base clobber)#41

Merged
kazukinakai merged 1 commit into
mainfrom
fix/mindbase-recall-recover
Jun 26, 2026
Merged

fix(recall): rebuild summary on current main (undo stale-base clobber)#41
kazukinakai merged 1 commit into
mainfrom
fix/mindbase-recall-recover

Conversation

@kazukinakai

Copy link
Copy Markdown
Member

Summary

PR #37 was built from a 15-commit-behind stale local checkout, clobbering symbols that main had added in those 15 commits. This PR restores BASE_GOOD (1092017 = main just before #37 merged) as foundation and re-applies the summary feature only.

Clobbered symbols restored:

  • schemas/conversation.py: ChatRequest, ChatMessage, ConversationSummary, AppSettings embedding/chat fields
  • ollama_client.py: chat() streaming method
  • crud/conversation.py: list_conversations, get_conversation
  • api/routes/conversations.py: list endpoint, _format_result, compare endpoints
  • config.py: CHAT_MODEL/CHAT_TEMPERATURE/CHAT_MAX_TOKENS/CHAT_SYSTEM_PROMPT + EMBEDDING_MODEL defaults

Summary additions re-applied cleanly on top:

  • config.py: SUMMARY_MODEL: str = "qwen3:14b" with safe default
  • schemas/conversation.py: summary: Optional[str] = None on ConversationResponse
  • ollama_client.py: generate_summary(text, model) via /api/generate
  • services/deriver.py: _generate_summary() with try/except (failure → NULL, never blocks store)
  • crud/conversation.py: upsert via pg_insert ON CONFLICT (source, source_conversation_id)
  • api/routes/conversations.py: _format_result prefers summary over messages[0] fallback
  • crud/__init__.py: re-export list_conversations and get_conversation

Test plan

  • ImportError: cannot import name 'ChatRequest' resolved
  • pytest tests/ → 25 passed, 0 failed
  • black --check → exit 0

…se regression

PR #37 was built from a 15-commit-behind stale local checkout and did a wholesale
file copy, clobbering symbols that main had added in those 15 commits:
- schemas/conversation.py: ChatRequest, ChatMessage, ConversationSummary, AppSettings fields
- ollama_client.py: chat() method
- crud/conversation.py: list_conversations, get_conversation
- api/routes/conversations.py: list endpoint, _format_result, compare endpoints
- config.py: CHAT_MODEL/TEMPERATURE/MAX_TOKENS/SYSTEM_PROMPT + EMBEDDING_MODEL defaults

This PR restores BASE_GOOD (1092017 = main just before #37 merged) as foundation
for all 7 affected files, then re-applies only the summary-related additions:
- config.py: SUMMARY_MODEL with safe default (no silent fallback)
- models/conversation.py: summary = Column(Text) (already correct in HEAD, no change)
- schemas/conversation.py: summary: Optional[str] = None on ConversationResponse
- ollama_client.py: generate_summary(text, model) method
- services/deriver.py: _generate_summary() with try/except, passed to crud
- crud/conversation.py: upsert via pg_insert ON CONFLICT (source, source_conversation_id)
- api/routes/conversations.py: _format_result prefers summary over messages[0]
- crud/__init__.py: re-export list_conversations and get_conversation

Verified: 25 passed, 0 failed; black --check green.
@kazukinakai kazukinakai merged commit 6779705 into main Jun 26, 2026
3 checks passed
@kazukinakai kazukinakai deleted the fix/mindbase-recall-recover branch June 26, 2026 14:31
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