mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-16 16:21:27 -07:00
fix(core): dynamic session ID injection to resolve resume bugs (#24972)
This commit is contained in:
committed by
GitHub
parent
80764c8bb5
commit
d06dba3538
@@ -60,7 +60,7 @@ describe('SessionStatsContext', () => {
|
||||
> = { current: undefined };
|
||||
|
||||
const { unmount } = await render(
|
||||
<SessionStatsProvider>
|
||||
<SessionStatsProvider sessionId="test-session-id">
|
||||
<TestHarness contextRef={contextRef} />
|
||||
</SessionStatsProvider>,
|
||||
);
|
||||
@@ -79,7 +79,7 @@ describe('SessionStatsContext', () => {
|
||||
> = { current: undefined };
|
||||
|
||||
const { unmount } = await render(
|
||||
<SessionStatsProvider>
|
||||
<SessionStatsProvider sessionId="test-session-id">
|
||||
<TestHarness contextRef={contextRef} />
|
||||
</SessionStatsProvider>,
|
||||
);
|
||||
@@ -162,7 +162,7 @@ describe('SessionStatsContext', () => {
|
||||
};
|
||||
|
||||
const { unmount } = await render(
|
||||
<SessionStatsProvider>
|
||||
<SessionStatsProvider sessionId="test-session-id">
|
||||
<CountingTestHarness />
|
||||
</SessionStatsProvider>,
|
||||
);
|
||||
@@ -245,7 +245,7 @@ describe('SessionStatsContext', () => {
|
||||
> = { current: undefined };
|
||||
|
||||
const { unmount } = await render(
|
||||
<SessionStatsProvider>
|
||||
<SessionStatsProvider sessionId="test-session-id">
|
||||
<TestHarness contextRef={contextRef} />
|
||||
</SessionStatsProvider>,
|
||||
);
|
||||
|
||||
@@ -13,14 +13,13 @@ import {
|
||||
useMemo,
|
||||
useEffect,
|
||||
} from 'react';
|
||||
|
||||
import type {
|
||||
SessionMetrics,
|
||||
ModelMetrics,
|
||||
RoleMetrics,
|
||||
ToolCallStats,
|
||||
} from '@google/gemini-cli-core';
|
||||
import { uiTelemetryService, sessionId } from '@google/gemini-cli-core';
|
||||
import { uiTelemetryService } from '@google/gemini-cli-core';
|
||||
|
||||
export enum ToolCallDecision {
|
||||
ACCEPT = 'accept',
|
||||
@@ -183,9 +182,10 @@ const SessionStatsContext = createContext<SessionStatsContextValue | undefined>(
|
||||
|
||||
// --- Provider Component ---
|
||||
|
||||
export const SessionStatsProvider: React.FC<{ children: React.ReactNode }> = ({
|
||||
children,
|
||||
}) => {
|
||||
export const SessionStatsProvider: React.FC<{
|
||||
children: React.ReactNode;
|
||||
sessionId: string;
|
||||
}> = ({ children, sessionId }) => {
|
||||
const [stats, setStats] = useState<SessionStatsState>({
|
||||
sessionId,
|
||||
sessionStartTime: new Date(),
|
||||
|
||||
Reference in New Issue
Block a user