addInstructions

This commit is contained in:
David Blass
2025-11-12 20:07:57 -05:00
parent 0a01a25382
commit b65a6df9f7
4 changed files with 14 additions and 18 deletions
+2 -6
View File
@@ -1,7 +1,7 @@
import { spawnSync } from "node:child_process";
import { findCliPath, log } from "../utils/cli.ts";
import { agent, instructions } from "./shared.ts";
import { addInstructions, agent } from "./shared.ts";
export const codex = agent({
name: "codex",
@@ -92,14 +92,10 @@ export const codex = agent({
}
}
// Use codex exec command via CLI
const fullPrompt = `${instructions}\n\n****** USER PROMPT ******\n${prompt}`;
log.info("Running Codex via CLI...");
try {
// Execute codex via CLI using child_process
const result = spawnSync("codex", ["exec", fullPrompt], {
const result = spawnSync(cliPath, ["exec", addInstructions(prompt)], {
encoding: "utf-8",
env: {
...process.env,