Skip to content

fix(pi-kilocode): let detectCompat auto-detect supportsDeveloperRole for kilocode models - #16

Merged
sudosubin merged 2 commits into
sudosubin:mainfrom
iRonin:fix/developer-role-compat
Apr 12, 2026
Merged

sudosubin merged 2 commits into
sudosubin:mainfrom
iRonin:fix/developer-role-compat

Conversation

@iRonin

@iRonin iRonin commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Closes #15

Problem

toPiModel() hardcodes supportsDeveloperRole: false for all kilocode models. This overrides pi-ai's detectCompat() auto-detection, which would return true for the Kilo gateway URL (not in isNonStandard list).

The result: kilocode sends the system prompt as role: "system" for reasoning models, while direct OpenRouter sends role: "developer" for the same model. This causes observably different thinking/reasoning behaviour.

Verification

The Kilo gateway accepts role: "developer" — confirmed with a direct curl to https://api.kilo.ai/api/openrouter/chat/completions: HTTP 200, valid response.

Fix

Remove the supportsDeveloperRole: false override so detectCompat() handles it automatically. supportsStore: false and thinkingFormat: "openrouter" are kept as explicit overrides since detectCompat would get both wrong for the kilo.ai baseUrl (store unsupported; thinkingFormat would default to "openai" not "openrouter").

Tests

Updated existing test to assert supportsDeveloperRole === undefined (not set by toPiModel) with a comment explaining that the resolved value (true) is computed later by pi-ai's getCompat() which merges explicit compat with detectCompat() output. 19/19 tests passing.

@sudosubin sudosubin changed the title fix(models): let detectCompat auto-detect supportsDeveloperRole for kilocode models fix(pi-kilocode): let detectCompat auto-detect supportsDeveloperRole for kilocode models Apr 11, 2026
@sudosubin

Copy link
Copy Markdown
Owner

It seems like there are various changes mixed in the current branch. Could you please check it?

@iRonin

iRonin commented Apr 11, 2026

Copy link
Copy Markdown
Contributor Author

Sure thing :) sorry about that I had Pi working on my local install with a few features in and most likely did not respect "create a clean PR" instructions. Let's blame it on Antrophic :)

…for kilocode models

Remove the hardcoded supportsDeveloperRole: false override from toPiModel()
so pi-ai's detectCompat() handles it automatically. kilo.ai is not in
detectCompat's isNonStandard list, so the developer role is enabled,
matching direct OpenRouter behaviour.

Closes sudosubin#15
@iRonin
iRonin force-pushed the fix/developer-role-compat branch from 6630deb to 90217e4 Compare April 11, 2026 14:23
@iRonin

iRonin commented Apr 11, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for catching that — you're right, the branch had gotten messy with merged-in changes from other PRs. I've force-pushed a clean branch from origin/main with only the single fix: removing the hardcoded supportsDeveloperRole: false override so detectCompat handles it automatically.

The diff is now 2 files, 2 insertions, 2 deletions. All tests pass.

Comment thread pi-kilocode/src/provider/models.ts Outdated
@sudosubin
sudosubin merged commit 06c781b into sudosubin:main Apr 12, 2026
4 checks passed
@sudosubin

Copy link
Copy Markdown
Owner

This PR was released in pi-kilocode@0.1.2 via commit 06c781b. Thank you again for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

toPiModel hardcodes supportsDeveloperRole: false — causes different reasoning behaviour vs direct OpenRouter

2 participants