-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Background
API client feedback requested a way to understand what a session was about without fetching all messages.
Current Behavior
The Session model only includes metadata:
id,startTime,endTime,messageCount,model,isSubAgent,parentSessionId,subAgentIds
To understand what a session was about, clients must fetch all messages and parse them.
Requested Enhancement
Add summary fields to the Session response:
{
"id": "499c44ca-...",
"startTime": "2025-12-30T15:49:17",
"messageCount": 418,
"firstUserPrompt": "is this anything of concern in our context...",
"topics": ["API debugging", "FastAPI", "endpoint routing"]
}Fields
| Field | Description | Implementation |
|---|---|---|
firstUserPrompt |
First user message text (truncated) | Extract from first type: "user" message in JSONL |
topics |
Session topics/themes | TBD - could be extracted from tool names, file paths, or require LLM analysis |
Implementation Notes
firstUserPromptis straightforward - read first user message from JSONL, truncate to ~200 charstopicsis more complex:- Option A: Derive from tools used + file paths (e.g., "Bash", "api/src/routes")
- Option B: Simple keyword extraction from messages
- Option C: LLM-based summarization (expensive, would need caching)
Acceptance Criteria
-
firstUserPromptfield added to Session model - Field populated on list and detail endpoints
- Truncation with ellipsis for long prompts
- Consider
topicsimplementation approach
Related
This was item #3 from client API feedback. Items #1, #2, #4, #5 already exist:
- ✅ Cross-project activity:
GET /api/v1/activity/ - ✅ Date range filtering:
startDate/endDateparams on sessions - ✅ Flattened content:
flatten=trueon messages - ✅ Activity summary:
GET /api/v1/activity/summary
Metadata
Metadata
Assignees
Labels
No labels