aKode fase 3: provider locali, chiavi per provider, modelli dal server, SearXNG
- Provider: rimossi openai, Bedrock e GCP integrati e ogni fallback a OpenAI;
restano ollama, lmstudio e i provider personalizzati. Senza provider, exec e
TUI mostrano come configurarlo.
- Chiave per provider: api_key = "keyring", provider_api_key_store =
auto|keyring|file (fallback su file 0600 / ACL Windows); `codex login
--provider <id> --with-api-key`, `logout --provider`; login status e doctor
mostrano dove sta la chiave senza rivelarla.
- Modelli letti da GET {base_url}/models; contesto da config, poi dal server
(/props, meta.n_ctx), poi 32768; apply_patch come tool function; niente tool
ospitati; niente piu' avviso "metadata not found".
- Unione dei soli messaggi system/developer iniziali in un unico system;
quelli successivi restano al loro posto come user (cache del server
preservata: turno N prefisso esatto del turno N+1).
- Modelli ausiliari (memorie, guardian-v2) = modello di sessione se il
preferito gpt-* non e' nel catalogo.
- Ricerca web: crate web-tools, backend SearXNG con web_search e web_fetch
(protezione SSRF); senza backend nessuno strumento web.
- Skill: rimossa openai-docs; skill-installer punta a git.difonzo.net.
- apply_patch accetta gli header @@ -a,b +c,d @@ dei diff unificati.
- Rimossi resti: request_plugin_install, AppsInstructions, --cyber-access-program,
URL updater/realtime predefiniti.
- Fix: importazione sessioni con provider vuoto.
- Istruzioni di sistema invariate. Test: cancellati solo quelli del codice
rimosso, test di sicurezza adattati; restano solo fallimenti d'ambiente.
- Prova reale su imeAI + SearXNG: risposta, modifica file, web_search,
cache riusata, connessioni solo verso .25 e .57.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -6,7 +6,6 @@ import { createRequire } from "node:module";
|
||||
|
||||
import type { CodexConfigObject, CodexConfigValue } from "./codexOptions";
|
||||
import { SandboxMode, ModelReasoningEffort, ApprovalMode, WebSearchMode } from "./threadOptions";
|
||||
import type { CyberAccessProgram } from "./turnOptions";
|
||||
|
||||
export type CodexExecArgs = {
|
||||
input: string;
|
||||
@@ -29,8 +28,6 @@ export type CodexExecArgs = {
|
||||
skipGitRepoCheck?: boolean;
|
||||
// --output-schema
|
||||
outputSchemaFile?: string;
|
||||
// --cyber-access-program
|
||||
cyberAccessProgram?: CyberAccessProgram;
|
||||
// --config model_reasoning_effort
|
||||
modelReasoningEffort?: ModelReasoningEffort;
|
||||
// AbortSignal to cancel the execution
|
||||
@@ -143,9 +140,6 @@ export class CodexExec {
|
||||
commandArgs.push("--output-schema", args.outputSchemaFile);
|
||||
}
|
||||
|
||||
if (args.cyberAccessProgram !== undefined) {
|
||||
commandArgs.push("--cyber-access-program", args.cyberAccessProgram);
|
||||
}
|
||||
|
||||
if (args.modelReasoningEffort) {
|
||||
commandArgs.push("--config", `model_reasoning_effort="${args.modelReasoningEffort}"`);
|
||||
|
||||
@@ -37,4 +37,4 @@ export type {
|
||||
ModelReasoningEffort,
|
||||
WebSearchMode,
|
||||
} from "./threadOptions";
|
||||
export type { CyberAccessProgram, TurnOptions } from "./turnOptions";
|
||||
export type { TurnOptions } from "./turnOptions";
|
||||
|
||||
@@ -86,7 +86,6 @@ export class Thread {
|
||||
workingDirectory: options?.workingDirectory,
|
||||
skipGitRepoCheck: options?.skipGitRepoCheck,
|
||||
outputSchemaFile: schemaPath,
|
||||
cyberAccessProgram: turnOptions.cyberAccessProgram,
|
||||
modelReasoningEffort: options?.modelReasoningEffort,
|
||||
signal: turnOptions.signal,
|
||||
networkAccessEnabled: options?.networkAccessEnabled,
|
||||
|
||||
@@ -1,11 +1,4 @@
|
||||
export type CyberAccessProgram = "standard" | "daybreak_blue" | "daybreak_red";
|
||||
|
||||
export type TurnOptions = {
|
||||
/**
|
||||
* Experimental Cyber selection for this turn with the built-in OpenAI provider.
|
||||
* Omit to use server defaults.
|
||||
*/
|
||||
cyberAccessProgram?: CyberAccessProgram;
|
||||
/** JSON schema describing the expected agent output. */
|
||||
outputSchema?: unknown;
|
||||
/** AbortSignal to cancel the turn. */
|
||||
|
||||
@@ -229,48 +229,6 @@ describe("Codex", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("passes cyber access program selections only to the turns that specify them", async () => {
|
||||
const { url, close } = await startResponsesTestProxy({
|
||||
responseBodies: [
|
||||
sse(responseCompleted("response_1")),
|
||||
sse(responseCompleted("response_2")),
|
||||
sse(responseCompleted("response_3")),
|
||||
sse(responseCompleted("response_4")),
|
||||
],
|
||||
});
|
||||
const { args: spawnArgs, restore } = codexExecSpy();
|
||||
const { client, cleanup } = createMockClient(url);
|
||||
|
||||
try {
|
||||
const thread = client.startThread();
|
||||
await thread.run("select blue", { cyberAccessProgram: "daybreak_blue" });
|
||||
const threadId = thread.id;
|
||||
expect(threadId).toEqual(expect.any(String));
|
||||
|
||||
const streamed = await thread.runStreamed("select red", {
|
||||
cyberAccessProgram: "daybreak_red",
|
||||
});
|
||||
for await (const _ of streamed.events) {
|
||||
// Consume the streamed turn before resuming the thread.
|
||||
}
|
||||
await thread.run("select standard", { cyberAccessProgram: "standard" });
|
||||
await thread.run("use automatic selection");
|
||||
|
||||
expect(spawnArgs).toHaveLength(4);
|
||||
expectPair(spawnArgs[0], ["--cyber-access-program", "daybreak_blue"]);
|
||||
expectPair(spawnArgs[1], ["--cyber-access-program", "daybreak_red"]);
|
||||
expectPair(spawnArgs[2], ["--cyber-access-program", "standard"]);
|
||||
expect(spawnArgs[3]).not.toContain("--cyber-access-program");
|
||||
for (const args of spawnArgs.slice(1)) {
|
||||
expectPair(args, ["resume", threadId!]);
|
||||
}
|
||||
} finally {
|
||||
cleanup();
|
||||
restore();
|
||||
await close();
|
||||
}
|
||||
}, 15_000);
|
||||
|
||||
it.each(["high", "persistent"] as const)(
|
||||
"passes %s modelReasoningEffort to exec",
|
||||
async (effort) => {
|
||||
|
||||
Reference in New Issue
Block a user