Skip to content

Conversation

@luohewuyang
Copy link

@luohewuyang luohewuyang commented Dec 21, 2025

Summary

execute goimports to format the code

Changes

  • What was changed and why
  • Any notable design decisions or trade-offs

Type of change

  • Bug fix
  • Feature
  • Refactor
  • Documentation
  • Chore/CI

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • Providers/Integrations
  • Plugins
  • UI (Next.js)
  • Docs

How to test

Describe the steps to validate this change. Include commands and expected outcomes.

# Core/Transports
go version
go test ./...

# UI
cd ui
pnpm i || npm i
pnpm test || npm test
pnpm build || npm run build

If adding new configs or environment variables, document them here.

Screenshots/Recordings

If UI changes, add before/after screenshots or short clips.

Breaking changes

  • Yes
  • No

If yes, describe impact and migration instructions.

Related issues

Link related issues and discussions. Example: Closes #123

Security considerations

Note any security implications (auth, secrets, PII, sandboxing, etc.).

Checklist

  • I read docs/contributing/README.md and followed the guidelines
  • I added/updated tests where appropriate
  • I updated documentation where needed
  • I verified builds succeed (Go and UI)
  • I verified the CI pipeline passes locally if applicable

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 21, 2025

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added EnableForAPI configuration option for global proxy settings.
  • Documentation

    • Enhanced documentation blocks in plugin methods for improved clarity.
  • Style

    • Consolidated import formatting across test utilities and core packages.
    • Aligned constant and field declarations for improved readability.
    • Cleaned up trailing whitespace and formatting throughout codebase.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

This PR consists primarily of formatting and whitespace adjustments across test utilities, configuration structs, and infrastructure files. Minor control flow changes include conditional scoping of key retrieval in the governance handler and removal of implicit provider defaulting in the OpenAI batch integration.

Changes

Cohort / File(s) Summary
Test utility import formatting
core/internal/testutil/automatic_function_calling.go, complete_end_to_end.go, embedding.go, end_to_end_tool_calling.go, image_base64.go, image_url.go, list_models.go, multiple_images.go, multiple_tool_calls.go, simple_chat.go, text_completion.go, text_completion_stream.go, tool_calls.go
Removed blank lines within import blocks across multiple test files; no functional changes.
Test utility indentation
core/internal/testutil/multi_turn_conversation.go
Adjusted indentation within retry block in WithChatTestRetry call; no behavioral changes.
Provider and schema formatting
core/providers/elevenlabs/speech.go, core/providers/openai/types_test.go, core/providers/utils/pagination.go, core/schemas/pagination.go
Removed trailing blank lines and added end-of-file newline; no functional changes.
Configuration struct alignment
framework/configstore/config.go
Adjusted spacing in constant declarations for ConfigStoreTypeSQLite and ConfigStoreTypePostgres alignment; no semantic changes.
Configuration struct formatting
framework/configstore/rdb.go, framework/configstore/tables/budget.go, framework/configstore/tables/clientconfig.go, framework/configstore/tables/key.go, framework/configstore/tables/mcp.go
Adjusted field alignment, whitespace, and comment positioning in struct declarations; no behavioral changes.
Configuration schema enhancement
framework/configstore/tables/config.go
Added EnableForAPI bool field to GlobalProxyConfig struct with JSON tag "enable_for_api"; adjusted field alignment.
Encryption test formatting
framework/encrypt/encrypt_test.go
Added blank line after re-initialization in TestKDFDeterministic; no functional changes.
Plugin documentation
plugins/jsonparser/main.go
Added blank lines in doc blocks for GetName, TransportInterceptor, PreHook, and PostHook; expanded Returns sections to explicitly include error type.
Plugin whitespace adjustments
plugins/logging/main.go, plugins/semanticcache/main.go, plugins/semanticcache/search.go, plugins/semanticcache/stream.go
Minor indentation and whitespace adjustments; no behavioral changes.
Plugin test formatting
plugins/semanticcache/plugin_integration_test.go
Minor whitespace and line-ending formatting in test cases; no functional changes.
Transport handler test formatting
transports/bifrost-http/handlers/middlewares_test.go, transports/bifrost-http/integrations/bedrock_test.go
Adjusted whitespace alignment in method signatures and struct fields; no behavioral changes.
Transport handler control flow
transports/bifrost-http/handlers/governance.go
Restructured key retrieval logic in createVirtualKey and updateVirtualKey to conditionally fetch keys only when KeyIDs are present; keys retrieval now scoped within explicit conditionals before provider config construction.
Provider resolution logic
transports/bifrost-http/integrations/openai.go
Removed implicit defaulting of provider to OpenAI when CreateRequest has empty provider in batch route PreCallback; affects control flow for Bedrock-specific handling.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Focus areas: The control flow changes in transports/bifrost-http/handlers/governance.go and transports/bifrost-http/integrations/openai.go warrant verification that the restructured key retrieval logic and removed provider defaulting do not introduce unintended side effects in edge cases (e.g., missing KeyIDs or empty provider fields).
  • Configuration schema change: Verify that the new EnableForAPI field in GlobalProxyConfig is properly consumed elsewhere in the codebase and that JSON unmarshaling handles the field correctly.

