发布

  • [OPIK-5020] [BE] feat: wire model registry into provider routing and add remote refresh (#5863)

    frostbyte_neo 发布于 2026-04-08 12:29:35 +00:00

    • [OPIK-5020] [BE] feat: wire model registry into provider routing and add remote refresh
    • Registry-first lookup in getLlmProvider() with enum fallback
    • New getStructuredOutputStrategy() on LlmProviderFactory encapsulating
      registry-based structured output resolution
    • Two-pass findModel() disambiguates VertexAI/Gemini by qualifiedName vs bare id
    • Remote YAML fetch via HttpClient with 30s timeout and URL scheme validation
    • ScheduledExecutorService refreshes registry from CDN on configurable interval
    • 3-tier merge: classpath defaults → remote CDN → local customer override
    • Remote fetch failure is non-fatal at every level (logs warning, keeps previous)
    • remoteEnabled defaults to false — zero behavior change for existing deployments

    Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

    • fix(registry): init httpClient before first load() so startup fetches remote

    • fix(registry): use JAX-RS Client and Quartz job per project conventions

    • Replace java.net.http.HttpClient with JAX-RS Client (injected via Guice)
      for consistency with WorkspaceNameService, OllamaService, RemoteAuthService
    • Replace ScheduledExecutorService with LlmModelRegistryRefreshJob Quartz job
      matching TraceThreadsClosingJob, DailyUsageReportJob patterns
    • Add remote fetch tests: successful merge, non-200 fallback, malformed YAML
      fallback, disabled remote skips fetch

    Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

    • fix(registry): remove dead refreshIntervalSeconds config, strengthen test

    Quartz @On cron replaced the ScheduledExecutorService, making the
    configurable interval unused. Removed to avoid misleading operators.
    Strengthened disabled-remote test to verify mock client is never called.

    Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com

    • fix(registry): programmatic job scheduling with configurable interval
    • Restore refreshIntervalSeconds in LlmModelRegistryConfig (was removed
      but still in config.yml — caught by Daniel)
    • Replace @On cron with programmatic registration via
      OpikGuiceyLifecycleEventListener.scheduleRepeatingJob(), matching
      TraceThreadsClosingJob pattern
    • Job only scheduled when remoteEnabled=true
    • Add comment explaining why no distributed lock is needed

    Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com


    Co-authored-by: Andrei Căutișanu andreicautisanu@ip-192-168-1-135.eu-west-1.compute.internal
    Co-authored-by: Claude Opus 4.6 (1M context) noreply@anthropic.com
    Co-authored-by: Andrei Căutișanu andreicautisanu@ip-192-168-1-151.eu-west-1.compute.internal
    Co-authored-by: Andrei Căutișanu andreicautisanu@ip-192-168-1-128.eu-west-1.compute.internal

    下载附件