fix not working without router
This commit is contained in:
@@ -138,6 +138,12 @@ async function run(options: RunOptions = {}) {
|
||||
config?.Router?.longContext
|
||||
) {
|
||||
server.useMiddleware(router);
|
||||
} else {
|
||||
server.useMiddleware((req, res, next) => {
|
||||
req.provider = "default";
|
||||
req.body.model = config.OPENAI_MODEL;
|
||||
next();
|
||||
});
|
||||
}
|
||||
server.useMiddleware(formatRequest);
|
||||
|
||||
|
||||
@@ -18,13 +18,13 @@ export async function executeCodeCommand(args: string[] = []) {
|
||||
// Increment reference count when command starts
|
||||
incrementReferenceCount();
|
||||
|
||||
// Execute claude command
|
||||
const claudePath = process.env.CLAUDE_PATH || "claude";
|
||||
const claudeProcess = spawn(claudePath, args, {
|
||||
env,
|
||||
stdio: "inherit",
|
||||
shell: true
|
||||
});
|
||||
// Execute claude command
|
||||
const claudePath = process.env.CLAUDE_PATH || "claude";
|
||||
const claudeProcess = spawn(claudePath, args, {
|
||||
env,
|
||||
stdio: "inherit",
|
||||
shell: true
|
||||
});
|
||||
|
||||
claudeProcess.on("error", (error) => {
|
||||
console.error("Failed to start claude command:", error.message);
|
||||
|
||||
Reference in New Issue
Block a user