Poem

🐰 A hop through whitespace, a comma or two,
Import blocks tidied, indentation askew,
A new field emerges for proxies to shine,
Keys flow with conditions—a structured design,
Much cleanup achieved with nary a fuss!

Pre-merge checks and finishing touches

❌ Failed checks (3 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning PR description is incomplete; it fails to explain what changes were made and why, leaving the 'Changes' section empty despite claiming the purpose is executing goimports. Fill in the 'Changes' section with specific details about files modified, the rationale for goimports execution, and any notable formatting decisions made during the process.
Linked Issues check ⚠️ Warning PR claims to run goimports for code formatting (chore/CI task), but linked issue #123 requires Files API support implementation—a feature development task unrelated to code formatting. Either link this PR to an appropriate formatting/chore issue, or remove the incorrect link to issue #123 if this is purely a formatting task.
Out of Scope Changes check ⚠️ Warning Majority of changes are formatting-only (blank lines, import organization, alignment), but governance.go contains substantive logic changes and openai.go removes provider defaulting logic—both out of scope for a goimports formatting chore. Review and separate functional logic changes in governance.go and openai.go into separate PRs; ensure this PR contains only formatting changes from goimports execution.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed Title accurately describes the main change: executing goimports to format Go code across multiple files in the codebase.
Docstring Coverage ✅ Passed Docstring coverage is 87.10% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7b2c237 and 179ea55.

📒 Files selected for processing (36)
  • core/internal/testutil/automatic_function_calling.go (1 hunks)
  • core/internal/testutil/complete_end_to_end.go (0 hunks)
  • core/internal/testutil/embedding.go (0 hunks)
  • core/internal/testutil/end_to_end_tool_calling.go (0 hunks)
  • core/internal/testutil/image_base64.go (0 hunks)
  • core/internal/testutil/image_url.go (0 hunks)
  • core/internal/testutil/list_models.go (0 hunks)
  • core/internal/testutil/multi_turn_conversation.go (1 hunks)
  • core/internal/testutil/multiple_images.go (0 hunks)
  • core/internal/testutil/multiple_tool_calls.go (0 hunks)
  • core/internal/testutil/simple_chat.go (0 hunks)
  • core/internal/testutil/text_completion.go (0 hunks)
  • core/internal/testutil/text_completion_stream.go (0 hunks)
  • core/internal/testutil/tool_calls.go (0 hunks)
  • core/providers/elevenlabs/speech.go (1 hunks)
  • core/providers/openai/types_test.go (0 hunks)
  • core/providers/utils/pagination.go (0 hunks)
  • core/schemas/pagination.go (0 hunks)
  • framework/configstore/config.go (1 hunks)
  • framework/configstore/rdb.go (1 hunks)
  • framework/configstore/tables/budget.go (1 hunks)
  • framework/configstore/tables/clientconfig.go (2 hunks)
  • framework/configstore/tables/config.go (1 hunks)
  • framework/configstore/tables/key.go (1 hunks)
  • framework/configstore/tables/mcp.go (1 hunks)
  • framework/encrypt/encrypt_test.go (1 hunks)
  • plugins/jsonparser/main.go (3 hunks)
  • plugins/logging/main.go (1 hunks)
  • plugins/semanticcache/main.go (1 hunks)
  • plugins/semanticcache/plugin_integration_test.go (3 hunks)
  • plugins/semanticcache/search.go (1 hunks)
  • plugins/semanticcache/stream.go (1 hunks)
  • transports/bifrost-http/handlers/governance.go (3 hunks)
  • transports/bifrost-http/handlers/middlewares_test.go (1 hunks)
  • transports/bifrost-http/integrations/bedrock_test.go (1 hunks)
  • transports/bifrost-http/integrations/openai.go (2 hunks)
💤 Files with no reviewable changes (15)
  • core/internal/testutil/embedding.go
  • core/internal/testutil/tool_calls.go
  • core/schemas/pagination.go
  • core/internal/testutil/end_to_end_tool_calling.go
  • core/internal/testutil/text_completion_stream.go
  • core/internal/testutil/multiple_tool_calls.go
  • core/internal/testutil/text_completion.go
  • core/internal/testutil/complete_end_to_end.go
  • core/internal/testutil/multiple_images.go
  • core/internal/testutil/simple_chat.go
  • core/providers/utils/pagination.go
  • core/internal/testutil/image_url.go
  • core/internal/testutil/image_base64.go
  • core/internal/testutil/list_models.go
  • core/providers/openai/types_test.go
✅ Files skipped from review due to trivial changes (5)
  • core/providers/elevenlabs/speech.go
  • framework/configstore/tables/mcp.go
  • core/internal/testutil/automatic_function_calling.go
  • framework/configstore/tables/key.go
  • framework/configstore/rdb.go
🚧 Files skipped from review as they are similar to previous changes (12)
  • transports/bifrost-http/integrations/openai.go
  • framework/encrypt/encrypt_test.go
  • plugins/semanticcache/main.go
  • plugins/semanticcache/plugin_integration_test.go
  • transports/bifrost-http/integrations/bedrock_test.go
  • transports/bifrost-http/handlers/governance.go
  • core/internal/testutil/multi_turn_conversation.go
  • transports/bifrost-http/handlers/middlewares_test.go
  • framework/configstore/tables/clientconfig.go
  • framework/configstore/tables/budget.go
  • framework/configstore/tables/config.go
  • plugins/semanticcache/search.go
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

always check the stack if there is one for the current PR. do not give localized reviews for the PR, always see all changes in the light of the whole stack of PRs (if there is a stack, if there is no stack you can continue to make localized suggestions/reviews)

Files:

  • framework/configstore/config.go
  • plugins/jsonparser/main.go
  • plugins/logging/main.go
  • plugins/semanticcache/stream.go
🧠 Learnings (1)
📚 Learning: 2025-12-09T17:07:42.007Z
Learnt from: qwerty-dvorak
Repo: maximhq/bifrost PR: 1006
File: core/schemas/account.go:9-18
Timestamp: 2025-12-09T17:07:42.007Z
Learning: In core/schemas/account.go, the HuggingFaceKeyConfig field within the Key struct is currently unused and reserved for future Hugging Face inference endpoint deployments. Do not flag this field as missing from OpenAPI documentation or require its presence in the API spec until the feature is actively implemented and used. When the feature is added, update the OpenAPI docs accordingly; otherwise, treat this field as non-breaking and not part of the current API surface.

Applied to files:

  • framework/configstore/config.go
  • plugins/jsonparser/main.go
  • plugins/logging/main.go
  • plugins/semanticcache/stream.go
🧬 Code graph analysis (1)
plugins/logging/main.go (3)
ui/lib/types/logs.ts (1)
  • TranscriptionInput (15-17)
core/schemas/bifrost.go (1)
  • TranscriptionRequest (101-101)
transports/bifrost-http/handlers/inference.go (1)
  • TranscriptionRequest (285-289)
🔇 Additional comments (4)
framework/configstore/config.go (1)

16-17: LGTM! Formatting aligns constant declarations.

The added spacing improves readability by aligning the type and value assignments in the constant block. This is consistent with goimports formatting.

plugins/logging/main.go (1)

275-275: LGTM - Formatting improvement.

The whitespace adjustment aligns with Go formatting standards applied by goimports. No functional changes.

plugins/semanticcache/stream.go (1)

74-78: LGTM - Formatting improvement.

The blank line addition after the mutex lock and the defer statement formatting enhance code readability. These are standard goimports adjustments with no functional impact.

plugins/jsonparser/main.go (1)

92-92: LGTM - Documentation formatting improvement.

The blank comment lines added to the doc blocks improve readability by visually separating the Parameters and Returns sections. This is consistent formatting applied across all three method doc blocks.

Also applies to: 105-105, 119-119


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai bot requested review from akshaydeo and danpiths December 21, 2025 07:15
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
transports/bifrost-http/lib/config_test.go (1)

1-12261: Huge test helper + scenario file: consider future structuring

Unrelated to this goimports run, but config_test.go has grown very large and dense. At some point it may be worth splitting into smaller files (e.g., provider hash tests, VK hash tests, SQLite integration helpers) to keep individual test files easier to navigate and reason about.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 47fe4ed and 7b2c237.

📒 Files selected for processing (37)
  • core/internal/testutil/automatic_function_calling.go (1 hunks)
  • core/internal/testutil/complete_end_to_end.go (0 hunks)
  • core/internal/testutil/embedding.go (0 hunks)
  • core/internal/testutil/end_to_end_tool_calling.go (0 hunks)
  • core/internal/testutil/image_base64.go (0 hunks)
  • core/internal/testutil/image_url.go (0 hunks)
  • core/internal/testutil/list_models.go (0 hunks)
  • core/internal/testutil/multi_turn_conversation.go (1 hunks)
  • core/internal/testutil/multiple_images.go (0 hunks)
  • core/internal/testutil/multiple_tool_calls.go (0 hunks)
  • core/internal/testutil/simple_chat.go (0 hunks)
  • core/internal/testutil/text_completion.go (0 hunks)
  • core/internal/testutil/text_completion_stream.go (0 hunks)
  • core/internal/testutil/tool_calls.go (0 hunks)
  • core/providers/elevenlabs/speech.go (1 hunks)
  • core/providers/openai/types_test.go (0 hunks)
  • core/providers/utils/pagination.go (0 hunks)
  • core/schemas/pagination.go (0 hunks)
  • framework/configstore/config.go (1 hunks)
  • framework/configstore/rdb.go (1 hunks)
  • framework/configstore/tables/budget.go (1 hunks)
  • framework/configstore/tables/clientconfig.go (2 hunks)
  • framework/configstore/tables/config.go (1 hunks)
  • framework/configstore/tables/key.go (1 hunks)
  • framework/configstore/tables/mcp.go (1 hunks)
  • framework/encrypt/encrypt_test.go (1 hunks)
  • plugins/jsonparser/main.go (3 hunks)
  • plugins/logging/main.go (1 hunks)
  • plugins/semanticcache/main.go (1 hunks)
  • plugins/semanticcache/plugin_integration_test.go (3 hunks)
  • plugins/semanticcache/search.go (1 hunks)
  • plugins/semanticcache/stream.go (1 hunks)
  • transports/bifrost-http/handlers/governance.go (3 hunks)
  • transports/bifrost-http/handlers/middlewares_test.go (1 hunks)
  • transports/bifrost-http/integrations/bedrock_test.go (1 hunks)
  • transports/bifrost-http/integrations/openai.go (2 hunks)
  • transports/bifrost-http/lib/config_test.go (41 hunks)
💤 Files with no reviewable changes (15)
  • core/internal/testutil/text_completion_stream.go
  • core/internal/testutil/text_completion.go
  • core/internal/testutil/complete_end_to_end.go
  • core/internal/testutil/end_to_end_tool_calling.go
  • core/schemas/pagination.go
  • core/internal/testutil/simple_chat.go
  • core/internal/testutil/multiple_images.go
  • core/internal/testutil/list_models.go
  • core/internal/testutil/image_url.go
  • core/internal/testutil/multiple_tool_calls.go
  • core/internal/testutil/embedding.go
  • core/providers/openai/types_test.go
  • core/internal/testutil/tool_calls.go
  • core/internal/testutil/image_base64.go
  • core/providers/utils/pagination.go
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

always check the stack if there is one for the current PR. do not give localized reviews for the PR, always see all changes in the light of the whole stack of PRs (if there is a stack, if there is no stack you can continue to make localized suggestions/reviews)

Files:

  • framework/encrypt/encrypt_test.go
  • transports/bifrost-http/handlers/middlewares_test.go
  • transports/bifrost-http/integrations/bedrock_test.go
  • framework/configstore/tables/clientconfig.go
  • framework/configstore/rdb.go
  • core/internal/testutil/multi_turn_conversation.go
  • plugins/semanticcache/plugin_integration_test.go
  • framework/configstore/tables/mcp.go
  • plugins/jsonparser/main.go
  • plugins/logging/main.go
  • transports/bifrost-http/lib/config_test.go
  • core/providers/elevenlabs/speech.go
  • framework/configstore/config.go
  • plugins/semanticcache/main.go
  • framework/configstore/tables/key.go
  • plugins/semanticcache/search.go
  • plugins/semanticcache/stream.go
  • transports/bifrost-http/handlers/governance.go
  • framework/configstore/tables/config.go
  • core/internal/testutil/automatic_function_calling.go
  • framework/configstore/tables/budget.go
  • transports/bifrost-http/integrations/openai.go
🧠 Learnings (4)
📚 Learning: 2025-12-09T17:07:42.007Z
Learnt from: qwerty-dvorak
Repo: maximhq/bifrost PR: 1006
File: core/schemas/account.go:9-18
Timestamp: 2025-12-09T17:07:42.007Z
Learning: In core/schemas/account.go, the HuggingFaceKeyConfig field within the Key struct is currently unused and reserved for future Hugging Face inference endpoint deployments. Do not flag this field as missing from OpenAPI documentation or require its presence in the API spec until the feature is actively implemented and used. When the feature is added, update the OpenAPI docs accordingly; otherwise, treat this field as non-breaking and not part of the current API surface.

Applied to files:

  • framework/encrypt/encrypt_test.go
  • transports/bifrost-http/handlers/middlewares_test.go
  • transports/bifrost-http/integrations/bedrock_test.go
  • framework/configstore/tables/clientconfig.go
  • framework/configstore/rdb.go
  • core/internal/testutil/multi_turn_conversation.go
  • plugins/semanticcache/plugin_integration_test.go
  • framework/configstore/tables/mcp.go
  • plugins/jsonparser/main.go
  • plugins/logging/main.go
  • transports/bifrost-http/lib/config_test.go
  • core/providers/elevenlabs/speech.go
  • framework/configstore/config.go
  • plugins/semanticcache/main.go
  • framework/configstore/tables/key.go
  • plugins/semanticcache/search.go
  • plugins/semanticcache/stream.go
  • transports/bifrost-http/handlers/governance.go
  • framework/configstore/tables/config.go
  • core/internal/testutil/automatic_function_calling.go
  • framework/configstore/tables/budget.go
  • transports/bifrost-http/integrations/openai.go
📚 Learning: 2025-12-12T08:25:02.629Z
Learnt from: Pratham-Mishra04
Repo: maximhq/bifrost PR: 1000
File: transports/bifrost-http/integrations/router.go:709-712
Timestamp: 2025-12-12T08:25:02.629Z
Learning: In transports/bifrost-http/**/*.go, update streaming response handling to align with OpenAI Responses API: use typed SSE events such as response.created, response.output_text.delta, response.done, etc., and do not rely on the legacy data: [DONE] termination marker. Note that data: [DONE] is only used by the older Chat Completions and Text Completions streaming APIs. Ensure parsers, writers, and tests distinguish SSE events from the [DONE] sentinel and handle each event type accordingly for correct stream termination and progress updates.

Applied to files:

  • transports/bifrost-http/handlers/middlewares_test.go
  • transports/bifrost-http/integrations/bedrock_test.go
  • transports/bifrost-http/lib/config_test.go
  • transports/bifrost-http/handlers/governance.go
  • transports/bifrost-http/integrations/openai.go
📚 Learning: 2025-12-19T08:29:20.286Z
Learnt from: qwerty-dvorak
Repo: maximhq/bifrost PR: 1095
File: core/internal/testutil/count_tokens.go:30-67
Timestamp: 2025-12-19T08:29:20.286Z
Learning: In core/internal/testutil test files, enforce using GetTestRetryConfigForScenario() to obtain a generic retry config, then construct a typed retry config (e.g., CountTokensRetryConfig, EmbeddingRetryConfig, TranscriptionRetryConfig) with an empty Conditions slice. Copy only MaxAttempts, BaseDelay, MaxDelay, OnRetry, and OnFinalFail from the generic config. This convention should be consistently applied across all test files in this directory.

Applied to files:

  • core/internal/testutil/multi_turn_conversation.go
  • core/internal/testutil/automatic_function_calling.go
📚 Learning: 2025-12-19T09:26:54.961Z
Learnt from: qwerty-dvorak
Repo: maximhq/bifrost PR: 1006
File: core/providers/utils/utils.go:1050-1051
Timestamp: 2025-12-19T09:26:54.961Z
Learning: Update streaming end-marker handling so HuggingFace is treated as a non-[DONE] provider for backends that do not emit a DONE marker (e.g., meta llama on novita). In core/providers/utils/utils.go, adjust ProviderSendsDoneMarker() (or related logic) to detect providers that may not emit DONE and avoid relying on DONE as the sole end signal. Add tests to cover both DONE-emitting and non-DONE backends, with clear documentation in code comments explaining the rationale and any fallback behavior.

Applied to files:

  • core/providers/elevenlabs/speech.go
🧬 Code graph analysis (9)
transports/bifrost-http/handlers/middlewares_test.go (1)
core/schemas/logger.go (1)
  • LogLevel (6-6)
transports/bifrost-http/integrations/bedrock_test.go (1)
core/schemas/bifrost.go (1)
  • ModelProvider (32-32)
core/internal/testutil/multi_turn_conversation.go (2)
core/internal/testutil/test_retry_framework.go (1)
  • WithChatTestRetry (274-424)
core/internal/testutil/utils.go (2)
  • GetErrorMessage (642-675)
  • GetChatContent (365-392)
plugins/semanticcache/plugin_integration_test.go (1)
core/schemas/context.go (2)
  • NewBifrostContext (46-64)
  • NoDeadline (10-10)
plugins/logging/main.go (3)
ui/lib/types/logs.ts (1)
  • TranscriptionInput (15-17)
core/schemas/bifrost.go (1)
  • TranscriptionRequest (101-101)
transports/bifrost-http/handlers/inference.go (1)
  • TranscriptionRequest (285-289)
transports/bifrost-http/lib/config_test.go (2)
core/schemas/logger.go (1)
  • LogLevel (6-6)
core/schemas/account.go (1)
  • Key (8-20)
transports/bifrost-http/handlers/governance.go (2)
framework/configstore/tables/key.go (2)
  • TableKey (13-58)
  • TableKey (61-61)
framework/configstore/tables/virtualkey.go (2)
  • TableVirtualKeyProviderConfig (23-36)
  • TableVirtualKeyProviderConfig (39-41)
framework/configstore/tables/config.go (4)
core/providers/gemini/types.go (1)
  • Type (782-782)
ui/lib/types/config.ts (1)
  • GlobalProxyType (267-267)
core/network/http.go (1)
  • GlobalProxyType (46-46)
core/schemas/provider.go (1)
  • NoProxy (147-147)
framework/configstore/tables/budget.go (1)
framework/configstore/tables/utils.go (1)
  • ParseDuration (9-43)
🔇 Additional comments (29)
core/providers/elevenlabs/speech.go (1)

89-89: Formatting change approved.

The addition of the EOF newline is part of the standard goimports formatting and does not alter any functional behavior.

plugins/semanticcache/stream.go (1)

74-74: Formatting changes look good.

The whitespace normalization and defer statement organization are purely cosmetic and don't affect the control flow or resource cleanup semantics. The defer ordering remains correct: cleanup executes before the mutex unlock due to LIFO execution.

Also applies to: 78-78

core/internal/testutil/multi_turn_conversation.go (1)

135-147: LGTM!

The indentation adjustments in the second test step are properly formatted. The code structure, error handling, and retry config construction follow the established patterns in the testutil suite. The ChatRetryConfig construction at lines 120-127 correctly implements the learning guideline by using GetTestRetryConfigForScenario() and copying only the required fields with an empty Conditions slice.

transports/bifrost-http/handlers/middlewares_test.go (1)

15-20: Formatting changes applied cleanly.

The mockLogger method signatures have been aligned via goimports formatting. All method parameters and return types remain correct and consistent with the schemas.Logger interface contract.

framework/encrypt/encrypt_test.go (1)

1-245: ✓ Formatting change approved.

The blank line addition at line 219 improves readability by creating visual separation between the re-initialization step and the subsequent decryption operation—a standard Go formatting convention. The test file maintains excellent structure with comprehensive coverage across encryption/decryption, error handling, KDF behavior with various key lengths, and deterministic key derivation. No functional changes or behavioral modifications introduced.

core/internal/testutil/automatic_function_calling.go (1)

165-165: LGTM!

The blank line addition between the comment block and the for-loop improves readability and aligns with the goimports formatting objective. No functional changes to the validation logic.

transports/bifrost-http/lib/config_test.go (5)

615-625: testLogger methods: formatting-only change is safe

The testLogger methods remain no‑ops with identical signatures; only spacing/alignment changed. No impact on test behavior.


1823-1837: Provider key merge condition remains logically correct

The condition if dbKeyHash == fileKeyHash || fileKey.Name == dbKey.Name still implements “same key by content or name” semantics when deciding whether to treat DB/file keys as equivalent. Only formatting changed; behavior is preserved.


2189-2198: Hash variants map: alignment-only changes

The hashes := map[string]string{...} literal in TestProviderHashComparison_OptionalFieldsPresence is unchanged semantically; keys and values are identical with only indentation/spacing adjusted. Collision detection logic is unaffected.


4743-4748: Rewrapped t.Errorf in MCP hash parity tests

The long t.Errorf call was split across lines for readability, but the format string and arguments are unchanged. Failure diagnostics and test logic remain identical.


6710-6727: Rewrapped t.Errorf in SQLite full‑reconciliation tests

The multi-line t.Errorf now has cleaner line breaks while preserving the format string and both hash arguments. No behavioral change in the reconciliation tests.

plugins/logging/main.go (1)

275-275: LGTM! Formatting adjustment improves consistency.

The TranscriptionInput assignment has been reformatted for consistency with the rest of the codebase. No functional changes.

plugins/semanticcache/main.go (1)

380-380: LGTM! Whitespace formatting improvement.

The extra blank line improves readability by separating the context value assignments from the subsequent logic. No functional changes.

plugins/semanticcache/search.go (1)

300-300: LGTM! Whitespace formatting improvement.

The additional blank line improves code readability without affecting functionality.

plugins/semanticcache/plugin_integration_test.go (1)

21-21: LGTM! Test formatting improvements.

The whitespace adjustments in test cases improve consistency without affecting test behavior or assertions.

Also applies to: 312-312, 550-550

framework/configstore/rdb.go (1)

668-668: LGTM! Brace formatting improvement.

The closing brace positioning has been adjusted for consistency with Go formatting standards. No functional changes.

transports/bifrost-http/integrations/bedrock_test.go (1)

533-538: LGTM! Test table formatting improvement.

The struct field alignment in the test table improves readability. Field names, types, and test logic remain unchanged.

framework/configstore/tables/key.go (1)

42-48: LGTM! Field alignment improvement.

The Bedrock field declarations have been realigned for consistency. Field names, types, JSON tags, and GORM tags remain unchanged.

framework/configstore/config.go (1)

16-17: LGTM! Constant alignment improvement.

The ConfigStoreType constants have been aligned for better readability. Constant names, types, and values remain unchanged.

framework/configstore/tables/mcp.go (1)

13-20: LGTM!

Pure formatting change - struct field alignment for readability. No semantic changes to types, names, or tags.

plugins/jsonparser/main.go (1)

92-92: LGTM!

Documentation formatting improvements - adding blank comment lines between parameter and return sections for better godoc readability.

Also applies to: 105-105, 119-119

framework/configstore/tables/config.go (2)

15-22: LGTM!

Pure formatting change - struct field alignment for readability.


24-26: No action required. The EnableForAPI field already exists in the codebase and is actively in use. This is a formatting/alignment change, not an introduction of a new field. No database migrations are needed.

framework/configstore/tables/budget.go (1)

30-36: LGTM!

Pure formatting changes to the BeforeSave method signature and the conditional block. The validation logic remains unchanged.

transports/bifrost-http/integrations/openai.go (2)

498-503: LGTM - Formatting only; AI summary is inconsistent.

The AI summary incorrectly states that "the defaulting behavior for an empty provider in the PreCallback is changed" and "the assignment is now removed."

However, examining the actual code, the default provider assignment to schemas.OpenAI is still present at lines 501-502. Only line 503 (the closing brace) is marked as changed, which is a pure formatting adjustment.


1203-1205: LGTM!

Pure formatting change - closing brace alignment in the purpose field validation block.

framework/configstore/tables/clientconfig.go (1)

18-19: LGTM!

The formatting changes are appropriate for a goimports run. Comment and tag alignment improve readability without changing any semantics.

Also applies to: 36-36

transports/bifrost-http/handlers/governance.go (2)

591-611: Consistent restructuring for new provider configs.

The keys retrieval follows the same pattern as in createVirtualKey (lines 288-299), ensuring consistency. The logic correctly handles the case where no KeyIDs are provided by using an empty slice.


651-674: Consistent restructuring for existing provider configs.

The keys retrieval and assignment for existing provider configs follows the same pattern as the new config creation paths. This consistency is good for maintainability.

Comment on lines +288 to +307
// Get keys for this provider config if specified
var keys []configstoreTables.TableKey
if len(pc.KeyIDs) > 0 {
var err error
keys, err = h.configStore.GetKeysByIDs(ctx, pc.KeyIDs)
if err != nil {
return fmt.Errorf("failed to get keys by IDs for provider %s: %w", pc.Provider, err)
}
if len(keys) != len(pc.KeyIDs) {
return fmt.Errorf("some keys not found for provider %s: expected %d, found %d", pc.Provider, len(pc.KeyIDs), len(keys))
}
}
}

