Allow dynamic AgentRun provider profiles
This commit is contained in:
@@ -97,7 +97,8 @@ export const AGENTRUN_REUSABLE_CREDENTIAL_ENV_NAMES = Object.freeze([
|
||||
"UNIDESK_SSH_CLIENT_TOKEN"
|
||||
]);
|
||||
|
||||
const backendProfiles = Object.freeze(["codex", "deepseek", "minimax-m3", "ofcx-go"]);
|
||||
const backendProfileAliases = Object.freeze({ "codex-api": "codex", codex: "codex" });
|
||||
const backendProfileIdPattern = /^[a-z0-9][a-z0-9-]{0,63}$/u;
|
||||
const providerSecretKeys = Object.freeze(["auth.json", "config.toml"]);
|
||||
const reusableCredentialEnvNameSet = new Set(AGENTRUN_REUSABLE_CREDENTIAL_ENV_NAMES);
|
||||
|
||||
@@ -403,9 +404,11 @@ function unwrapAgentRunEnvelope(path, body) {
|
||||
}
|
||||
|
||||
function normalizeBackendProfile(value) {
|
||||
const profile = nonEmptyString(value, "backendProfile");
|
||||
if (!backendProfiles.includes(profile)) throw new Error(`unsupported AgentRun backendProfile ${JSON.stringify(profile)}`);
|
||||
return profile;
|
||||
const profile = nonEmptyString(value, "backendProfile").toLowerCase();
|
||||
if (profile === "runtime-default") throw new Error(`unsupported AgentRun backendProfile ${JSON.stringify(profile)}`);
|
||||
const normalized = backendProfileAliases[profile] || profile;
|
||||
if (!backendProfileIdPattern.test(normalized)) throw new Error(`unsupported AgentRun backendProfile ${JSON.stringify(profile)}`);
|
||||
return normalized;
|
||||
}
|
||||
|
||||
function fullCommitSha(value) {
|
||||
|
||||
Reference in New Issue
Block a user