Skip to content

Commit c13b66e

Browse files
committed
fix: address code review findings
- Fix invalid HTTP header name: X-Pilot Memory-Client → X-Pilot-Memory-Client - Complete truncated comment in ResponseProcessor.ts - Add error handling for file read in PlanRoutes.ts
1 parent 78343b9 commit c13b66e

3 files changed

Lines changed: 13 additions & 9 deletions

File tree

console/src/services/worker/agents/ResponseProcessor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export async function processAgentResponse(
128128
agentName
129129
);
130130

131-
// Note: Don't mark session as completed here - summaries are generated during
131+
// Note: Session completion is handled by stale cleanup, not here (summaries are generated during handoffs)
132132

133133
cleanupProcessedMessages(session, worker);
134134
}

console/src/services/worker/http/routes/PlanRoutes.ts

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,17 @@ export class PlanRoutes extends BaseRouteHandler {
102102
return;
103103
}
104104
const firstSpec = specs[0];
105-
const content = readFileSync(firstSpec.filePath, 'utf-8');
106-
res.json({
107-
content,
108-
name: firstSpec.name,
109-
status: firstSpec.status,
110-
filePath: firstSpec.filePath,
111-
});
105+
try {
106+
const content = readFileSync(firstSpec.filePath, 'utf-8');
107+
res.json({
108+
content,
109+
name: firstSpec.name,
110+
status: firstSpec.status,
111+
filePath: firstSpec.filePath,
112+
});
113+
} catch {
114+
res.status(404).json({ error: 'Plan file not found' });
115+
}
112116
return;
113117
}
114118

console/src/shared/remote-endpoint.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export function getWorkerEndpointConfig(): WorkerEndpointConfig {
4848
if (remoteConfig.token) {
4949
authHeaders['Authorization'] = `Bearer ${remoteConfig.token}`;
5050
}
51-
authHeaders['X-Pilot Memory-Client'] = 'local-hooks';
51+
authHeaders['X-Pilot-Memory-Client'] = 'local-hooks';
5252

5353
cachedEndpoint = {
5454
mode: 'remote',

0 commit comments

Comments
 (0)