Skip to content

[Bug]: Kimi-K2.6 and other models incorrectly receives role: developer, causing 422 from Azure AI Foundry #257

@deancallaghan451

Description

@deancallaghan451

Description

Model incorrectly receives role: developer, causing 422 from Azure AI Foundry

Steps to reproduce

Using Microsoft AI Foundry models via OpenAI Chat API and sending any prompt.

Expected behavior

Models such as Kimi-K2.6 should use role: "system" — it is not a reasoning model.

Actual behavior

Version: v0.1.4
Provider: Azure AI Foundry (services.ai.azure.com/openai/v1)
Model: Kimi-K2.6

What happens:
Generating any design throws a 422 immediately:

Error invoking remote method 'codesign:v1:generate': CodesignError: 422 {"error":{"code":"Invalid input","status":422,"message":"invalid input error","details":[{"type":"enum","loc":["body","messages",0,"role"],"msg":"Input should be 'system', 'user', 'assistant' or 'tool'","input":"developer","ctx":{"expected":"'system', 'user', 'assistant' or 'tool'"}}]}}

Root cause:
Kimi-K2.6 and GPT 5.5 are being misidentified as a reasoning model, causing the provider layer to send role: "developer" instead of role: "system". Azure AI Foundry's Kimi deployment rejects developer as an invalid role.

v0.1.4 fixed this same issue for Qwen and DeepSeek (#183) but Kimi model names are not currently in the exclusion list.

Expected behaviour:
Kimi-K2.6 should use role: "system" — it is not a reasoning model.

Suggested fix:
Add Kimi model name patterns to the non-reasoning model exclusion list alongside Qwen and DeepSeek.

open-codesign version

0.1.4

Platform

macOS

OS version

25.3.0

Model provider (if relevant)

None

Error code

GENERATION_FAILED

Diagnostics bundle

Bundle saved locally at ~/Downloads/open-codesign-diagnostics-2026-04-29T04-47-29.zip. Attach it to this issue after submitting.

Logs

generationId: 'mojkpov4-1ld9gk',
  provider: 'custom-azure-kimik-2-6-njzu',
  modelId: 'Kimi-K2.6-2026-04-20'
}
[2026-04-29 14:47:14.573] [info]   (main:ipc) agent.turn_start { runId: 'mojkpov4-1ld9gk', generationId: 'mojkpov4-1ld9gk' }
[2026-04-29 14:47:14.574] [info]   (main:ipc) [context-prune] step=caps {
  runId: 'mojkpov4-1ld9gk',
  generationId: 'mojkpov4-1ld9gk',
  messages: 10,
  before: 10507,
  after: 10507,
  textLimit: 8192,
  toolInputLimit: 24576,
  toolResultLimit: 8192,
  window: 3
}
[2026-04-29 14:47:15.915] [info]   (main:ipc) agent.turn_end {
  runId: 'mojkpov4-1ld9gk',
  generationId: 'mojkpov4-1ld9gk',
  deltas: 0,
  tools: 0
}
[2026-04-29 14:47:15.915] [info]   (main:ipc) agent.end { runId: 'mojkpov4-1ld9gk', generationId: 'mojkpov4-1ld9gk' }
[2026-04-29 14:47:15.916] [error]  (main:ipc) [generate] step=send_request.fail {
  runId: 'mojkpov4-1ld9gk',
  generationId: 'mojkpov4-1ld9gk',
  provider: 'custom-azure-kimik-2-6-njzu',
  modelId: 'Kimi-K2.6-2026-04-20',
  ms: 1343,
  stopReason: 'error'
}
[2026-04-29 14:47:15.917] [error]  (main:ipc) generate.fail {
  runId: 'mojkpov4-1ld9gk',
  generationId: 'mojkpov4-1ld9gk',
  ms: 1358,
  provider: 'custom-azure-kimik-2-6-njzu',
  modelId: 'Kimi-K2.6-2026-04-20',
  baseUrl: '[url omitted]',
  status: 422,
  message: `422 {"error":{"code":"Invalid input","status":422,"message":"invalid input error","details":[{"type":"enum","loc":["body","messages",0,"role"],"msg":"Input should be 'system', 'user', 'assistant' or 'tool'","input":"developer","ctx":{"expected":"'system', 'user', 'assistant' or 'tool'"}}]}}\n` +
    'Please check this guide to understand why this error code might have been returned \n' +
    '[url omitted]',
  code: 'PROVIDER_ERROR'
}
[2026-04-29 14:47:15.924] [error]  (renderer:console) [store] applyGenerateError {"generationId":"mojkpov4-1ld9gk","designId":"6336f2f6-6633-4cd0-85da-42bfd16f6a5a","message":"Error invoking remote method 'codesign:v1:generate': CodesignError: 422 {\"error\":{\"code\":\"Invalid input\",\"status\":422,\"message\":\"invalid input error\",\"details\":[{\"type\":\"enum\",\"loc\":[\"body\",\"messages\",0,\"role\"],\"msg\":\"Input should be 'system', 'user', 'assistant' or 'tool'\",\"input\":\"developer\",\"ctx\":{\"expected\":\"'system', 'user', 'assistant' or 'tool'\"}}]}}\nPlease check this guide to understand why this error code might have been returned \n[url omitted]"} {}
[2026-04-29 14:47:15.926] [info]   (chat-messages-ipc) chat.append {
  designId: '6336f2f6-6633-4cd0-85da-42bfd16f6a5a',
  seq: 19,
  kind: 'error'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtriageAwaiting maintainer review

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions