Skip to content

feat(pulumi): provider-aware config generation#113

Open
stepandel wants to merge 1 commit intofeature/AGE-148-expand-model-providersfrom
feature/AGE-150-provider-aware-config
Open

feat(pulumi): provider-aware config generation#113
stepandel wants to merge 1 commit intofeature/AGE-148-expand-model-providersfrom
feature/AGE-150-provider-aware-config

Conversation

@stepandel
Copy link
Owner

Summary

Makes generateConfigPatchScript() and the cloud-init script provider-aware, using MODEL_PROVIDERS to determine the correct env var for each provider instead of hardcoding ANTHROPIC_API_KEY.

Changes

  • packages/pulumi/src/components/config-generator.ts — Provider-aware env var block in generated Python script
  • packages/pulumi/src/components/cloud-init.ts — New modelProvider field in CloudInitConfig, provider-aware bashrc exports

Behavior

  • Anthropic — Unchanged. OAuth detection (sk-ant-oat) still works.
  • OpenAI — Sets OPENAI_API_KEY
  • Google — Sets GOOGLE_API_KEY
  • OpenRouter — Sets OPENROUTER_API_KEY

Note: The API key is still passed through the ANTHROPIC_API_KEY cloud-init variable for transport (backward compat), but exported to the correct env var name on the target machine.

Depends on: #111 (AGE-148)
Closes AGE-150

- config-generator uses MODEL_PROVIDERS to set correct env var per provider
- Anthropic OAuth detection preserved only for Anthropic provider
- cloud-init exports correct env var name for non-Anthropic providers
- CloudInitConfig gains optional modelProvider field

Closes AGE-150
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 23, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/AGE-150-provider-aware-config

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@stepandel
Copy link
Owner Author

🔍 QA Review — APPROVED

All acceptance criteria for AGE-150 verified against the diff:

  • generateConfigPatchScript() sets correct env var based on provider via MODEL_PROVIDERS[provider].envVar
  • ✅ Anthropic OAuth detection (sk-ant-oat) preserved only for Anthropic provider path
  • ✅ Non-Anthropic providers get simple config["env"] = {envVar: key} pattern
  • ✅ Cloud-init passes correct env var name — modelProvider field added to CloudInitConfig
  • ✅ Bashrc exports use provider-aware env var for non-Anthropic providers
  • ✅ Backward compat: anthropicApiKey field retained for transport, re-mapped on target
  • ✅ Build passes clean (tsc --noEmit on both core and pulumi)
  • ✅ All 26 tests pass

Ship it 🚢

@stepandel
Copy link
Owner Author

🔍 QA — APPROVED by Scout

Build: ✅ clean
Tests: ✅ 45/45 passed (4 test files)
Diff reviewed against ticket acceptance criteria: ✅

Ship it 🚢

Copy link
Owner Author

@stepandel stepandel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 QA Review — APPROVED

All acceptance criteria verified against the diff. Build passes clean. All 45 tests pass (including new constants.test.ts).

Ship it 🚢

@stepandel
Copy link
Owner Author

🔍 QA Review — Approved

AGE-150: Provider-aware config generation. Correct env var branching, Anthropic OAuth preserved. Build+tests pass.

Tested by Scout (automated QA) — build, tests, and acceptance criteria verified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant