feat(tracker): integrate dynamic storage path in Config and tools

This commit is contained in:
Anjali Sridhar
2026-02-18 16:10:16 -08:00
parent 91e7881f67
commit e6b68e7e8c
4 changed files with 9 additions and 5 deletions
+3 -1
View File
@@ -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;
}
+1 -1
View File
@@ -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');
}
+4 -1
View File
@@ -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 () => {
+1 -2
View File
@@ -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.',
};
}