sshinmen Claude commited on
Commit
9c9f6e8
·
1 Parent(s): d61bfcc

Update Kiro executor and SDK service

Browse files

- Update kiro_executor.go
- Update sdk/cliproxy/service.go

Co-Authored-By: Claude <noreply@anthropic.com>

internal/runtime/executor/kiro_executor.go CHANGED
@@ -104,6 +104,12 @@ var kiroModelMappings = map[string]string{
104
  // normalizeKiroModel normalizes model names for the Kiro API.
105
  func normalizeKiroModel(model string) string {
106
  model = strings.TrimSpace(model)
 
 
 
 
 
 
107
  // Normalize dashes: claude-sonnet-4-5 -> claude-sonnet-4.5
108
  model = regexp.MustCompile(`(\d)-(\d)`).ReplaceAllString(model, "${1}.${2}")
109
 
 
104
  // normalizeKiroModel normalizes model names for the Kiro API.
105
  func normalizeKiroModel(model string) string {
106
  model = strings.TrimSpace(model)
107
+
108
+ // Strip optional "kiro-" prefix (used for aliasing in model list)
109
+ if strings.HasPrefix(model, "kiro-") {
110
+ model = strings.TrimPrefix(model, "kiro-")
111
+ }
112
+
113
  // Normalize dashes: claude-sonnet-4-5 -> claude-sonnet-4.5
114
  model = regexp.MustCompile(`(\d)-(\d)`).ReplaceAllString(model, "${1}.${2}")
115
 
sdk/cliproxy/service.go CHANGED
@@ -776,7 +776,17 @@ func (s *Service) registerModelsForAuth(a *coreauth.Auth) {
776
  models = applyExcludedModels(models, excluded)
777
  case "kiro":
778
  models = registry.GetKiroModels()
779
- models = applyExcludedModels(models, excluded)
 
 
 
 
 
 
 
 
 
 
780
  default:
781
  // Handle OpenAI-compatibility providers by name using config
782
  if s.cfg != nil {
 
776
  models = applyExcludedModels(models, excluded)
777
  case "kiro":
778
  models = registry.GetKiroModels()
779
+ // Prefix Kiro models with "kiro-" alias
780
+ prefixed := make([]*registry.ModelInfo, 0, len(models))
781
+ for _, m := range models {
782
+ clone := *m
783
+ clone.ID = "kiro-" + m.ID
784
+ if clone.Name != "" {
785
+ clone.Name = "kiro-" + m.Name
786
+ }
787
+ prefixed = append(prefixed, &clone)
788
+ }
789
+ models = applyExcludedModels(prefixed, excluded)
790
  default:
791
  // Handle OpenAI-compatibility providers by name using config
792
  if s.cfg != nil {