mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-08-04 06:01:15 -07:00
feat(tracker): integrate dynamic storage path in Config and tools
This commit is contained in:
@@ -1912,7 +1912,9 @@ export class Config {
|
||||
|
||||
getTrackerService(): TrackerService {
|
||||
if (!this.trackerService) {
|
||||
this.trackerService = new TrackerService(this.targetDir);
|
||||
this.trackerService = new TrackerService(
|
||||
this.storage.getProjectTempTrackerDir(this.sessionId),
|
||||
);
|
||||
}
|
||||
return this.trackerService;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ import { TrackerTaskSchema, type TrackerTask } from './trackerTypes.js';
|
||||
export class TrackerService {
|
||||
private readonly tasksDir: string;
|
||||
|
||||
constructor(private readonly trackerDir: string) {
|
||||
constructor(readonly trackerDir: string) {
|
||||
this.tasksDir = path.join(this.trackerDir, 'tasks');
|
||||
}
|
||||
|
||||
|
||||
@@ -46,9 +46,12 @@ describe('Tracker Tools Integration', () => {
|
||||
const result = await tool.buildAndExecute({}, getSignal());
|
||||
|
||||
expect(result.llmContent).toContain('Task tracker initialized');
|
||||
const tasksDir = path.join(tempDir, '.tracker', 'tasks');
|
||||
const trackerDir = config.getTrackerService().trackerDir;
|
||||
const tasksDir = path.join(trackerDir, 'tasks');
|
||||
const stats = await fs.stat(tasksDir);
|
||||
expect(stats.isDirectory()).toBe(true);
|
||||
// Verify it is NOT in the tempDir root (which was the old behavior)
|
||||
expect(trackerDir).not.toBe(path.join(tempDir, '.tracker'));
|
||||
});
|
||||
|
||||
it('creates and lists tasks', async () => {
|
||||
|
||||
@@ -69,8 +69,7 @@ class TrackerInitInvocation extends BaseTrackerInvocation<
|
||||
override async execute(_signal: AbortSignal): Promise<ToolResult> {
|
||||
await this.service.ensureInitialized();
|
||||
return {
|
||||
llmContent:
|
||||
'Task tracker initialized successfully. Storage is ready at .tracker/tasks/',
|
||||
llmContent: `Task tracker initialized successfully. Storage is ready at ${this.service.trackerDir}/tasks/`,
|
||||
returnDisplay: 'Tracker initialized.',
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user