mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-12 16:22:54 +00:00
perf(gateway): overlap chat catalog startup
Start optional model catalog loading earlier during chat history/startup hydration so catalog discovery overlaps history projection without changing the metadata contract. The response still awaits catalog-backed session/default/agents metadata before replying. Verification: - git diff --check - autoreview local caught and rejected the short-timeout variant; fixed to overlap-only - autoreview commit clean - Testbox tbx_01kt6edf5d328vqr43epy0cs0b targeted gateway/UI shards passed - Testbox tbx_01kt6eh4fk409g4ar1kpa0edhz check:changed lanes core, coreTests passed
This commit is contained in:
@@ -2540,6 +2540,14 @@ async function handleChatHistoryRequest({
|
||||
respond(false, undefined, errorShape(ErrorCodes.INVALID_REQUEST, selectedAgent.error));
|
||||
return;
|
||||
}
|
||||
const modelCatalogPromise = measureDiagnosticsTimelineSpan(
|
||||
`gateway.${method}.model_catalog`,
|
||||
() => loadOptionalServerMethodModelCatalog(context, method),
|
||||
{
|
||||
config: cfg,
|
||||
phase: method,
|
||||
},
|
||||
);
|
||||
const sessionId = entry?.sessionId;
|
||||
const sessionAgentId = resolveSessionAgentId({
|
||||
sessionKey,
|
||||
@@ -2620,14 +2628,7 @@ async function handleChatHistoryRequest({
|
||||
`chat.history omitted oversized payloads placeholders=${placeholderCount} total=${chatHistoryPlaceholderEmitCount}`,
|
||||
);
|
||||
}
|
||||
const modelCatalog = await measureDiagnosticsTimelineSpan(
|
||||
`gateway.${method}.model_catalog`,
|
||||
() => loadOptionalServerMethodModelCatalog(context, method),
|
||||
{
|
||||
config: cfg,
|
||||
phase: method,
|
||||
},
|
||||
);
|
||||
const modelCatalog = await modelCatalogPromise;
|
||||
const sessionInfo = buildGatewaySessionInfo({
|
||||
cfg,
|
||||
storePath,
|
||||
|
||||
Reference in New Issue
Block a user