Skip to content

Enhance Anthropic message conversion and update model mappings - #244

Open
Harsh502s wants to merge 5 commits into
jwadow:mainfrom
Harsh502s:main
Open

Enhance Anthropic message conversion and update model mappings#244
Harsh502s wants to merge 5 commits into
jwadow:mainfrom
Harsh502s:main

Conversation

@Harsh502s

Copy link
Copy Markdown

Enhance Anthropic message conversion and update model mappings

Harsh502s and others added 4 commits June 9, 2026 20:34
…opic format

- Add support for system-role messages in Anthropic message arrays (non-standard but sent by Claude Code)
- Update convert_anthropic_messages() to return tuple of (inline_system_prompt, unified_messages)
- Extract system messages from message array and merge into explicit system prompt during conversion
- Update AnthropicMessage model to accept "system" role in addition to "user" and "assistant"
- Add alias resolution layer in get_model_id_for_kiro() to normalize model names before hidden model lookup
- Update convert_anthropic_tools() call site to unpack new tuple return value
- Update all test cases to handle new tuple return format from convert_anthropic_messages()
- Add debug logging for extracted inline system messages and resolved model aliases
feat(converters): extract and merge inline system messages from Anthr…
…allback models

- Add claude-sonnet-5 to HIDDEN_MODELS with internal mapping
- Add claude-opus-4.8 to HIDDEN_MODELS with internal mapping
- Add claude-sonnet-5 to FALLBACK_MODELS list
- Add claude-opus-4.8 to FALLBACK_MODELS list
- Improve HIDDEN_MODELS documentation with format clarification
- These newer model versions are available on Kiro but not advertised in /ListAvailableModels
@cla-bot

cla-bot Bot commented Jul 7, 2026

Copy link
Copy Markdown

Thanks for the PR! 🎉

Before merge, we need a one-time CLA confirmation.
It confirms that you have the right to contribute this code and allow the project to use it.

Full CLA text:
https://github.com/jwadow/kiro-gateway/blob/main/CLA.md

Please reply once with:

I have read the CLA and I accept its terms

You need to write once, all further messages from me can be ignored.

- Add _probe_model() function to check model availability via minimal API requests
- Add _probe_candidate_models() function to concurrently probe multiple models with semaphore limiting
- Replace static model list fetch with dynamic model discovery for all endpoints
- Import CANDIDATE_MODELS from config for probing against known model candidates
- Use model probing results to populate available models list at account initialization
- Log detailed information about available and unavailable models during discovery
- Handle various HTTP status codes intelligently (200=available, 4xx=unavailable, 5xx/429=optimistic, 403=assume exists)
- Add optimistic assumptions for timeouts and inconclusive responses to avoid false negatives
- Enables dynamic model discovery across both runtime and standard Kiro API endpoints
@cla-bot

cla-bot Bot commented Jul 11, 2026

Copy link
Copy Markdown

Thanks for the PR! 🎉

Before merge, we need a one-time CLA confirmation.
It confirms that you have the right to contribute this code and allow the project to use it.

Full CLA text:
https://github.com/jwadow/kiro-gateway/blob/main/CLA.md

Please reply once with:

I have read the CLA and I accept its terms

You need to write once, all further messages from me can be ignored.

@ankitcharolia

Copy link
Copy Markdown

@Harsh502s could you give a try to this gateway: https://github.com/ankitcharolia/kiro-gateway

It works quite well with All AI harness and actively being developed. The most important thing is that it is ACP compliant

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.

2 participants