fix(kiro): map GPT reasoning effort fields

GPT-5.6 via Kiro needs reasoning.effort while Claude uses output_config.effort.
Resolve the effort path per-model schema (like Kiro CLI/KAS) so GPT-5.6
receives the correct structured thinking level. Claude path unchanged.

- Add resolveKiroEffortPath returning "reasoning" | "output_config" | null
- buildKiroAdditionalModelRequestFields emits schema-specific shape
- Keep prompt tags for backward compatibility
- Add OpenAI/Claude translator coverage for GPT-5.6 effort mapping
This commit is contained in:
Edison42
2026-07-19 13:33:25 +07:00
committed by decolua
parent 43d4abbcf2
commit eb00222c4f
4 changed files with 74 additions and 13 deletions

View File

@@ -511,12 +511,10 @@ function convertMessages(messages, tools, model) {
* Kiro's 2-3 minute server timeout. The suffix is stripped before being
* sent upstream.
*
* 2. Thinking / reasoning. Kiro does not accept `thinking.type` or
* `reasoning_effort` natively. The only way to enable reasoning is to
* inject `<thinking_mode>enabled</thinking_mode>` into the user content
* sent upstream. Detection covers Anthropic-Beta header, Claude API
* 2. Thinking / reasoning. Detection covers Anthropic-Beta header, Claude API
* `thinking`, OpenAI `reasoning_effort`, AMP/Cursor magic tags, and model
* name hints.
* name hints. Kiro's prompt tags remain for compatibility, while supported
* models also receive the same schema-specific effort fields as Kiro CLI.
*/
export function openaiToKiroRequest(model, body, stream, credentials) {
const messages = body.messages || [];