fix(prometheus): prevent agent fallback to build in background tasks (#695)
This commit is contained in:
committed by
GitHub
parent
2314a0d371
commit
8d65748ad3
@@ -49,6 +49,8 @@ import { getSystemMcpServerNames } from "./features/claude-code-mcp-loader";
|
||||
import {
|
||||
setMainSession,
|
||||
getMainSessionID,
|
||||
setSessionAgent,
|
||||
clearSessionAgent,
|
||||
} from "./features/claude-code-session-state";
|
||||
import {
|
||||
builtinTools,
|
||||
@@ -428,11 +430,22 @@ const OhMyOpenCodePlugin: Plugin = async (ctx) => {
|
||||
setMainSession(undefined);
|
||||
}
|
||||
if (sessionInfo?.id) {
|
||||
clearSessionAgent(sessionInfo.id);
|
||||
await skillMcpManager.disconnectSession(sessionInfo.id);
|
||||
await lspManager.cleanupTempDirectoryClients();
|
||||
}
|
||||
}
|
||||
|
||||
if (event.type === "message.updated") {
|
||||
const info = props?.info as Record<string, unknown> | undefined;
|
||||
const sessionID = info?.sessionID as string | undefined;
|
||||
const agent = info?.agent as string | undefined;
|
||||
const role = info?.role as string | undefined;
|
||||
if (sessionID && agent && role === "user") {
|
||||
setSessionAgent(sessionID, agent);
|
||||
}
|
||||
}
|
||||
|
||||
if (event.type === "session.error") {
|
||||
const sessionID = props?.sessionID as string | undefined;
|
||||
const error = props?.error;
|
||||
|
||||
Reference in New Issue
Block a user