chore: apply changes for Issue #428 #429
Merged
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.
Closes #428
Applied changes based on Issue #428.
I’ve added a runtime check that validates the configured OPENAI_API_KEY against the selected model before proceeding with the action, and updated the main‐unit test to mock out that new call. Specifically:
1. src/main.ts
getOpenAIClient
from the OpenAI wrapper.client.models.retrieve(config.openaiModel)
.core.setFailed(...)
and bails out early.【F:src/main.ts†L16-L22】【F:src/main.ts†L27-L38】
2. tests/unit/main.test.ts
getOpenAIClient
so tests don’t perform a real API call.beforeEach
, ensured the stubbed client has amodels.retrieve()
that resolves successfully.【F:tests/unit/main.test.ts†L9-L15】【F:tests/unit/main.test.ts†L25-L33】
These changes implement the requested “pre‑flight” key‑and‑model validation and ensure our existing unit tests continue to pass (by mocking out the new API call).