Skip to content

Conversation

@akshaydeo
Copy link
Contributor

@akshaydeo akshaydeo commented Dec 26, 2025

Summary

Adds a restart required notification system to inform users when configuration changes require a server restart to take full effect.

Changes

  • Added RestartRequiredConfig data structure to track when a restart is needed
  • Implemented database methods to get, set, and clear restart required status
  • Added logic to set restart flag when specific configuration changes are made
  • Created a non-dismissible warning banner in the UI sidebar when restart is required
  • Improved UI components for better visual indication of restart requirements
  • Automatically clears restart flag on server startup

Type of change

  • Feature
  • UI (Next.js)

Affected areas

  • Core (Go)
  • Transports (HTTP)
  • UI (Next.js)

How to test

  1. Start the server
  2. Make configuration changes that require restart (e.g., change auth settings, proxy config)
  3. Verify the restart warning appears in the sidebar
  4. Restart the server and verify the warning disappears
# Core/Transports
go run cmd/bifrost/main.go

# UI
cd ui
pnpm i
pnpm dev

Screenshots/Recordings

N/A

Breaking changes

  • No

Related issues

N/A

Security considerations

No security implications as this is a UI notification feature.

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 26, 2025

📝 Walkthrough

Summary by CodeRabbit

Release Notes

New Features

  • Added restart-required notification system that tracks configuration changes requiring server restart and displays a prominent warning card in the user interface.
  • Configuration updates (authentication, proxy, logging, governance settings) now properly indicate when a restart is needed.

UI/UX Improvements

  • Improved status column styling in logs view.
  • Enhanced security view layout with simplified styling.
  • Extended UI component customization options.

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

Walkthrough

Adds a restart-required configuration entity and APIs; backend tracks and persists restart-triggering config changes and clears the flag on startup; frontend displays a non-dismissible warning promo card and includes type/UI updates to surface the restart reason.

Changes

Cohort / File(s) Summary
Restart configuration data layer
framework/configstore/tables/config.go, framework/configstore/store.go, framework/configstore/rdb.go
Add ConfigRestartRequiredKey and RestartRequiredConfig type. Extend ConfigStore interface with GetRestartRequiredConfig, SetRestartRequiredConfig, ClearRestartRequiredConfig; implement methods in RDB. (RDB file contains the new public method implementations.)
HTTP handlers & startup
transports/bifrost-http/handlers/config.go, transports/bifrost-http/lib/config.go
getConfig returns restart-required config. updateConfig and updateProxyConfig detect changes that require restart, build restart reasons, and call SetRestartRequiredConfig. Server startup and default config loading call ClearRestartRequiredConfig.
Frontend types & constants
ui/lib/types/config.ts, ui/lib/constants/logs.ts
Add RestartRequiredConfig type and optional restart_required on BifrostConfig. Add new StatusBarColors constant for status bar styling.
Restart notification UI
ui/components/sidebar.tsx
Inject non-dismissible "Restart Required" promo card using coreConfig?.restart_required.required and coreConfig.restart_required.reason; include coreConfig?.restart_required in memo deps.
Promo card stack & card variants
ui/components/ui/promoCardStack.tsx
Add optional `variant?: "default"
Small UI component API changes
ui/components/ui/sheet.tsx, ui/components/ui/toggle.tsx
SheetHeader gains showCloseButton?: boolean (default true) to conditionally render close button. Toggle adds optional className?: string and uses cn(...) to merge classes.
Logs columns & presentation
ui/app/workspace/logs/views/columns.tsx
Status column: header cleared, size/maxSize set to 8, rendering changed to a colored div using StatusBarColors (replaces StatusColors). Timestamp cell font class simplified.
Config views minor UI tweaks
ui/app/workspace/config/views/pricingConfigView.tsx, ui/app/workspace/config/views/securityView.tsx
Force Sync label shows "Syncing..." when active; security view section styling reduced (border/padding removed).

Sequence Diagram(s)

sequenceDiagram
    participant Browser as Client (Browser)
    participant HTTP as HTTP Handler
    participant Store as ConfigStore
    participant DB as Database
    participant UI as Frontend UI

    rect `#E8F0FF`
    Note over Browser,HTTP: Config update triggers restart detection
    Browser->>HTTP: PATCH /config (changes)
    HTTP->>HTTP: Determine changed settings\n(accumulate restartReasons)
    alt restartReasons non-empty
      HTTP->>Store: SetRestartRequiredConfig(ctx, {Required:true, Reason: "..."} )
      Store->>DB: persist `restart_required` key (JSON)
      DB-->>Store: OK
    end
    HTTP-->>Browser: 200 OK
    end

    rect `#F2FFF0`
    Note over Browser,HTTP: Client reads config including restart state
    Browser->>HTTP: GET /config
    HTTP->>Store: GetRestartRequiredConfig(ctx)
    Store->>DB: read `restart_required` key
    DB-->>Store: RestartRequiredConfig JSON
    Store-->>HTTP: RestartRequiredConfig
    HTTP-->>Browser: 200 + restart_required
    Browser->>UI: render
    UI->>UI: Sidebar shows non-dismissible warning card when restart_required.required == true
    end

    rect `#FFF6E8`
    Note over HTTP,Store: Server startup clears flag
    HTTP->>Store: ClearRestartRequiredConfig(ctx)
    Store->>DB: write cleared `restart_required` (Required:false)
    DB-->>Store: OK
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐇 A tiny hop, a config's plea,

"Restart me once to set things free."
Backend notes the reasons true,
Frontend flashes amber view,
A rabbit cheers — "Apply and renew!"

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes: adding a restart-required notification system and storage mechanism.
Description check ✅ Passed The description follows the template well with all major sections completed: summary, changes, type, affected areas, testing steps, breaking changes, and checklist.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 12-26-minor_ux_uplifg_restart_required_status_storage

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

@github-actions
Copy link
Contributor

🧪 Test Suite Available

This PR can be tested by a repository admin.

Run tests for PR #1176

Copy link
Contributor Author

