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
firstUserPrompt is straightforward - read first user message from JSONL, truncate to ~200 chars
topics is 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
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/endDate params on sessions
- ✅ Flattened content:
flatten=true on messages
- ✅ Activity summary:
GET /api/v1/activity/summary
Background
API client feedback requested a way to understand what a session was about without fetching all messages.
Current Behavior
The
Sessionmodel only includes metadata:id,startTime,endTime,messageCount,model,isSubAgent,parentSessionId,subAgentIdsTo 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
firstUserPrompttype: "user"message in JSONLtopicsImplementation Notes
firstUserPromptis straightforward - read first user message from JSONL, truncate to ~200 charstopicsis more complex:Acceptance Criteria
firstUserPromptfield added to Session modeltopicsimplementation approachRelated
This was item #3 from client API feedback. Items #1, #2, #4, #5 already exist:
GET /api/v1/activity/startDate/endDateparams on sessionsflatten=trueon messagesGET /api/v1/activity/summary