Add Unit Tests for OpenAI Reasoning and Standard Requests
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 84/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- testing
Research direction
Start with packages/models/src/providers/openai.ts and find the existing test files and test command configuration for the OpenAI provider. Add request-shape tests for reasoning and standard models, including detection and reasoning_effort cases. Done means the tests are included in npm test and the listed typecheck, test, and lint commands pass.
Written by the indexing model from the issue text.
Description
Goal
Add unit tests covering both the reasoning-model and standard-model request construction paths in the OpenAI adapter (packages/models/src/providers/openai.ts).
Background
The OpenAI adapter is gaining conditional request payloads for reasoning models (see sibling sub-issues). The branching logic (which parameters are sent for which model family) is exactly the kind of code that silently regresses, so it needs dedicated test coverage.
This sub-issue is part of the parent issue: OpenAI adapter incompatible with reasoning models.
What to Test
isOpenAIReasoningModelreturns true foro1,o3,o3-mini,o4-mini, andgpt-6style identifiersisOpenAIReasoningModelreturns false forgpt-4o,gpt-4o-mini,gpt-5, and custom-named models- Reasoning model payloads contain
max_completion_tokens, notemperature, nomax_tokens, and userole: "developer"for the system prompt - Standard model payloads contain
temperatureandmax_tokensas before reasoning_effortmapping: numeric budget thresholds (low/medium/high), string passthrough, and absent-budget omissionresponse_formatstays{ type: "json_object" }in both branches
Done When
- Unit tests cover the detection helper for both true and false cases
- Unit tests cover both payload branches with request-shape assertions
- Unit tests cover all
reasoning_effortmapping cases and the absent-budget case - Tests run as part of the existing
npm testsuite -
npm run typecheck,npm test, andnpm run lintall pass
- Dominant language
- TypeScript
- Stars
- 125
- Forks
- 23
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 12
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from devarshishimpi/codra
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
devarshishimpi/codra#176 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 4/5 3-5 days Newbie friendliness 48/100
devarshishimpi/codra#186 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 4/5 3-5 days Newbie friendliness 55/100
devarshishimpi/codra#185 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 4/5 3-5 days Newbie friendliness 58/100
devarshishimpi/codra#184 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 3/5 1-2 days Newbie friendliness 62/100
devarshishimpi/codra#183 ·
Maintainers usually reply within 1 day
All issues in devarshishimpi/codra
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 83/100
gofish-graphics/gofish-graphics#1384 ·
Maintainers usually reply within 1 day
-
adapter bug
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Olanetsoft/agent-lookout#353 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
vicharanashala/vibe#1542 ·
Maintainers usually reply within 1 day
-
bug chore P2 size:XS
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
josephfung/curia#2666 ·
Maintainers usually reply within 1 day
-
area: batch
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
inabagumi/shinju-date#7294 ·
Maintainers usually reply within 1 day