mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-29 04:25:52 +01:00
fix(e2e): authenticate native Codex automation
This commit is contained in:
1 parent
c6c0a431bf
commit
c3f3157a03
2 files changed
+33
-1
No files matched your search
@@ -64,6 +64,31 @@ describe("runner E2E catalog", () => {
|
||||
}
|
||||
});
|
||||
|
||||
it("binds native Codex automation auth to the encrypted OpenAI secret", () => {
|
||||
const execution = runnerMatrix.find(
|
||||
(candidate) => candidate.id === "runner-codex.local.message-marker",
|
||||
);
|
||||
expect(execution).toBeDefined();
|
||||
const secretRef = {
|
||||
type: "secret_ref" as const,
|
||||
secretId: "22222222-2222-4222-8222-222222222222",
|
||||
version: "latest" as const,
|
||||
};
|
||||
const agent = execution!.profile.buildAgent({
|
||||
environmentId: "11111111-1111-4111-8111-111111111111",
|
||||
environmentFixtureId: "local",
|
||||
workspacePath: "/tmp/runner-e2e-workspace",
|
||||
secretRefs: { OPENAI_API_KEY: secretRef },
|
||||
executionId: execution!.id,
|
||||
});
|
||||
expect(agent.adapterConfig).toMatchObject({
|
||||
env: {
|
||||
OPENAI_API_KEY: secretRef,
|
||||
CODEX_API_KEY: secretRef,
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
it("gives legacy planning agents a direct bounded API recipe", () => {
|
||||
const task = runnerTasks.find(
|
||||
(candidate) => candidate.id === "plan-revise-accept",
|
||||
|
||||
@@ -143,6 +143,7 @@ function nativeProfile(input: {
|
||||
provider: input.provider,
|
||||
},
|
||||
buildAgent(buildInput) {
|
||||
const credentialRef = requiredSecret(buildInput, input.credential);
|
||||
const permissionConfig =
|
||||
input.provider === "codex"
|
||||
? { codexPermissionMode: "never" }
|
||||
@@ -156,7 +157,13 @@ function nativeProfile(input: {
|
||||
idleTimeoutMs: 300_000,
|
||||
...permissionConfig,
|
||||
env: {
|
||||
[input.credential]: requiredSecret(buildInput, input.credential),
|
||||
[input.credential]: credentialRef,
|
||||
// Codex's supported automation credential is CODEX_API_KEY. Keep
|
||||
// OPENAI_API_KEY as the operator-facing fixture secret name and bind
|
||||
// the same encrypted reference to the runtime-specific alias.
|
||||
...(input.provider === "codex"
|
||||
? { CODEX_API_KEY: credentialRef }
|
||||
: {}),
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user