Skip to content

pdd sync Opus run fails commands module because inner llm_invoke requires ANTHROPIC_API_KEY #1135

@Serhan-Asad

Description

@Serhan-Asad

Problem

The follow-up pdd sync job for #1128 failed after the original change job successfully created PR #1131.

The sync job succeeded for 7 modules, but the commands module failed because an inner llm_invoke path required ANTHROPIC_API_KEY, which was not present in the subprocess environment.

Evidence

Final module result from Cloud Run logs:

Status: Failed
Message: Failed: ['commands']. Succeeded: ['jobs', 'models', 'track_cost', 'cost_budget_watcher', 'budget_settings', 'slash_command_parser', 'budget_comments'].
commands: │ Total time: 232.02s | Total cost: $0.8077 | Overall status: Failed │
ERROR: API key 'ANTHROPIC_API_KEY' not set. In --force mode, skipping interactive prompt.
Cost: $50.0924
Model: anthropic

The attribution payload inside the failed module showed:

PDD_AGENTIC_PROVIDER=anthropic
PDD_MODEL_DEFAULT=vertex_ai/gemini-3.5-flash
CLAUDE_CODE_USE_VERTEX=0
GOOGLE_CLOUD_PROJECT=prompt-driven-development
CLOUD_RUN_EXECUTION=pdd-executor-job-opus-km4d6

The outer executor selected Opus/OAuth credentials earlier in the job:

Model override: claude-opus-4-7 (family=claude_cli)
Claude CLI model override: claude-opus-4-7
Trying credential: claude-oauth-v9

Expected behavior

An Opus GitHub App sync run should not fail an inner module because direct ANTHROPIC_API_KEY is absent if the executor is intentionally using Claude OAuth credentials. The credential/model path used by pdd sync module generation should stay compatible with the selected executor credential path, or fail early with a clearer unsupported-credential error before spending work on other modules.

Actual behavior

The job did real work, generated/synced seven modules, then the overall pdd sync command exited 1 because only commands failed. No new commit was pushed to PR #1131; the PR head stayed at 5d5b435b8202ab464cf6c2ab285a1d61caa044ba.

Notes

This is related to provider/credential routing but appears distinct from #1113. #1113 is about a missing Vertex default causing cross-provider fallback. This failure happened under an Anthropic/Opus Cloud Run execution where the outer executor had Claude OAuth available, but the inner llm_invoke route still required direct ANTHROPIC_API_KEY.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions