feat: Enable Environment Variable Support and Dynamic Model Selection#614
Open
philipz wants to merge 1 commit into
Open
feat: Enable Environment Variable Support and Dynamic Model Selection#614philipz wants to merge 1 commit into
philipz wants to merge 1 commit into
Conversation
…odel selection across templates and tests
|
@philipz is attempting to deploy a commit to the Matt Pocock's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
This Pull Request introduces robust environment variable management to the project using the dotenv library. These changes enhance the project's security and flexibility by allowing sensitive configurations, such as API keys and model selection, to be managed via a .env file rather than being hardcoded in source scripts.
Key Changes:
dotenv Integration: Added dotenv as a project dependency and integrated it into all main entry points (e.g., src/templates//main.mts, .sandcastle/.ts). The configuration is set to load variables specifically from .sandcastle/.env.
Dynamic Model Selection: Refactored orchestration scripts to use process.env.ANTHROPIC_MODEL for agent definition. Existing model names (like claude-opus-4-6) are preserved as default fallbacks to ensure backward compatibility.
Environment Template: Added .sandcastle/.env.example to provide a clear template for required variables, including ANTHROPIC_API_KEY, GH_TOKEN, and ANTHROPIC_MODEL.
Enhanced Security for Tests:
Updated test-vercel.ts to utilize process.env.VERCEL_OIDC_TOKEN for secure Vercel OIDC authentication.
Standardized all test utility scripts to honor environment-based configurations.
Unified Template Updates: Applied these changes consistently across all available templates (blank, parallel-planner, sequential-reviewer, etc.) for a cohesive developer experience.
Rationale:
Adopting environment variables aligns the project with 12-factor app best practices, making the codebase more portable across different development environments and CI/CD pipelines. It also empowers users to easily experiment with different LLM models by simply updating their local configuration without modifying the underlying orchestration logic.