paperclipai/paperclip · error · Error

${profile} requires ${missingCredentials.join(", ")} in the

Error message

${profile} requires ${missingCredentials.join(", ")} in the smoke process environment

What it means

After resolving the live candidate, the script collects each name in candidate.qualification.requiredEnvironment from the ambient process environment. If any required variable is absent or empty/whitespace, it throws this error listing exactly which variables are missing for that profile. The smoke refuses to run live providers without their credentials.

Source

Thrown at packages/paperclip-runner/scripts/run-local-provider-smoke.mjs:260

  } = await import("../dist/eval/index.js");
  const candidates = new Map(
    profiles.map((profile) => [
      profile,
      liveCandidate(profile, RUNNER_LIVE_CANDIDATE_SLOTS),
    ]),
  );
  const credentialsByProfile = new Map();
  for (const [profile, candidate] of candidates) {
    if (!candidate) throw new Error(`Missing live candidate for ${profile}`);
    const missingCredentials = [];
    const profileCredentials = {};
    for (const name of candidate.qualification.requiredEnvironment) {
      const value = ambientEnvironment[name]?.trim();
      if (value) profileCredentials[name] = value;
      else missingCredentials.push(name);
    }
    if (missingCredentials.length > 0) {
      throw new Error(
        `${profile} requires ${missingCredentials.join(", ")} in the smoke process environment`,
      );
    }
    credentialsByProfile.set(profile, profileCredentials);
  }
  const providerCredentialNames = new Set(
    [...credentialsByProfile.values()].flatMap((credentials) =>
      Object.keys(credentials),
    ),
  );
  const credentialValues = new Set(
    [...credentialsByProfile.values()].flatMap((credentials) =>
      Object.values(credentials),
    ),
  );
  const evalCase = runnerWorkflowCase("completion-robustness");
  for (const profile of profiles) {
    const candidate = candidates.get(profile);

View on GitHub (pinned to 01ad858492)

Solutions

  1. Export the listed variables before running, e.g. `ANTHROPIC_API_KEY=... pnpm smoke:local-provider -- --profile runner-acpx-claude`.
  2. Source your credentials file in the same shell (the script reads process.env, not .env files).
  3. Verify variable names match candidate.qualification.requiredEnvironment exactly (case-sensitive).

Example fix

// before
pnpm smoke:local-provider -- --profile runner-acpx-claude
// after
export ANTHROPIC_API_KEY=sk-...
pnpm smoke:local-provider -- --profile runner-acpx-claude
Defensive patterns

Strategy: validation

Validate before calling

const required = ['ANTHROPIC_API_KEY']; // per profile
const missing = required.filter(k => !process.env[k]?.trim());
if (missing.length) { console.error(`missing: ${missing}`); process.exit(1); }

Try / catch

try { runSmoke(); } catch (e) { if (e.message.includes('requires') && e.message.includes('in the smoke process environment')) { console.error('export the listed vars and rerun'); } else throw e; }

Prevention

When it happens

Trigger: Running the smoke for a profile whose candidate requires env vars (e.g. ANTHROPIC_API_KEY) that are unset, empty, or whitespace-only in the shell invoking pnpm.

Common situations: Forgetting to export credentials in the current shell, using a .env file the script does not load, running under CI where secrets were not injected, or typos in the variable name.

Understand the failure class

Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.

Related errors


AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-09-10). Data as JSON: /api/errors/399876b8826a8fc6. Report an issue: GitHub.