refactor: replace process.env with getEnvOptions() in graphile-llm#1011
Merged
pyramation merged 2 commits intomainfrom Apr 19, 2026
Merged
refactor: replace process.env with getEnvOptions() in graphile-llm#1011pyramation merged 2 commits intomainfrom
pyramation merged 2 commits intomainfrom
Conversation
- Add LlmOptions type to @constructive-io/graphql-types (llm.ts) - Add EMBEDDER_*/CHAT_* env var parsing to @constructive-io/graphql-env - Update embedder.ts and chat.ts to use getEnvOptions() instead of process.env - Add @constructive-io/graphql-env as dependency of graphile-llm
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
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.
Summary
Migrates
graphile-llm'sbuildEmbedderFromEnv()andbuildChatCompleterFromEnv()from directprocess.envreads to the repo-standardgetEnvOptions()system from@constructive-io/graphql-env. This ensures LLM config follows the same merge hierarchy (pgpm defaults → config file → env vars → overrides) used by all other Constructive packages.Changes across 3 packages:
@constructive-io/graphql-types: NewLlmOptions/LlmEmbedderOptions/LlmChatOptionsinterfaces; addedllm?: LlmOptionstoConstructiveOptions@constructive-io/graphql-env: ParsesEMBEDDER_PROVIDER,EMBEDDER_MODEL,EMBEDDER_BASE_URL,CHAT_PROVIDER,CHAT_MODEL,CHAT_BASE_URLinto the structuredllmconfig objectgraphile-llm:embedder.tsandchat.tsnow callgetEnvOptions()instead of readingprocess.envdirectly; added@constructive-io/graphql-envas a dependencyReview & Testing Checklist for Human
buildEmbedderFromEnv/buildChatCompleterFromEnvtests still setprocess.envdirectly. This works becausegetEnvOptions()reads fromprocess.envunder the hood, but confirm no config file in the test environment interferes (sincegetEnvOptionsnow also callsloadConfigSync(cwd))(EMBEDDER_PROVIDER || CHAT_PROVIDER)means setting onlyEMBEDDER_MODELorCHAT_BASE_URLwithout a provider will silently produce nollmconfig. Confirm this is the desired behavior vs. raising a warninggraphql/env/__tests__/from the newllmfield on the return typeNotes
pnpm-lock.yamldiff is mostly YAML formatting noise (single-line vs multi-line resolution fields) — the only semantic change is the new@constructive-io/graphql-envworkspace link forgraphile-llmgetGraphQLEnvVarsLLM parsing itself — existing tests exercise it indirectly through thegraphile-llmtest suiteLink to Devin session: https://app.devin.ai/sessions/720693f565cc4b8fb4b198ddf75814cc
Requested by: @pyramation