Merge pull request #10115 from continuedev/nate/fix-hub-continue-dev-url

Fix cn check workers failing silently
This commit is contained in:
Nate Sesti 2026-02-02 02:15:24 -08:00 • committed by GitHub
commit ca44973220
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -8,16 +8,14 @@
import * as fs from "fs";
import type { ChatHistoryItem } from "core/index.js";
import {
initializeServices,
getService,
services,
SERVICE_NAMES,
} from "../../services/index.js";
import type { ModelServiceState } from "../../services/types.js";
import { streamChatResponse } from "../../stream/streamChatResponse.js";
import { constructSystemMessage } from "../../systemMessage.js";
import type { DiffContext } from "./diffContext.js";
import { captureWorktreeDiff } from "./worktree.js";
@ -133,14 +131,6 @@ export async function runCheckWorker(): Promise<void> {
throw new Error("Failed to initialize model service");
}
// Build system message
const systemMessage = await constructSystemMessage(
"auto",
config.options.rule,
undefined,
true, // headless
);
// Build the check prompt
const checkPrompt = buildCheckPrompt(config.diffContext);
@ -153,30 +143,20 @@ export async function runCheckWorker(): Promise<void> {
agentInstructions = loadLocalAgentInstructions(config.agentSource);
}
// Construct initial chat history
const chatHistory: ChatHistoryItem[] = [];
if (systemMessage) {
chatHistory.push({
message: { role: "user", content: systemMessage },
contextItems: [],
});
}
// Build the user prompt parts and add to ChatHistoryService
// so streamChatResponse picks them up via refreshChatHistoryFromService
const chatHistorySvc = services.chatHistory;
const promptParts: string[] = [];
if (agentInstructions) {
chatHistory.push({
message: {
role: "user",
content: `## Agent Instructions\n\n${agentInstructions}`,
},
contextItems: [],
});
promptParts.push(`## Agent Instructions\n\n${agentInstructions}`);
}
promptParts.push(checkPrompt);
chatHistory.push({
message: { role: "user", content: checkPrompt },
contextItems: [],
});
const userMessage = promptParts.join("\n\n");
chatHistorySvc.addUserMessage(userMessage);
const chatHistory = chatHistorySvc.getHistory();
// Collect agent text output
let agentOutput = "";