providerConfig := &configstoreTables.TableVirtualKeyProviderConfig{
VirtualKeyID: vk.ID,
Provider: pc.Provider,
Weight: pc.Weight,
AllowedModels: pc.AllowedModels,
Keys: keys,
}
providerConfig := &configstoreTables.TableVirtualKeyProviderConfig{
VirtualKeyID: vk.ID,
Provider: pc.Provider,
Weight: pc.Weight,
AllowedModels: pc.AllowedModels,
Keys: keys,
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Logic restructuring in a formatting PR.

The keys retrieval logic is now properly guarded by the len(pc.KeyIDs) > 0 conditional, and the provider config construction follows afterward. This appears correct—when no KeyIDs are provided, an empty keys slice is used (which is valid per the schema).

However, this is a structural change, not just formatting. The PR title indicates this should be a pure goimports run, which typically only handles import organization and code formatting, not logic restructuring.

🤖 Prompt for AI Agents
In transports/bifrost-http/handlers/governance.go around lines 288 to 307, this
change moved the keys retrieval and conditional logic which alters program
behaviour; the PR should be a pure formatting/goimports change only. Revert the
logic restructuring so the previous behavior is restored (undo the
moved/rewritten key-fetch block), ensure only whitespace/imports/formatting
changes remain, then run goimports to reformat and stage just those formatting
changes.

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.

Files API Support

1 participant