akshaydeo commented Dec 26, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@akshaydeo akshaydeo marked this pull request as ready for review December 26, 2025 05:49
@akshaydeo akshaydeo changed the base branch from main to graphite-base/1176 December 26, 2025 06:00
@akshaydeo akshaydeo force-pushed the 12-26-minor_ux_uplifg_restart_required_status_storage branch from 4f5736c to bce4df2 Compare December 26, 2025 06:00
@akshaydeo akshaydeo changed the base branch from graphite-base/1176 to 12-24-fix_content_block_type_input_file_to_file December 26, 2025 06:01
@akshaydeo akshaydeo changed the title minor ux uplifg, restart required status storage minor ux uplift, restart required status storage Dec 26, 2025
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: 0

🧹 Nitpick comments (3)
ui/app/workspace/config/views/securityView.tsx (1)

241-241: Verify styling consistency with other toggle controls.

This control now has different styling compared to other toggles in the same view (e.g., lines 265, 282, 300 which retain rounded-lg border p-4). Since this is a sub-setting within the auth config section, the flatter visual hierarchy might be intentional, but please confirm this styling change aligns with the design intent.

framework/configstore/rdb.go (1)

1983-1989: Consider using the struct instead of hardcoded JSON for consistency.

While the hardcoded JSON string works, using the RestartRequiredConfig struct would be more maintainable if the struct evolves.

🔎 Suggested refactor
 // ClearRestartRequiredConfig clears the restart required configuration in the database.
 func (s *RDBConfigStore) ClearRestartRequiredConfig(ctx context.Context) error {
-	return s.db.WithContext(ctx).Save(&tables.TableGovernanceConfig{
-		Key:   tables.ConfigRestartRequiredKey,
-		Value: `{"required":false,"reason":""}`,
-	}).Error
+	return s.SetRestartRequiredConfig(ctx, &tables.RestartRequiredConfig{
+		Required: false,
+		Reason:   "",
+	})
 }
transports/bifrost-http/handlers/config.go (1)

600-607: Proxy config update always sets restart flag regardless of actual changes.

Unlike updateConfig which tracks specific changes, this handler sets the restart flag on every proxy update, even if the configuration didn't actually change (e.g., user submits the same values). Consider comparing with the existing config to avoid false positives.

🔎 Suggested approach
+	// Check if proxy config actually changed before setting restart flag
+	existingConfig, _ := h.store.ConfigStore.GetProxyConfig(ctx)
+	proxyChanged := existingConfig == nil ||
+		existingConfig.Enabled != payload.Enabled ||
+		existingConfig.URL != payload.URL ||
+		existingConfig.Type != payload.Type ||
+		existingConfig.Username != payload.Username ||
+		existingConfig.NoProxy != payload.NoProxy ||
+		existingConfig.Timeout != payload.Timeout ||
+		existingConfig.SkipTLSVerify != payload.SkipTLSVerify
+	// Note: Password comparison is tricky due to encryption, so any non-redacted password counts as change
+	if payload.Password != "<redacted>" && payload.Password != "" {
+		proxyChanged = true
+	}
+
 	// Set restart required flag for proxy config changes
