fix(lint): prefer-const in context.ts; fix GET /sessions/:id isGenerating routing
- context.ts: let engine → const engine (prefer-const lint rule)
- register-chat-routes.ts GET /sessions/🆔 use per-project chatManager
for isGenerating enrichment (addresses Greptile P2 comment)
This commit is contained in:
@@ -81,7 +81,7 @@ export async function getProjectContext(
|
||||
const engineManager = options?.engineManager;
|
||||
|
||||
if (projectId && engineManager) {
|
||||
let engine = engineManager.getEngine(projectId);
|
||||
const engine = engineManager.getEngine(projectId);
|
||||
if (!engine) {
|
||||
// Trigger lazy engine start as fire-and-forget so this request is not
|
||||
// blocked while the engine initialises (engine.start() may take several
|
||||
|
||||
@@ -253,7 +253,8 @@ export function registerChatRoutes(ctx: ApiRoutesContext, deps: ChatRouteDeps):
|
||||
}
|
||||
|
||||
const enriched: EnrichedChatSession = session;
|
||||
enriched.isGenerating = options?.chatManager?.isGenerating?.(sessionId) ?? false;
|
||||
const chatManager = await resolveScopedChatManager(req.query.projectId as string | undefined).catch(() => options?.chatManager);
|
||||
enriched.isGenerating = chatManager?.isGenerating?.(sessionId) ?? false;
|
||||
|
||||
res.json({ session: enriched });
|
||||
} catch (err: unknown) {
|
||||
|
||||
Reference in New Issue
Block a user