have payload.agent take precedence over inputs.defaultAgent

This commit is contained in:
Colin McDonnell
2025-11-20 16:58:21 -08:00
parent b460bd3109
commit dd2089d71b
5 changed files with 34 additions and 15 deletions
+4 -1
View File
@@ -21,9 +21,12 @@ export async function run(prompt: string): Promise<AgentResult> {
const originalCwd = process.cwd();
process.chdir(tempDir);
// check if prompt is a pullfrog payload and extract agent
// note: agent from payload will be used by determineAgent with highest precedence
// we don't need to extract it here since main() will parse the payload
const inputs: Required<Inputs> = {
prompt,
agent: "codex",
defaultAgent: undefined,
...flatMorph(agents, (_, agent) =>
agent.apiKeyNames.map((inputKey) => [inputKey, process.env[inputKey.toUpperCase()]])
),