Add Unit Tests for OpenAI Reasoning and Standard Requests
維護者通常 1 天內回覆
還沒有人認領這個 Issue。
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 84/100
- Issue 類型
- 功能
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- typescript
- 領域
- testing
研究方向
從packages/models/src/providers/openai.ts開始,找出現有的測試檔案和 OpenAI provider 的測試命令設定。為推理模型和標準模型新增請求結構測試,包含偵測和reasoning_effort相關案例。測試納入npm test,且列出的型別檢查、測試和 lint 命令都通過後,即代表完成。
由索引模型根據 Issue 內容生成。
描述
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
- 主要語言
- TypeScript
- 星號
- 125
- 分支
- 23
- 平均合併
- 2 天 13 小時
- 30 天內合併 PR
- 12
環境準備
- 提供 Dockerfile 或 Docker Compose 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
devarshishimpi/codra 的其他 Issue
-
bug good first issue
難度 2/5 1-3 小時 新手友好度 78/100
devarshishimpi/codra#176 ·
維護者通常 1 天內回覆
-
enhancement good first issue
難度 4/5 3-5 天 新手友好度 48/100
devarshishimpi/codra#186 ·
維護者通常 1 天內回覆
-
enhancement good first issue
難度 4/5 3-5 天 新手友好度 55/100
devarshishimpi/codra#185 ·
維護者通常 1 天內回覆
-
enhancement good first issue
難度 4/5 3-5 天 新手友好度 58/100
devarshishimpi/codra#184 ·
維護者通常 1 天內回覆
-
enhancement good first issue
難度 3/5 1-2 天 新手友好度 62/100
devarshishimpi/codra#183 ·
維護者通常 1 天內回覆
查看 devarshishimpi/codra 的全部 Issue
相似的 Issue
-
難度 1/5 1-3 小時 新手友好度 83/100
gofish-graphics/gofish-graphics#1384 ·
維護者通常 1 天內回覆
-
adapter bug
難度 2/5 1-3 小時 新手友好度 83/100
Olanetsoft/agent-lookout#353 ·
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
vicharanashala/vibe#1542 ·
維護者通常 1 天內回覆
-
bug chore P2 size:XS
難度 2/5 1-3 小時 新手友好度 77/100
josephfung/curia#2666 ·
維護者通常 1 天內回覆
-
area: batch
難度 2/5 1-3 小時 新手友好度 75/100
inabagumi/shinju-date#7294 ·
維護者通常 1 天內回覆