-
-
Notifications
You must be signed in to change notification settings - Fork 29
fix(sdk): reject Cloudflare-native model IDs, bridge multi-part auth env vars #397
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
c7f30c8
6f5bf47
ff3a2c2
c99f435
89a4d61
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,8 +7,12 @@ import type { SkillDefinition, WardenConfig, Effort } from '../config/schema.js' | |
| import { verifyAuth, type WardenAuthenticationError, type SkillRunnerOptions, type ChunkAnalysisResult } from '../sdk/runner.js'; | ||
| import { | ||
| findInvalidPiModelSelector as findInvalidPiModelSelectorTarget, | ||
| findMissingCloudflareEnv, | ||
| invalidPiModelSelectorMessage, | ||
| missingCloudflareEnvMessage, | ||
| piModelSelectorTip, | ||
| type InvalidPiModelSelector, | ||
| type MissingCloudflareEnv, | ||
| } from '../sdk/runtimes/model-selectors.js'; | ||
| import { mapExtractionErrorCode } from '../sdk/errors.js'; | ||
| import { aggregateAuxiliaryUsageAttribution, mergeAuxiliaryUsage } from '../sdk/usage.js'; | ||
|
|
@@ -732,7 +736,25 @@ export function findInvalidPiModelSelector( | |
|
|
||
| function reportInvalidPiModelSelector(reporter: Reporter, invalid: InvalidPiModelSelector): void { | ||
| reporter.error(invalidPiModelSelectorMessage(invalid)); | ||
| reporter.tip('Set a Pi model selector such as anthropic/claude-sonnet-4-6.'); | ||
| reporter.tip(piModelSelectorTip(invalid.model)); | ||
| } | ||
|
|
||
| function reportMissingCloudflareEnv(reporter: Reporter, missing: MissingCloudflareEnv): void { | ||
| reporter.error(missingCloudflareEnvMessage(missing)); | ||
| const tip = missing.missing.map((v) => `export WARDEN_${v}=...`).join(' '); | ||
| reporter.tip(tip); | ||
| } | ||
|
|
||
| function emitMissingCloudflareEnvRunLog( | ||
| repoPath: string, | ||
| options: CLIOptions, | ||
| missing: MissingCloudflareEnv, | ||
| ): void { | ||
| emitEmptyRunLog(repoPath, options, { | ||
| code: 'auth_failed', | ||
| message: missingCloudflareEnvMessage(missing), | ||
| timestamp: new Date().toISOString(), | ||
| }); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missing Cloudflare env mislabeled authMedium Severity When required Cloudflare account or gateway variables are absent, the CLI writes an empty run log with code Reviewed by Cursor Bugbot for commit 89a4d61. Configure here. |
||
| } | ||
|
|
||
| function emitInvalidPiModelSelectorRunLog( | ||
|
|
@@ -1188,6 +1210,12 @@ export async function runSkills( | |
| emitInvalidPiModelSelectorRunLog(repoPath ?? cwd, options, invalidModelSelector); | ||
| return 1; | ||
| } | ||
| const missingCloudflare = findMissingCloudflareEnv(specs.map((s) => ({ ...s.runnerOptions }))); | ||
| if (missingCloudflare) { | ||
| reportMissingCloudflareEnv(reporter, missingCloudflare); | ||
| emitMissingCloudflareEnvRunLog(repoPath ?? cwd, options, missingCloudflare); | ||
| return 1; | ||
|
cursor[bot] marked this conversation as resolved.
|
||
| } | ||
| let tasks: SkillTaskOptions[]; | ||
| const concurrency = options.parallel ?? DEFAULT_CONCURRENCY; | ||
| try { | ||
|
|
@@ -1518,6 +1546,12 @@ async function runConfigMode(options: CLIOptions, reporter: Reporter): Promise<n | |
| emitInvalidPiModelSelectorRunLog(repoPath, options, invalidModelSelector); | ||
| return 1; | ||
| } | ||
| const missingCloudflare = findMissingCloudflareEnv(specs.map((s) => ({ ...s.runnerOptions }))); | ||
|
cursor[bot] marked this conversation as resolved.
|
||
| if (missingCloudflare) { | ||
| reportMissingCloudflareEnv(reporter, missingCloudflare); | ||
| emitMissingCloudflareEnvRunLog(repoPath, options, missingCloudflare); | ||
| return 1; | ||
| } | ||
| let tasks: SkillTaskOptions[]; | ||
| const concurrency = options.parallel ?? config.runner?.concurrency ?? DEFAULT_CONCURRENCY; | ||
| try { | ||
|
|
||


There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cloudflare preflight uses generic Error
Medium Severity
Missing Cloudflare env preflight throws a plain
Errorinstead of a typed error with a stable code.captureActionTriggerErrorclassifies that asunknown, so CI failures for unset account or gateway IDs are not grouped likeinvalid_model_selectorpreflight errors.Additional Locations (1)
packages/warden/src/action/workflow/schedule.ts#L181-L184Reviewed by Cursor Bugbot for commit 89a4d61. Configure here.