fix: resolve session provider on backend reads

Session history and token usage reads already have a stable app session id.
Passing provider and project hints from the frontend kept those reads coupled
with provider-specific state that the backend can resolve from the session row.

Resolve token usage provider server-side and narrow the session store read API
to session id plus pagination. This keeps provider-specific storage decisions
behind the backend boundary and makes reconnect, pagination, and load-all use
the same session-owned contract.
This commit is contained in:
Haileyesus
2026-06-15 14:04:50 +03:00
parent 9cb2afd67e
commit 9fb2d91b26
4 changed files with 14 additions and 58 deletions

View File

@@ -454,9 +454,6 @@ export function useSessionStore() {
const fetchFromServer = useCallback(async (
sessionId: string,
opts: {
provider?: LLMProvider;
projectId?: string;
projectPath?: string;
limit?: number | null;
offset?: number;
} = {},
@@ -511,9 +508,6 @@ export function useSessionStore() {
const fetchMore = useCallback(async (
sessionId: string,
opts: {
provider?: LLMProvider;
projectId?: string;
projectPath?: string;
limit?: number;
} = {},
) => {
@@ -592,11 +586,6 @@ export function useSessionStore() {
*/
const refreshFromServer = useCallback(async (
sessionId: string,
_opts: {
provider?: LLMProvider;
projectId?: string;
projectPath?: string;
} = {},
) => {
const slot = getSlot(sessionId);
try {