Skip to content
Closed
Show file tree
Hide file tree
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
9 changes: 7 additions & 2 deletions web/src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,10 @@ export const api = {
}),
getSessions: (limit = 20, offset = 0) =>
fetchJSON<PaginatedSessions>(`/api/sessions?limit=${limit}&offset=${offset}`),
getSessionMessages: (id: string) =>
fetchJSON<SessionMessagesResponse>(`/api/sessions/${encodeURIComponent(id)}/messages`),
getSessionMessages: (id: string, profile?: string | null) =>
fetchJSON<SessionMessagesResponse>(
`/api/sessions/${encodeURIComponent(id)}/messages${profile ? `?profile=${encodeURIComponent(profile)}` : ""}`,
),
getSessionLatestDescendant: (id: string) =>
fetchJSON<SessionLatestDescendantResponse>(
`/api/sessions/${encodeURIComponent(id)}/latest-descendant`,
Expand Down Expand Up @@ -1497,6 +1499,9 @@ export interface SessionInfo {
output_tokens: number;
preview: string | null;
parent_session_id?: string | null;
/** Owning profile name — present when session comes from
* `/api/profiles/sessions` (multi-profile aggregation). */
profile?: string | null;
}

export interface SessionLatestDescendantResponse {
Expand Down
4 changes: 2 additions & 2 deletions web/src/pages/SessionsPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -296,12 +296,12 @@ function SessionRow({
if (isExpanded && messages === null && !loading) {
setLoading(true);
api
.getSessionMessages(session.id)
.getSessionMessages(session.id, session.profile)
.then((resp) => setMessages(resp.messages))
.catch((err) => setError(String(err)))
.finally(() => setLoading(false));
}
}, [isExpanded, session.id, messages, loading]);
}, [isExpanded, session.id, session.profile, messages, loading]);

const sourceInfo = (session.source
? SOURCE_CONFIG[session.source]
Expand Down
Loading