MCPcopy Create free account
hub / github.com/Quorinex/Kiro-Go / apiUpdateThinkingConfig

Method apiUpdateThinkingConfig

proxy/handler.go:3454–3486  ·  view source on GitHub ↗

apiUpdateThinkingConfig 更新 thinking 配置

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

3452 errors.Is(err, config.ErrDuplicateAPIKey) {
3453 w.WriteHeader(http.StatusConflict)
3454 } else {
3455 w.WriteHeader(http.StatusInternalServerError)
3456 }
3457 payload := map[string]string{"error": err.Error()}
3458 if len(rotatedRefreshToken) > 0 {
3459 if rotated := strings.TrimSpace(rotatedRefreshToken[0]); rotated != "" {
3460 // Microsoft may have already invalidated the original refresh token.
3461 // Surface the rotated value so operators can retry import without a
3462 // full interactive re-login.
3463 payload["rotatedRefreshToken"] = rotated
3464 payload["hint"] = "The identity provider rotated the refresh token before persistence failed; retry import with rotatedRefreshToken"
3465 }
3466 }
3467 json.NewEncoder(w).Encode(payload)
3468}
3469
3470func (h *Handler) apiStartBuilderIdLogin(w http.ResponseWriter, r *http.Request) {
3471 var req struct {
3472 Region string `json:"region"`
3473 }
3474 json.NewDecoder(r.Body).Decode(&req)
3475
3476 session, err := auth.StartBuilderIdLogin(req.Region)
3477 if err != nil {
3478 w.WriteHeader(500)
3479 json.NewEncoder(w).Encode(map[string]string{"error": err.Error()})
3480 return
3481 }
3482
3483 json.NewEncoder(w).Encode(map[string]interface{}{
3484 "sessionId": session.ID,
3485 "userCode": session.UserCode,
3486 "verificationUri": session.VerificationUri,
3487 "interval": session.Interval,
3488 })
3489}

Callers 1

handleAdminAPIMethod · 0.95

Calls 2

UpdateThinkingConfigFunction · 0.92
ErrorMethod · 0.80

Tested by

no test coverage detected