Fix claude
This commit is contained in:
committed by
pullfrog[bot]
parent
02a498e0cb
commit
1f2f671be0
@@ -50,9 +50,6 @@ export const claude = agent({
|
|||||||
// install CLI at start of run
|
// install CLI at start of run
|
||||||
const cliPath = await installClaude();
|
const cliPath = await installClaude();
|
||||||
|
|
||||||
// Ensure API key is NOT in process.env - only pass via SDK's env option
|
|
||||||
delete process.env.ANTHROPIC_API_KEY;
|
|
||||||
|
|
||||||
// select model based on effort level
|
// select model based on effort level
|
||||||
const model = claudeEffortModels[ctx.effort];
|
const model = claudeEffortModels[ctx.effort];
|
||||||
log.info(`» using model: ${model} (effort: ${ctx.effort})`);
|
log.info(`» using model: ${model} (effort: ${ctx.effort})`);
|
||||||
@@ -63,8 +60,6 @@ export const claude = agent({
|
|||||||
log.info(`» disallowed tools: ${disallowedTools.join(", ")}`);
|
log.info(`» disallowed tools: ${disallowedTools.join(", ")}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pass secrets via SDK's env option only (not process.env)
|
|
||||||
// This ensures secrets are only available to Claude Code subprocess, not user code
|
|
||||||
const queryOptions: Options = {
|
const queryOptions: Options = {
|
||||||
permissionMode: "bypassPermissions" as const,
|
permissionMode: "bypassPermissions" as const,
|
||||||
disallowedTools,
|
disallowedTools,
|
||||||
|
|||||||
@@ -136852,7 +136852,6 @@ var claude = agent({
|
|||||||
install: installClaude,
|
install: installClaude,
|
||||||
run: async (ctx) => {
|
run: async (ctx) => {
|
||||||
const cliPath = await installClaude();
|
const cliPath = await installClaude();
|
||||||
delete process.env.ANTHROPIC_API_KEY;
|
|
||||||
const model = claudeEffortModels[ctx.effort];
|
const model = claudeEffortModels[ctx.effort];
|
||||||
log.info(`\xBB using model: ${model} (effort: ${ctx.effort})`);
|
log.info(`\xBB using model: ${model} (effort: ${ctx.effort})`);
|
||||||
const disallowedTools = buildDisallowedTools(ctx);
|
const disallowedTools = buildDisallowedTools(ctx);
|
||||||
|
|||||||
@@ -29,6 +29,10 @@ const JsonPayload = type({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// inputs schema - action inputs from core.getInput()
|
// inputs schema - action inputs from core.getInput()
|
||||||
|
// note: tool permissions use .or("undefined") because getInput() || undefined
|
||||||
|
// explicitly sets the property to undefined when empty, which is different from
|
||||||
|
// the property being absent. arktype's "prop?" means "optional to include" but
|
||||||
|
// if included, must match the type - so we need to explicitly allow undefined.
|
||||||
export const Inputs = type({
|
export const Inputs = type({
|
||||||
prompt: "string",
|
prompt: "string",
|
||||||
"effort?": Effort,
|
"effort?": Effort,
|
||||||
|
|||||||
Reference in New Issue
Block a user