Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions python/valuecell/server/services/conversation_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
)
from valuecell.utils import resolve_db_path

# Agent names used by strategy creation flows; conversations from these agents
# should be excluded from the general conversation list returned to clients.
# Keep this set small and focused; extend if new strategy agents are added.
STRATEGY_AGENT_NAMES = {
"PromptBasedStrategyAgent",
"GridStrategyAgent",
}


class ConversationService:
"""Service for managing conversation operations."""
Expand Down Expand Up @@ -51,6 +59,20 @@ async def get_conversation_list(
user_id=user_id
)

# Exclude conversations initiated by strategy agents from general listing.
# We match by known names and a conservative substring check to future-proof.
conversations = [
conv
for conv in conversations
if not (
(conv.agent_name or "") in STRATEGY_AGENT_NAMES
or (
(conv.agent_name or "")
and "StrategyAgent" in (conv.agent_name or "")
)
)
]

# Apply pagination
total = len(conversations)

Expand Down