fix(tests): add test for disabling all tools in CcwToolsMcpCard component

fix(api): handle empty enabledTools array and improve default tool logic
fix(queueScheduler): ignore network errors in loadInitialState
fix(auth): ensure token generation handles max session capacity
chore(dependencies): update package requirements to use compatible version specifiers
chore(tests): add new test cases for incremental indexer and migrations
This commit is contained in:
catlog22
2026-03-02 11:26:15 +08:00
parent b36a46d59d
commit 8ad283086b
7 changed files with 159 additions and 84 deletions

View File

@@ -100,14 +100,16 @@ export async function handleAuthRoutes(ctx: RouteContext): Promise<boolean> {
} else {
// Batch token response (pool pattern)
const tokens = tokenManager.generateTokens(sessionId, count);
const firstToken = tokens[0];
// If no tokens generated (session at max capacity), force generate one
const firstToken = tokens.length > 0 ? tokens[0] : tokenManager.generateToken(sessionId);
// Set header and cookie with first token for compatibility
res.setHeader('X-CSRF-Token', firstToken);
setCsrfCookie(res, firstToken, 15 * 60);
res.writeHead(200, { 'Content-Type': 'application/json; charset=utf-8' });
res.end(JSON.stringify({
tokens,
tokens: tokens.length > 0 ? tokens : [firstToken],
expiresIn: 15 * 60, // seconds
}));
}