feat: adapter model discovery, reasoning effort, and improved codex formatting

Add dynamic OpenAI model list fetching for codex adapter with caching,
async listModels interface, reasoning effort support for both claude and
codex adapters, optional timeouts (default to unlimited), wakeCommentId
context propagation, and richer codex stdout event parsing/formatting.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Forgotten
2026-02-20 10:32:07 -06:00
parent fdd2ea6157
commit 2c3c2cf724
19 changed files with 890 additions and 76 deletions

View File

@@ -7,13 +7,13 @@ export async function execute(ctx: AdapterExecutionContext): Promise<AdapterExec
if (!url) throw new Error("HTTP adapter missing url");
const method = asString(config.method, "POST");
const timeoutMs = asNumber(config.timeoutMs, 15000);
const timeoutMs = asNumber(config.timeoutMs, 0);
const headers = parseObject(config.headers) as Record<string, string>;
const payloadTemplate = parseObject(config.payloadTemplate);
const body = { ...payloadTemplate, agentId: agent.id, runId, context };
const controller = new AbortController();
const timer = setTimeout(() => controller.abort(), timeoutMs);
const timer = timeoutMs > 0 ? setTimeout(() => controller.abort(), timeoutMs) : null;
try {
const res = await fetch(url, {
@@ -23,7 +23,7 @@ export async function execute(ctx: AdapterExecutionContext): Promise<AdapterExec
...headers,
},
body: JSON.stringify(body),
signal: controller.signal,
...(timer ? { signal: controller.signal } : {}),
});
if (!res.ok) {
@@ -37,6 +37,6 @@ export async function execute(ctx: AdapterExecutionContext): Promise<AdapterExec
summary: `HTTP ${method} ${url}`,
};
} finally {
clearTimeout(timer);
if (timer) clearTimeout(timer);
}
}