2 Commits

  • refactor: improve gemini bridge testability and code quality
    - Change createGeminiBridgeHandler to accept gin.HandlerFunc instead of *gemini.GeminiAPIHandler
      This allows tests to inject mock handlers instead of duplicating bridge logic
    - Replace magic number 8 with len(modelsPrefix) for better maintainability
    - Remove redundant test case that doesn't test edge case in production
    - Update routes.go to pass geminiHandlers.GeminiHandler directly
    
    Addresses PR review feedback on test architecture and code clarity.
    
    Amp-Thread-ID: https://ampcode.com/threads/T-1ae2c691-e434-4b99-a49a-10cabd3544db
  • fix(amp): pass mapped model to gemini bridge via context
    Gemini handler extracts model from URL path, not JSON body, so
    rewriting the request body alone wasn't sufficient for model mapping.
    
    - Add MappedModelContextKey constant for context passing
    - Update routes.go to use NewFallbackHandlerWithMapper
    - Add check for valid mapping before routing to local handler
    - Add tests for gemini bridge model mapping