-	if err := h.store.ConfigStore.SetRestartRequiredConfig(ctx, &configstoreTables.RestartRequiredConfig{
-		Required: true,
-		Reason:   "Proxy configuration has been updated. A restart is required for all changes to take full effect.",
-	}); err != nil {
-		logger.Warn(fmt.Sprintf("failed to set restart required config: %v", err))
+	if proxyChanged {
+		if err := h.store.ConfigStore.SetRestartRequiredConfig(ctx, &configstoreTables.RestartRequiredConfig{
+			Required: true,
+			Reason:   "Proxy configuration has been updated. A restart is required for all changes to take full effect.",
+		}); err != nil {
+			logger.Warn(fmt.Sprintf("failed to set restart required config: %v", err))
+		}
 	}
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0769d11 and bce4df2.

📒 Files selected for processing (14)
  • framework/configstore/rdb.go
  • framework/configstore/store.go
  • framework/configstore/tables/config.go
  • transports/bifrost-http/handlers/config.go
  • transports/bifrost-http/lib/config.go
  • ui/app/workspace/config/views/pricingConfigView.tsx
  • ui/app/workspace/config/views/securityView.tsx
  • ui/app/workspace/logs/views/columns.tsx
  • ui/components/sidebar.tsx
  • ui/components/ui/promoCardStack.tsx
  • ui/components/ui/sheet.tsx
  • ui/components/ui/toggle.tsx
  • ui/lib/constants/logs.ts
  • ui/lib/types/config.ts
🧰 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/store.go
  • ui/lib/constants/logs.ts
  • ui/app/workspace/logs/views/columns.tsx
  • ui/lib/types/config.ts
  • ui/app/workspace/config/views/pricingConfigView.tsx
  • ui/components/ui/toggle.tsx
  • ui/components/sidebar.tsx
  • ui/app/workspace/config/views/securityView.tsx
  • framework/configstore/tables/config.go
  • transports/bifrost-http/handlers/config.go
  • transports/bifrost-http/lib/config.go
  • framework/configstore/rdb.go
  • ui/components/ui/sheet.tsx
  • ui/components/ui/promoCardStack.tsx
🧠 Learnings (2)
📚 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/store.go
  • framework/configstore/tables/config.go
  • transports/bifrost-http/handlers/config.go
  • transports/bifrost-http/lib/config.go
  • framework/configstore/rdb.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/config.go
  • transports/bifrost-http/lib/config.go
🧬 Code graph analysis (5)
framework/configstore/store.go (2)
framework/configstore/tables/config.go (1)
  • RestartRequiredConfig (16-19)
ui/lib/types/config.ts (1)
  • RestartRequiredConfig (303-306)
ui/app/workspace/logs/views/columns.tsx (2)
ui/lib/constants/logs.ts (2)
  • Status (173-173)
  • StatusBarColors (84-89)
ui/components/ui/button.tsx (1)
  • Button (70-70)
ui/lib/types/config.ts (1)
framework/configstore/tables/config.go (2)
  • RestartRequiredConfig (16-19)
  • GlobalProxyConfig (24-37)
ui/components/ui/toggle.tsx (1)
ui/lib/utils.ts (1)
  • cn (4-6)
framework/configstore/rdb.go (2)
framework/configstore/tables/config.go (4)
  • RestartRequiredConfig (16-19)
  • TableGovernanceConfig (40-43)
  • TableGovernanceConfig (46-46)
  • ConfigRestartRequiredKey (11-11)
ui/lib/types/config.ts (1)
  • RestartRequiredConfig (303-306)
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (20)
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
🔇 Additional comments (24)
ui/components/ui/toggle.tsx (2)

6-6: LGTM! Good component flexibility enhancement.

The addition of the optional className prop and its integration using the cn utility follows best practices for component composition. The implementation correctly:

  • Preserves existing styling logic (including the disabled state conditional)
  • Allows external className customization without breaking internal styles
  • Uses the cn utility to properly merge classes via twMerge and clsx

Also applies to: 15-15, 19-22


3-3: No issues found. The import import { cn } from "./utils"; correctly resolves to ui/components/ui/utils.ts, which exports the cn utility function. The relative path is valid and will not cause module resolution errors.

Likely an incorrect or invalid review comment.

ui/app/workspace/config/views/pricingConfigView.tsx (1)

92-92: LGTM - Good UX improvement.

The conditional button text provides clear visual feedback to users during the force sync operation, matching the pattern already used for the Save button.

ui/components/ui/sheet.tsx (2)

94-126: LGTM - Clean API enhancement for SheetHeader.

The addition of the showCloseButton prop provides better control over close button visibility while maintaining backward compatibility (defaults to true). The layout refinements and hover styling improvements enhance the component's visual polish.


75-79: No positioning changes detected in SheetContent.

The top-2 right-0 bottom-2 and top-2 bottom-2 left-0 positioning classes remain intact in lines 75 and 78-79. The SheetHeader changes (adding the showCloseButton prop with true default) are backward compatible—all existing sheet implementations continue to work without modification.

Likely an incorrect or invalid review comment.

ui/lib/constants/logs.ts (1)

84-89: LGTM - Well-structured constant addition.

The StatusBarColors constant follows the established pattern in this file and provides a clean separation between badge colors (StatusColors) and status bar colors. The as const assertion ensures type safety.

transports/bifrost-http/lib/config.go (2)

414-417: LGTM - Proper restart flag cleanup on server initialization.

Clearing the restart-required flag on server startup is the correct behavior. The warning-level error logging is appropriate since this is a non-critical operation that shouldn't block server startup.


1529-1532: LGTM - Consistent restart flag cleanup for default config path.

Good practice to clear the restart flag in both initialization paths (file-based and defaults). The error handling matches the approach in initStoresFromFile.

ui/components/sidebar.tsx (2)

631-644: LGTM - Well-implemented restart notification.

The restart required promo card is properly configured:

  • Non-dismissible for critical system notifications
  • Warning variant provides appropriate visual emphasis
  • Fallback message handles missing reason gracefully
  • Positioned first to ensure visibility

The optional chaining on coreConfig?.restart_required?.required safely handles cases where the config isn't loaded yet.


668-668: LGTM - Proper memoization dependency.

Adding coreConfig?.restart_required to the dependency array ensures the promo cards update when the restart status changes.

ui/lib/types/config.ts (2)

302-306: LGTM - Type definition matches backend structure.

The RestartRequiredConfig interface correctly mirrors the Go backend struct from framework/configstore/tables/config.go:

  • required: boolean maps to Required bool
  • reason?: string maps to Reason string with omitempty tag

314-314: LGTM - Optional field is appropriate.

Making restart_required optional in BifrostConfig is correct since this field may not always be present in the configuration response.

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

11-11: LGTM - Constant follows established pattern.

The ConfigRestartRequiredKey constant follows the same naming convention as the existing config keys in this file.


14-19: LGTM - Clean struct definition with appropriate JSON tags.

The RestartRequiredConfig struct is well-documented and correctly uses:

  • json:"required" for mandatory boolean field
  • json:"reason,omitempty" to omit empty reason strings from JSON output

This aligns with the TypeScript type definition in ui/lib/types/config.ts.

ui/components/ui/promoCardStack.tsx (2)

23-45: LGTM! Sorting logic correctly prioritizes non-dismissible cards.

The implementation properly places non-dismissible cards (like the restart warning) at the top of the stack. The duplicate sorting logic in both the initial state and the effect is acceptable for a component of this size.


97-107: Warning variant styling looks good.

The amber-themed styling for the warning variant provides clear visual distinction and aligns with common UI patterns for cautionary notices.

framework/configstore/store.go (1)

126-130: Clean interface extension for restart-required config management.

The three new methods follow the existing patterns in the interface and provide a complete API for managing the restart-required state.

ui/app/workspace/logs/views/columns.tsx (1)

50-57: Status column improvements look correct.

The empty header with explicit size constraints (8px) appropriately creates a compact color-bar indicator for status. The StatusBarColors import rename aligns with the constant definition in logs.ts.

framework/configstore/rdb.go (2)

1952-1969: GetRestartRequiredConfig implementation is correct.

Properly handles the record-not-found case by returning nil, nil and correctly unmarshals the JSON value when present.


1971-1981: SetRestartRequiredConfig implementation follows existing patterns.

The implementation is consistent with similar methods like UpdateProxyConfig, using JSON marshaling and the governance_config table.

transports/bifrost-http/handlers/config.go (4)

160-166: Good addition of restart_required config exposure in getConfig.

The implementation correctly fetches and exposes the restart status with proper error handling (logs warning but doesn't fail the request).


220-266: Comprehensive restart reason tracking for client config changes.

The implementation properly tracks which settings require a restart and provides clear, user-facing reason messages.


383-401: Auth change detection logic is thorough.

The comparison correctly handles the initial case (no existing config) and detects changes to enabled state, username, inference auth setting, and password updates.


438-447: Restart flag is set with a consolidated, user-friendly message.

The joined reasons provide clear feedback about which settings triggered the restart requirement.

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 (4)
ui/components/ui/promoCardStack.tsx (2)

23-45: Consider extracting duplicate sorting logic.

The same sorting logic for non-dismissible cards appears in both the useState initializer (lines 23-30) and the useEffect (lines 36-43). Consider extracting to a helper function.

🔎 Proposed refactor
+const sortByDismissible = (cards: PromoCardItem[]) =>
+  [...cards].sort((a, b) => {
+    const aDismissible = a.dismissible !== false;
+    const bDismissible = b.dismissible !== false;
+    if (aDismissible === bDismissible) return 0;
+    return aDismissible ? 1 : -1;
+  });
+
 export function PromoCardStack({ cards, className = "", onCardsEmpty }: PromoCardStackProps) {
-  const [items, setItems] = useState(() => {
-    // Sort so non-dismissible cards appear at the top
-    return [...cards].sort((a, b) => {
-      const aDismissible = a.dismissible !== false;
-      const bDismissible = b.dismissible !== false;
-      if (aDismissible === bDismissible) return 0;
-      return aDismissible ? 1 : -1; // Non-dismissible first
-    });
-  });
+  const [items, setItems] = useState(() => sortByDismissible(cards));
   // ...
   useEffect(() => {
-    // Sort so non-dismissible cards appear at the top
-    const sortedCards = [...cards].sort((a, b) => {
-      const aDismissible = a.dismissible !== false;
-      const bDismissible = b.dismissible !== false;
-      if (aDismissible === bDismissible) return 0;
-      return aDismissible ? 1 : -1; // Non-dismissible first
-    });
-    setItems(sortedCards);
+    setItems(sortByDismissible(cards));
   }, [cards]);

109-109: Redundant ternary expression.

The expression typeof card.title === "string" ? card.title : card.title always evaluates to card.title. The same issue exists on line 124 for card.description.

🔎 Proposed fix
-<div className="min-w-0 flex-1">{typeof card.title === "string" ? card.title : card.title}</div>
+<div className="min-w-0 flex-1">{card.title}</div>

And for line 124:

-{typeof card.description === "string" ? card.description : card.description}
+{card.description}
framework/configstore/rdb.go (1)

1983-1989: Consider using struct marshaling for consistency.

ClearRestartRequiredConfig uses a hardcoded JSON string while SetRestartRequiredConfig marshals a struct. While the hardcoded string is correct, using consistent marshaling would be slightly more maintainable if the struct definition changes.

🔎 Proposed refactor for consistency
 func (s *RDBConfigStore) ClearRestartRequiredConfig(ctx context.Context) error {
+	config := &tables.RestartRequiredConfig{Required: false, Reason: ""}
+	configJSON, err := json.Marshal(config)
+	if err != nil {
+		return fmt.Errorf("failed to marshal restart required config: %w", err)
+	}
 	return s.db.WithContext(ctx).Save(&tables.TableGovernanceConfig{
 		Key:   tables.ConfigRestartRequiredKey,
-		Value: `{"required":false,"reason":""}`,
+		Value: string(configJSON),
 	}).Error
 }
transports/bifrost-http/handlers/config.go (1)

600-607: Proxy config always triggers restart flag.

This sets the restart-required flag on every proxy config update, even if the values haven't actually changed. Consider comparing with the existing config before setting the flag to avoid unnecessary restart notifications.

🔎 Proposed enhancement
+	// Check if proxy config actually changed before setting restart flag
+	existingProxyConfig, _ := h.store.ConfigStore.GetProxyConfig(ctx)
+	proxyChanged := existingProxyConfig == nil ||
+		existingProxyConfig.Enabled != payload.Enabled ||
+		existingProxyConfig.URL != payload.URL ||
+		existingProxyConfig.Type != payload.Type ||
+		existingProxyConfig.Username != payload.Username ||
+		existingProxyConfig.NoProxy != payload.NoProxy ||
+		existingProxyConfig.Timeout != payload.Timeout ||
+		existingProxyConfig.SkipTLSVerify != payload.SkipTLSVerify
+
 	// Set restart required flag for proxy config changes
+	if proxyChanged {
 		if err := h.store.ConfigStore.SetRestartRequiredConfig(ctx, &configstoreTables.RestartRequiredConfig{
 			Required: true,
 			Reason:   "Proxy configuration has been updated. A restart is required for all changes to take full effect.",
 		}); err != nil {
 			logger.Warn(fmt.Sprintf("failed to set restart required config: %v", err))
 		}
+	}
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0769d11 and bce4df2.

📒 Files selected for processing (14)
  • framework/configstore/rdb.go
  • framework/configstore/store.go
  • framework/configstore/tables/config.go
  • transports/bifrost-http/handlers/config.go
  • transports/bifrost-http/lib/config.go
  • ui/app/workspace/config/views/pricingConfigView.tsx
  • ui/app/workspace/config/views/securityView.tsx
  • ui/app/workspace/logs/views/columns.tsx
  • ui/components/sidebar.tsx
  • ui/components/ui/promoCardStack.tsx
  • ui/components/ui/sheet.tsx
  • ui/components/ui/toggle.tsx
  • ui/lib/constants/logs.ts
  • ui/lib/types/config.ts
🧰 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:

  • ui/lib/types/config.ts
  • ui/app/workspace/config/views/pricingConfigView.tsx
  • framework/configstore/store.go
  • framework/configstore/tables/config.go
  • ui/components/sidebar.tsx
  • transports/bifrost-http/handlers/config.go
  • transports/bifrost-http/lib/config.go
  • ui/app/workspace/config/views/securityView.tsx
  • ui/components/ui/promoCardStack.tsx
  • ui/components/ui/toggle.tsx
  • ui/components/ui/sheet.tsx
  • framework/configstore/rdb.go
  • ui/lib/constants/logs.ts
  • ui/app/workspace/logs/views/columns.tsx
🧠 Learnings (2)
📚 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/store.go
  • framework/configstore/tables/config.go
  • transports/bifrost-http/handlers/config.go
  • transports/bifrost-http/lib/config.go
  • framework/configstore/rdb.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/config.go
  • transports/bifrost-http/lib/config.go
🧬 Code graph analysis (7)
ui/lib/types/config.ts (2)
framework/configstore/tables/config.go (1)
  • RestartRequiredConfig (16-19)
core/schemas/bifrost.go (1)
  • BifrostConfig (21-29)
framework/configstore/store.go (2)
framework/configstore/tables/config.go (1)
  • RestartRequiredConfig (16-19)
ui/lib/types/config.ts (1)
  • RestartRequiredConfig (303-306)
transports/bifrost-http/handlers/config.go (4)
ui/lib/types/config.ts (2)
  • AuthConfig (261-266)
  • RestartRequiredConfig (303-306)
transports/bifrost-http/handlers/utils.go (1)
  • SendError (35-44)
framework/encrypt/encrypt.go (1)
  • Hash (63-69)
framework/configstore/tables/config.go (1)
  • RestartRequiredConfig (16-19)
ui/components/ui/promoCardStack.tsx (1)
ui/components/ui/card.tsx (1)
  • CardHeader (50-50)
ui/components/ui/toggle.tsx (1)
ui/lib/utils.ts (1)
  • cn (4-6)
framework/configstore/rdb.go (2)
framework/configstore/tables/config.go (4)
  • RestartRequiredConfig (16-19)
  • TableGovernanceConfig (40-43)
  • TableGovernanceConfig (46-46)
  • ConfigRestartRequiredKey (11-11)
ui/lib/types/config.ts (1)
  • RestartRequiredConfig (303-306)
ui/app/workspace/logs/views/columns.tsx (1)
ui/lib/constants/logs.ts (2)
  • Status (173-173)
  • StatusBarColors (84-89)
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (25)
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
🔇 Additional comments (19)
ui/components/ui/toggle.tsx (1)

3-3: LGTM! Clean implementation of className prop.

The addition of an optional className prop with proper class merging via cn() follows React best practices and maintains backward compatibility.

Also applies to: 6-6, 15-15, 19-22

ui/app/workspace/config/views/pricingConfigView.tsx (1)

92-92: LGTM! Better UX terminology.

Changing "Forcing..." to "Syncing..." is clearer and more user-friendly.

ui/lib/types/config.ts (1)

302-306: LGTM! Type definitions align with backend.

The RestartRequiredConfig interface correctly mirrors the Go struct from framework/configstore/tables/config.go, and the optional restart_required field properly extends BifrostConfig.

Also applies to: 314-314

ui/components/sidebar.tsx (1)

631-644: LGTM! Restart notification properly integrated.

The restart-required promo card is correctly:

  • Prioritized first in the array
  • Conditionally displayed based on restart_required.required
  • Configured as non-dismissible with warning variant
  • Tracked in the useMemo dependency array for reactive updates

Also applies to: 668-668

transports/bifrost-http/lib/config.go (2)

414-417: LGTM! Restart flag cleared on startup.

Clearing the restart-required flag after server initialization ensures the system starts with a clean state. The warning log for failures is appropriate.


1529-1532: LGTM! Consistent restart flag clearing in default load path.

This correctly mirrors the clearing logic in the config-from-file path (lines 414-417), ensuring both startup scenarios begin with a clean restart state.

ui/lib/constants/logs.ts (1)

84-89: LGTM! Purpose-specific status colors added.

The StatusBarColors constant provides background-only colors for status indicators, complementing the existing StatusColors that include text colors.

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

11-11: LGTM! Clean restart configuration definition.

The ConfigRestartRequiredKey constant and RestartRequiredConfig struct are well-defined, with appropriate JSON tags and the omitempty directive on the optional Reason field.

Also applies to: 14-19

ui/components/ui/promoCardStack.tsx (1)

97-107: Warning variant styling looks good.

The amber color scheme for the warning variant is appropriate and provides clear visual distinction. The conditional styling using cn() is clean and follows the existing patterns.

framework/configstore/store.go (1)

126-130: Interface additions are well-designed.

The new restart-required config methods follow the established patterns in the ConfigStore interface. The method signatures are consistent with similar config CRUD operations (e.g., GetProxyConfig/UpdateProxyConfig).

framework/configstore/rdb.go (1)

1952-1969: Implementation follows established patterns.

The GetRestartRequiredConfig implementation correctly handles the not-found case and empty value scenario, consistent with GetProxyConfig.

transports/bifrost-http/handlers/config.go (3)

160-167: Restart config retrieval integrated correctly.

The restart-required config is fetched and included in the response appropriately. Error handling logs a warning but doesn't fail the entire request, which is the right approach for this non-critical data.


220-265: Restart reason tracking is well-structured.

The approach of collecting restart reasons into a slice and joining them for a descriptive message is clean and user-friendly. The tracking covers the appropriate configuration fields.


383-401: Auth change detection logic is reasonable.

The auth change detection covers the key scenarios: enabled state, username, password changes (when not redacted), and inference auth flag. The logic correctly handles the case where no existing config exists.

ui/app/workspace/logs/views/columns.tsx (3)

48-58: Status column redesign looks good.

The change from a Badge to a thin colored bar (w-1) is a cleaner visual indicator. The size: 8 and maxSize: 8 constraints appropriately minimize the column width for this indicator style.


1-11: Imports are correctly updated.

The StatusBarColors import replaces StatusColors and aligns with the new status bar rendering. The Badge import is still needed for the request_type column.


56-56: StatusBarColors correctly covers all status values.

Verification confirms StatusBarColors includes all four possible Status values (success, error, processing, cancelled) with no gaps or undefined styling risk.

ui/components/ui/sheet.tsx (2)

75-75: LGTM! Minor className reordering.

The className adjustments for the right and left sheet sides are purely organizational with no functional impact.

Also applies to: 79-79


94-126: Backward-compatible API; code structure mitigates original concerns.

The showCloseButton prop is a clean addition using correct React 19 patterns. Verification across the codebase confirms:

  1. Negative margin handling: SheetHeader is consistently used with SheetContent padding (p-8 = 32px). The -ml-5 expand button has adequate surrounding padding (~12px minimum) and poses no clipping risk in actual usage patterns.

  2. Accessibility maintained: No instances of showCloseButton={false} exist in the codebase. All sheets use standard Radix UI dismissal mechanisms (ESC key, overlay click, onOpenChange callbacks) that function independently of the close button state.

The implementation is sound and follows established patterns in related components (dialog.tsx, command.tsx).

@TejasGhatte TejasGhatte changed the base branch from 12-24-fix_content_block_type_input_file_to_file to graphite-base/1176 December 26, 2025 06:26
@akshaydeo akshaydeo force-pushed the 12-26-minor_ux_uplifg_restart_required_status_storage branch from bce4df2 to 6445a81 Compare December 26, 2025 08:14
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: 0

♻️ Duplicate comments (1)
ui/app/workspace/config/views/securityView.tsx (1)

241-241: Visual inconsistency: missing border and padding.

This section no longer has the space-x-2 rounded-lg border p-4 classes that adjacent sections retain (lines 265-279, 282-297), creating a visual inconsistency where the "Disable authentication on inference calls" control appears without the border/padding container.

🔎 Restore consistent styling
-<div className="flex items-center justify-between">
+<div className="flex items-center justify-between space-x-2 rounded-lg border p-4">
🧹 Nitpick comments (4)
ui/components/sidebar.tsx (1)

631-644: Consider optional chaining for consistency and safety.

The code correctly checks coreConfig?.restart_required?.required before adding the card, but line 638 accesses coreConfig.restart_required.reason without optional chaining. While the outer condition ensures restart_required exists, using optional chaining (coreConfig.restart_required?.reason) would be more defensive and consistent with the rest of the codebase.

🔎 Suggested refinement
 if (coreConfig?.restart_required?.required) {
   cards.push({
     id: "restart-required",
     title: "Restart Required",
     description: (
       <div className="text-xs text-amber-700 dark:text-amber-300/80">
-        {coreConfig.restart_required.reason || "Configuration changes require a server restart to take effect."}
+        {coreConfig.restart_required?.reason || "Configuration changes require a server restart to take effect."}
       </div>
     ),
     dismissible: false,
     variant: "warning" as const,
   });
 }
framework/configstore/rdb.go (1)

1983-1989: Refactor to marshal struct instead of hardcoded JSON.

The method uses a hardcoded JSON string {"required":false,"reason":""} instead of marshaling a struct like other methods (SetRestartRequiredConfig, UpdateProxyConfig, etc.). This is inconsistent and more fragile.

🔎 Proposed refactor
 func (s *RDBConfigStore) ClearRestartRequiredConfig(ctx context.Context) error {
+	configJSON, err := json.Marshal(&tables.RestartRequiredConfig{
+		Required: false,
+		Reason:   "",
+	})
+	if err != nil {
+		return fmt.Errorf("failed to marshal restart required config: %w", err)
+	}
 	return s.db.WithContext(ctx).Save(&tables.TableGovernanceConfig{
 		Key:   tables.ConfigRestartRequiredKey,
-		Value: `{"required":false,"reason":""}`,
+		Value: string(configJSON),
 	}).Error
 }
transports/bifrost-http/handlers/config.go (2)

220-263: Good approach to tracking restart-requiring changes.

The restart reason tracking is well-implemented with clear, human-readable messages. Each configuration change that requires a restart appropriately appends to the restartReasons slice.

Optional: For better maintainability, you could extract the reason strings as constants if they need to be referenced elsewhere or for i18n in the future:

const (
    RestartReasonPrometheusLabels = "Prometheus labels"
    RestartReasonAllowedOrigins   = "Allowed origins"
    // etc.
)

However, for this current scope, inline strings are perfectly acceptable.


438-447: Consider using error-level logging for restart flag failures.

The restart flag setting logic is well-implemented, but the failure case at line 445 uses logger.Warn. Since failing to set the restart flag means users won't be notified of the required restart (which could lead to unexpected behavior), consider using logger.Error instead to ensure this issue gets appropriate attention in logs.

 if err := h.store.ConfigStore.SetRestartRequiredConfig(ctx, &configstoreTables.RestartRequiredConfig{
   Required: true,
   Reason:   reason,
 }); err != nil {
-  logger.Warn(fmt.Sprintf("failed to set restart required config: %v", err))
+  logger.Error(fmt.Sprintf("failed to set restart required config: %v", err))
 }
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bce4df2 and 6445a81.

📒 Files selected for processing (14)
  • framework/configstore/rdb.go
  • framework/configstore/store.go
  • framework/configstore/tables/config.go
  • transports/bifrost-http/handlers/config.go
  • transports/bifrost-http/lib/config.go
  • ui/app/workspace/config/views/pricingConfigView.tsx
  • ui/app/workspace/config/views/securityView.tsx
  • ui/app/workspace/logs/views/columns.tsx
  • ui/components/sidebar.tsx
  • ui/components/ui/promoCardStack.tsx
  • ui/components/ui/sheet.tsx
  • ui/components/ui/toggle.tsx
  • ui/lib/constants/logs.ts
  • ui/lib/types/config.ts
🚧 Files skipped from review as they are similar to previous changes (8)
  • ui/app/workspace/config/views/pricingConfigView.tsx
  • ui/components/ui/sheet.tsx
  • ui/lib/types/config.ts
  • ui/components/ui/promoCardStack.tsx
  • ui/components/ui/toggle.tsx
  • transports/bifrost-http/lib/config.go
  • ui/lib/constants/logs.ts
  • ui/app/workspace/logs/views/columns.tsx
🧰 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/tables/config.go
  • ui/components/sidebar.tsx
  • transports/bifrost-http/handlers/config.go
  • framework/configstore/store.go
  • framework/configstore/rdb.go
  • ui/app/workspace/config/views/securityView.tsx
🧠 Learnings (2)
📚 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/tables/config.go
  • transports/bifrost-http/handlers/config.go
  • framework/configstore/store.go
  • framework/configstore/rdb.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/config.go
🧬 Code graph analysis (3)
transports/bifrost-http/handlers/config.go (5)
framework/configstore/store.go (1)
  • ConfigStore (17-157)
ui/lib/types/config.ts (1)
  • RestartRequiredConfig (303-306)
transports/bifrost-http/handlers/utils.go (1)
  • SendError (35-44)
framework/encrypt/encrypt.go (1)
  • Hash (63-69)
framework/configstore/tables/config.go (1)
  • RestartRequiredConfig (16-19)
framework/configstore/store.go (2)
framework/configstore/tables/config.go (1)
  • RestartRequiredConfig (16-19)
ui/lib/types/config.ts (1)
  • RestartRequiredConfig (303-306)
framework/configstore/rdb.go (2)
framework/configstore/tables/config.go (4)
  • RestartRequiredConfig (16-19)
  • TableGovernanceConfig (40-43)
  • TableGovernanceConfig (46-46)
  • ConfigRestartRequiredKey (11-11)
ui/lib/types/config.ts (1)
  • RestartRequiredConfig (303-306)
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
🔇 Additional comments (10)
ui/components/sidebar.tsx (1)

668-668: LGTM! Proper dependency tracking.

Correctly added coreConfig?.restart_required to the useMemo dependency array, ensuring the promo cards list recomputes whenever the restart status changes.

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

11-19: LGTM! Clean and well-designed types.

The ConfigRestartRequiredKey constant and RestartRequiredConfig struct are well-defined with appropriate JSON tags and clear documentation. The omitempty tag on the Reason field is correct for optional usage.

framework/configstore/store.go (1)

126-129: LGTM! Interface design follows existing patterns.

The three new methods for restart-required configuration management are well-designed and consistent with the existing ConfigStore interface patterns. The signatures properly use context, pointer types, and error returns.

framework/configstore/rdb.go (3)

1952-1969: LGTM! Implementation follows established patterns.

The GetRestartRequiredConfig method correctly follows the same implementation pattern as other config retrieval methods (e.g., GetProxyConfig), with proper error handling and safe nil returns for missing or empty configurations.


1971-1981: LGTM! Proper implementation.

The SetRestartRequiredConfig method correctly marshals the configuration to JSON and saves it using the established pattern. Error handling is appropriate.


1952-1989: No duplicate method declarations exist in the file. Each method (GetRestartRequiredConfig, SetRestartRequiredConfig, ClearRestartRequiredConfig) appears only once. The AI summary's claim about duplicate signatures can be disregarded.

Likely an incorrect or invalid review comment.

transports/bifrost-http/handlers/config.go (4)

160-166: LGTM! Consistent with existing config retrieval.

The restart configuration retrieval follows the same pattern as the auth and proxy config fetching above, with appropriate error handling and conditional inclusion in the response.


383-401: Auth change detection logic is sound.

The authentication configuration change detection properly handles various cases:

  • New auth enablement (nil config)
  • Field changes (username, enabled state, inference auth setting)
  • Password changes (excluding redacted values)

The password change detection at line 395 correctly excludes both redacted and empty passwords, which aligns with the validation at lines 404-407 that rejects empty passwords when auth is enabled.


403-427: LGTM! Robust password handling.

The password handling logic properly manages three cases:

  1. Validation when auth is enabled but no existing config
  2. Preservation of existing password when redacted
  3. Hashing of new passwords with proper error handling

The defensive check at lines 411-413 prevents accepting a redacted password when no existing password is available.


600-606: LGTM! Consistent with updateConfig pattern.

The proxy configuration restart flag setting follows the same pattern as in updateConfig, appropriately notifying users that a restart is required after proxy changes.

Optional: Same consideration as the previous comment regarding error logging level applies here (line 605).

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 (8)
ui/components/ui/toggle.tsx (1)

19-22: Consider extracting the conditional from the template literal.

The conditional cursor logic is embedded in a template literal inside cn(). For cleaner code that better leverages clsx's conditional handling, consider separating it:

🔎 Suggested refactor
-			className={cn(
-				`dark:bg-input/30 flex w-full items-center justify-between gap-2 py-2 text-sm select-none ${disabled ? "cursor-default" : "cursor-pointer"}`,
-				className,
-			)}
+			className={cn(
+				"dark:bg-input/30 flex w-full items-center justify-between gap-2 py-2 text-sm select-none",
+				disabled ? "cursor-default" : "cursor-pointer",
+				className,
+			)}
ui/app/workspace/logs/views/columns.tsx (1)

69-69: Consider retaining monospace font for timestamp readability.

Removing font-mono from the timestamp may reduce readability and alignment consistency, as monospace fonts help ensure uniform character width for date-time values. Consider whether this change improves the overall UX or if reverting to font-mono text-xs would be preferable.

transports/bifrost-http/lib/config.go (1)

408-418: Startup clearing of restart-required flag looks right; minor DRY opportunity

Calling ClearRestartRequiredConfig immediately after initializing the config store (both file-backed and default paths) matches the intended “clear on server startup” behavior, and treating failures as warnings is reasonable.

You do duplicate the same clear-and-warn pattern in two places; if this grows (e.g., more init paths), consider a small helper (e.g., clearRestartRequiredIfSupported(ctx, store)) to centralize this behavior and keep future changes consistent.

Also applies to: 1525-1533

framework/configstore/rdb.go (1)

1952-1989: Restart-required config CRUD is consistent; consider using struct-based clear

The new GetRestartRequiredConfig, SetRestartRequiredConfig, and ClearRestartRequiredConfig follow existing TableGovernanceConfig patterns and look correct.

For ClearRestartRequiredConfig, you currently write a hard‑coded JSON string. Using the same struct+json.Marshal path as SetRestartRequiredConfig (e.g., delegating to SetRestartRequiredConfig(ctx, &tables.RestartRequiredConfig{Required: false})) would:

  • Avoid divergence from the Go/TS types if fields change.
  • Respect the omitempty tag on Reason automatically.

Not critical, but it would tighten type safety and reduce duplication.

transports/bifrost-http/handlers/config.go (3)

160-166: Wiring restart_required into GET /api/config is correct; consider only exposing when required

Pulling restartConfig from the store and returning it as restart_required matches the new type and backend API.

If the UI only cares when a restart is actually needed, you may want to only include this field (or set it to null) when restartConfig.Required is true to avoid consumers accidentally keying off mere presence rather than the boolean. This is a minor shape/semantics polish, not a blocker.


220-266: Client/auth restart tracking is reasonable; a few polish opportunities

The restartReasons aggregation for client config (Prometheus labels, allowed origins, pool size, logging, governance, max body size) plus the authChanged detection is a solid way to centralize “restart-required” conditions and surface a single, user-friendly reason string.

Two small suggestions:

  • You might want to deduplicate reasons (or use constants) if this list grows, to avoid accidental duplicates or typos across future call sites.
  • The generated sentence ("<reasons> settings have been updated...") is slightly awkward in the single-reason case; if UX copy matters, branching on len(restartReasons) to choose singular/plural text would read more naturally.

Behavior-wise this looks correct and low-risk.

Also applies to: 371-447


600-606: Proxy updates always flag restart-required—confirm this matches operational intent

Unconditionally setting Required: true in SetRestartRequiredConfig after successfully updating and reloading the proxy config is clear and simple. It will keep the restart banner up until the next server restart, even though you already apply the new config via ReloadProxyConfig.

If that’s intentional (e.g., to signal that long-lived processes or other nodes still need a restart), this is fine. If proxy changes are fully hot‑reloadable, you may want to gate this behind a comparison with the previous config or skip marking restart-required for pure proxy tweaks.

ui/components/ui/promoCardStack.tsx (1)

8-14: Non-dismissible-first sorting and warning variant look good; can DRY the sorter

The changes to:

  • Add variant?: "default" | "warning" on PromoCardItem and apply warning styles to the Card/CardHeader, and
  • Sort so dismissible === false cards are always stacked on top,

are both sensible and match the intended UX.

You do repeat the same sort comparator in both the useState initializer and the useEffect watching cards. Extracting a small helper (e.g., const sortCards = (cards: PromoCardItem[]) => [...cards].sort(...)) would reduce duplication and keep behavior in sync if the sort rules evolve.

Also applies to: 23-31, 36-45, 99-107

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between bce4df2 and 6445a81.

📒 Files selected for processing (14)
  • framework/configstore/rdb.go
  • framework/configstore/store.go
  • framework/configstore/tables/config.go
  • transports/bifrost-http/handlers/config.go
  • transports/bifrost-http/lib/config.go
  • ui/app/workspace/config/views/pricingConfigView.tsx
  • ui/app/workspace/config/views/securityView.tsx
  • ui/app/workspace/logs/views/columns.tsx
  • ui/components/sidebar.tsx
  • ui/components/ui/promoCardStack.tsx
  • ui/components/ui/sheet.tsx
  • ui/components/ui/toggle.tsx
  • ui/lib/constants/logs.ts
  • ui/lib/types/config.ts
🚧 Files skipped from review as they are similar to previous changes (7)
  • framework/configstore/tables/config.go
  • ui/components/ui/sheet.tsx
  • ui/lib/constants/logs.ts
  • ui/app/workspace/config/views/pricingConfigView.tsx
  • ui/app/workspace/config/views/securityView.tsx
  • framework/configstore/store.go
  • ui/components/sidebar.tsx
🧰 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:

  • transports/bifrost-http/handlers/config.go
  • ui/components/ui/promoCardStack.tsx
  • ui/lib/types/config.ts
  • ui/components/ui/toggle.tsx
  • transports/bifrost-http/lib/config.go
  • ui/app/workspace/logs/views/columns.tsx
  • framework/configstore/rdb.go
🧠 Learnings (2)
📚 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:

  • transports/bifrost-http/handlers/config.go
  • transports/bifrost-http/lib/config.go
  • framework/configstore/rdb.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/config.go
  • transports/bifrost-http/lib/config.go
🧬 Code graph analysis (5)
ui/components/ui/promoCardStack.tsx (1)
ui/components/ui/card.tsx (1)
  • CardHeader (50-50)
ui/lib/types/config.ts (1)
framework/configstore/tables/config.go (1)
  • RestartRequiredConfig (16-19)
ui/components/ui/toggle.tsx (1)
ui/lib/utils.ts (1)
  • cn (4-6)
ui/app/workspace/logs/views/columns.tsx (1)
ui/lib/constants/logs.ts (2)
  • Status (173-173)
  • StatusBarColors (84-89)
framework/configstore/rdb.go (2)
framework/configstore/tables/config.go (4)
  • RestartRequiredConfig (16-19)
  • TableGovernanceConfig (40-43)
  • TableGovernanceConfig (46-46)
  • ConfigRestartRequiredKey (11-11)
ui/lib/types/config.ts (1)
  • RestartRequiredConfig (303-306)
⏰ Context from checks skipped due to timeout of 900000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (10)
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
  • GitHub Check: Graphite / mergeability_check
🔇 Additional comments (2)
ui/components/ui/toggle.tsx (1)

3-3: LGTM! Improved component flexibility.

The addition of the optional className prop and the cn utility import enables flexible external styling customization, which is a good practice for reusable UI components.

Also applies to: 6-6, 15-15

ui/lib/types/config.ts (1)

302-315: RestartRequiredConfig type matches backend shape

The RestartRequiredConfig interface and optional restart_required field on BifrostConfig align with the Go struct (required / reason) and the handler response keys, so UI consumers can rely on strong typing here. No changes needed.

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.

2 participants