Skip to content

feat: wires prompt plugin selections into logs view#2592

Merged
akshaydeo merged 1 commit intov1.5.0from
04-09-feat_wires_prompt_deployment_selections_into_logs_view
Apr 16, 2026
Merged

feat: wires prompt plugin selections into logs view#2592
akshaydeo merged 1 commit intov1.5.0from
04-09-feat_wires_prompt_deployment_selections_into_logs_view

Conversation

@roroghost17
Copy link
Copy Markdown
Contributor

@roroghost17 roroghost17 commented Apr 9, 2026

Summary

Adds support for tracking and displaying selected prompt information in the logging system. This enhancement allows users to see which prompt name and version were used for each logged request in the UI.

Changes

  • Added selected_prompt_name and selected_prompt_version columns to the Log table schema
  • Created database migration to add the new columns with proper rollback support
  • Updated logging plugin to extract prompt information from context and populate the new fields
  • Enhanced UI log detail view to display selected prompt name and version when available
  • Added TypeScript type definitions for the new prompt fields

Type of change

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

Affected areas

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

How to test

Verify the database migration runs successfully and the UI displays prompt information:

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

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

Test that logs with prompt information display the "Selected Prompt" field in the log detail view, showing both name and version when available.

Screenshots/Recordings

The UI now displays a "Selected Prompt" field in the log detail view showing the prompt name and version (e.g., "my-prompt · v1.2").

Breaking changes

  • Yes
  • No

Related issues

Enhances logging capabilities for prompt tracking in enterprise deployments and prompts plugin usage.

Security considerations

No security implications - this only adds display fields for prompt metadata that's already available in the system context.

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

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@roroghost17 roroghost17 force-pushed the 04-09-feat_wires_prompt_deployment_selections_into_logs_view branch from ef51bbc to f26655a Compare April 9, 2026 13:22
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from 729fa28 to bf18504 Compare April 9, 2026 13:22
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 9, 2026

Warning

Rate limit exceeded

@akshaydeo has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 1 minutes and 4 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 1 minutes and 4 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a5b43e2f-93c9-4950-abd2-d8bc73e31b90

📥 Commits

Reviewing files that changed from the base of the PR and between 49c6229 and bb4ca6e.

📒 Files selected for processing (15)
  • framework/logstore/migrations.go
  • framework/logstore/tables.go
  • plugins/logging/main.go
  • plugins/logging/writer.go
  • transports/bifrost-http/handlers/prompts.go
  • ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentsAccordionItem.tsx
  • ui/app/workspace/logs/sheets/logDetailView.tsx
  • ui/app/workspace/logs/sheets/logDetailsSheet.tsx
  • ui/app/workspace/prompt-repo/deployments/layout.tsx
  • ui/app/workspace/prompt-repo/layout.tsx
  • ui/app/workspace/prompt-repo/prompts/page.tsx
  • ui/app/workspace/routing-rules/views/routingRuleSheet.tsx
  • ui/components/ui/custom/celBuilder/queryBuilderWrapper.css
  • ui/components/ui/custom/celBuilder/valueEditor.tsx
  • ui/lib/types/logs.ts
📝 Walkthrough

Walkthrough

Adds persisted selected-prompt fields to logs (DB migration + model), threads selected-prompt metadata from logging plugin through writer into persisted logs, surfaces those fields in frontend types and detail views, adjusts prompt-repo routing, and tweaks UI and session handlers.

Changes

Cohort / File(s) Summary
Database Schema & Model
framework/logstore/migrations.go, framework/logstore/tables.go
Added transactional migration to add/drop selected_prompt_id, selected_prompt_name, selected_prompt_version; added three nullable fields to Log GORM model with JSON/GORM tags.
Logging Plugin & Writer
plugins/logging/main.go, plugins/logging/writer.go
PostLLMHook now reads selectedPromptID, selectedPromptName, selectedPromptVersion from context and forwards them; applyOutputFieldsToEntry signature expanded and sets the new fields when non-empty.
Frontend — Logs UI & Types
ui/lib/types/logs.ts, ui/app/workspace/logs/sheets/logDetailView.tsx, ui/app/workspace/logs/sheets/logDetailsSheet.tsx
Added optional selected_prompt_id, selected_prompt_name, selected_prompt_version to LogEntry; resolve prompt name via prompt query and render a conditional "Selected Prompt" row combining name and version.
Frontend — Prompt Repo Routing
ui/app/workspace/prompt-repo/layout.tsx, ui/app/workspace/prompt-repo/prompts/page.tsx, ui/app/workspace/prompt-repo/deployments/layout.tsx
Added file route for /workspace/prompt-repo; removed deployments file-route export; replaced server-side redirect with client-side TanStack Router navigation using location.searchStr + replace.
Frontend — Small UI / Imports
ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentsAccordionItem.tsx, ui/app/workspace/routing-rules/views/routingRuleSheet.tsx
Accordion trigger gets rotation class and label bolded; lazy/Suspense imported to support lazy-loaded CEL builder.
Frontend — CEL ValueEditor
ui/components/ui/custom/celBuilder/valueEditor.tsx
Introduced CELValueEditorContext type and updated ValueEditor props to accept optional context with validateRegex, menuPosition, menuPortalTarget.
API Handler — Prompt Sessions
transports/bifrost-http/handlers/prompts.go
createSession initializes req.Variables from version variable keys when version_id provided but variables empty; updateSession only overwrites session.Variables when req.Variables is non-nil.

Sequence Diagram

sequenceDiagram
    participant Plugin as Plugin (Logging)
    participant Writer as Writer
    participant DB as Database
    participant UI as Log Detail View

    Plugin->>Plugin: read selectedPromptID/Name/Version from context
    Plugin->>Writer: call applyOutputFieldsToEntry(..., selectedPromptID, selectedPromptName, selectedPromptVersion)
    Writer->>Writer: set entry.SelectedPromptID/Name/Version when non-empty
    Writer->>DB: persist Log (includes new selected_prompt_* columns)
    UI->>DB: fetch log details (may call prompt service)
    DB->>UI: return log with selected_prompt_* fields
    UI->>UI: render "Selected Prompt" when present (name · v{version})
Loading

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through schema, hook, and view,
I tucked an ID, a name, and version too.
From plugin to writer, then stored in rows,
The UI fetches, and the selected prompt shows.
Tiny carrots of metadata — tidy and new.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 44.44% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The pull request title clearly and concisely describes the main objective—wiring prompt plugin selections into the logs view—which aligns with the primary changes across the codebase.
Description check ✅ Passed The description follows the template structure with all major sections completed: summary, changes, type of change, affected areas, how to test, and breaking changes. The author provided adequate detail about the feature implementation.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch 04-09-feat_wires_prompt_deployment_selections_into_logs_view

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

@roroghost17 roroghost17 changed the title feat: wires prompt deployment selections into logs view feat: wires prompt plugin selections into logs view Apr 9, 2026
@roroghost17 roroghost17 force-pushed the 04-09-feat_wires_prompt_deployment_selections_into_logs_view branch 2 times, most recently from b1f1308 to f86aa39 Compare April 10, 2026 06:55
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from bf18504 to 36cfa1c Compare April 10, 2026 06:55
@roroghost17 roroghost17 force-pushed the 04-09-feat_wires_prompt_deployment_selections_into_logs_view branch from f86aa39 to f3b4175 Compare April 10, 2026 07:03
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from 36cfa1c to 32633c8 Compare April 10, 2026 07:03
@roroghost17 roroghost17 marked this pull request as ready for review April 10, 2026 07:24
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 10, 2026

Confidence Score: 5/5

Safe to merge; all findings are P2 style suggestions that don't block correctness or data integrity.

Both remaining findings are non-blocking: a missing index (easy to add later if filtering by prompt becomes a use case) and a tab/space inconsistency in a TypeScript type file. No logic errors, no security issues, and the migration is idempotent with proper rollback support.

framework/logstore/tables.go (missing index) and ui/lib/types/logs.ts (indentation inconsistency).

Important Files Changed

Filename Overview
framework/logstore/migrations.go Adds migrationAddSelectedPromptColumns migration with proper idempotent HasColumn guards and rollback support; wired into triggerMigrations correctly.
framework/logstore/tables.go Adds SelectedPromptName, SelectedPromptVersion, SelectedPromptID nullable string columns to Log struct; SelectedPromptID lacks a database index unlike the similar RoutingRuleID field.
plugins/logging/main.go Reads the three new prompt context keys and passes them to applyOutputFieldsToEntry; consistent with existing pattern for routing rule fields.
plugins/logging/writer.go Adds prompt fields to applyOutputFieldsToEntry, assigning pointer values only when non-empty; consistent with how all other optional fields are handled.
transports/bifrost-http/handlers/prompts.go Adds variable placeholder initialization from version schema in createSession, and guards updateSession from clearing variables when req.Variables is nil.
ui/lib/types/logs.ts Adds three optional prompt fields to LogEntry; new lines use tab indentation while the surrounding interface uses 2-space indentation.
ui/app/workspace/logs/sheets/logDetailsSheet.tsx Adds parallel useGetPromptQuery fetch alongside the existing useGetLogByIdQuery; resolves prompt name with proper fallback chain to stored log data.
ui/app/workspace/logs/sheets/logDetailView.tsx Renders 'Selected Prompt' row when any of the three prompt fields is set; display logic correctly handles partial data (name-only, version-only, or both).
ui/app/workspace/prompt-repo/prompts/page.tsx Migrates redirect from Next.js redirect() to TanStack Router useNavigate inside a useEffect, preserving query string forwarding.
ui/app/workspace/routing-rules/views/routingRuleSheet.tsx Lazy-loads the CEL builder behind a Suspense boundary; lazy and Suspense imports are properly used in the component body.
ui/components/ui/custom/celBuilder/valueEditor.tsx Adds explicit CELValueEditorContext type and updates function signature to type the context prop; logic is unchanged.
ui/components/ui/custom/celBuilder/queryBuilderWrapper.css New CSS file for query builder styling; missing newline at end of file.
ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentsAccordionItem.tsx Minor styling tweaks: bolds 'Deployments' label and adds chevron rotation class to AccordionTrigger.
ui/app/workspace/prompt-repo/layout.tsx New route file wiring /workspace/prompt-repo to PromptsPage; replaces the deleted deployments/layout.tsx.

Reviews (18): Last reviewed commit: "feat: wires prompt deployment selections..." | Re-trigger Greptile

Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 12, 2026

✅ Actions performed

Full review triggered.

Copy link
Copy Markdown
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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
plugins/logging/writer.go (1)

349-381: ⚠️ Potential issue | 🟡 Minor

Clamp prompt metadata to column limits before assignment.

These values are written into varchar(255) / varchar(64) columns. Unbounded values here can fail inserts and end up dropping logs in fallback paths.

Suggested defensive fix
 import (
 	"sync"
 	"time"
+	"unicode/utf8"

 	"github.com/maximhq/bifrost/framework/logstore"
 )
+
+func truncateRunes(s string, max int) string {
+	if utf8.RuneCountInString(s) <= max {
+		return s
+	}
+	r := []rune(s)
+	return string(r[:max])
+}
@@
 	if selectedPromptName != "" {
-		entry.SelectedPromptName = selectedPromptName
+		entry.SelectedPromptName = truncateRunes(selectedPromptName, 255)
 	}
 	if selectedPromptVersion != "" {
-		entry.SelectedPromptVersion = selectedPromptVersion
+		entry.SelectedPromptVersion = truncateRunes(selectedPromptVersion, 64)
 	}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plugins/logging/writer.go` around lines 349 - 381, The selected prompt fields
can exceed DB column limits and cause insert failures; in
applyOutputFieldsToEntry truncate selectedPromptName to at most 255 characters
and selectedPromptVersion to at most 64 characters before assigning (e.g. if
len(selectedPromptName) > 255 { selectedPromptName = selectedPromptName[:255] }
and similarly for selectedPromptVersion), then assign the truncated values to
entry.SelectedPromptName and entry.SelectedPromptVersion; consider extracting a
small helper truncateString(s string, max int) string and use it here to keep
the code concise.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@framework/logstore/tables.go`:
- Around line 122-123: The new struct fields SelectedPromptName and
SelectedPromptVersion are nullable in the model; update their GORM tags to
enforce NOT NULL with a default empty string (e.g., add gorm:"NOT
NULL;default:''") and add a migration/backfill step that updates existing rows
to '' for these columns (run an UPDATE setting them to empty string before
altering the schema or include the backfill in the same migration function), so
reads never rely on NULL-to-empty behavior; modify the migration code that
creates/updates the logstore table to include this backfill and the NOT
NULL/default change for SelectedPromptName and SelectedPromptVersion.

---

Outside diff comments:
In `@plugins/logging/writer.go`:
- Around line 349-381: The selected prompt fields can exceed DB column limits
and cause insert failures; in applyOutputFieldsToEntry truncate
selectedPromptName to at most 255 characters and selectedPromptVersion to at
most 64 characters before assigning (e.g. if len(selectedPromptName) > 255 {
selectedPromptName = selectedPromptName[:255] } and similarly for
selectedPromptVersion), then assign the truncated values to
entry.SelectedPromptName and entry.SelectedPromptVersion; consider extracting a
small helper truncateString(s string, max int) string and use it here to keep
the code concise.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 186209f3-f42c-4e0f-bcda-5a723de5b439

📥 Commits

Reviewing files that changed from the base of the PR and between 32633c8 and f3b4175.

📒 Files selected for processing (7)
  • framework/logstore/migrations.go
  • framework/logstore/tables.go
  • plugins/logging/main.go
  • plugins/logging/writer.go
  • ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentsAccordionItem.tsx
  • ui/app/workspace/logs/sheets/logDetailView.tsx
  • ui/lib/types/logs.ts

Comment thread framework/logstore/tables.go Outdated
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from 32633c8 to 7dca2fa Compare April 13, 2026 12:27
@roroghost17 roroghost17 force-pushed the 04-09-feat_wires_prompt_deployment_selections_into_logs_view branch from f3b4175 to 4328bda Compare April 13, 2026 12:27
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from 7dca2fa to 77b89ed Compare April 13, 2026 12:34
@roroghost17 roroghost17 force-pushed the 04-09-feat_wires_prompt_deployment_selections_into_logs_view branch from 4328bda to 427ec08 Compare April 13, 2026 12:34
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from 77b89ed to e335344 Compare April 13, 2026 12:37
@roroghost17 roroghost17 force-pushed the 04-09-feat_wires_prompt_deployment_selections_into_logs_view branch 2 times, most recently from 588c64e to 58d68d4 Compare April 13, 2026 13:46
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from e335344 to 43002ba Compare April 13, 2026 13:46
Copy link
Copy Markdown
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: 2

🧹 Nitpick comments (1)
ui/components/ui/custom/celBuilder/valueEditor.tsx (1)

23-30: Prefer overriding context via Omit instead of intersection to preserve type narrowing.

ValueEditorProps & { context?: CELValueEditorContext } loses type narrowing because ValueEditorProps.context is any in react-querybuilder. Use Omit<ValueEditorProps, "context"> to guarantee strong typing for the context property.

♻️ Proposed typing fix
+type CELValueEditorProps = Omit<ValueEditorProps, "context"> & {
+	context?: CELValueEditorContext;
+};
+
 export function ValueEditor({
 	value,
 	handleOnChange,
 	operator,
 	fieldData,
 	type,
 	context,
-}: ValueEditorProps & { context?: CELValueEditorContext }) {
+}: CELValueEditorProps) {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ui/components/ui/custom/celBuilder/valueEditor.tsx` around lines 23 - 30, The
component signature for ValueEditor uses an intersection that overrides the
existing ValueEditorProps.context (which is any) and loses type narrowing;
change the props type to Omit<ValueEditorProps, "context"> & { context?:
CELValueEditorContext } so the explicit context prop has strong typing, update
the function parameter destructuring to match the new props type, and ensure any
downstream uses of ValueEditor or references to ValueEditorProps/context respect
the Omit-based signature (search for ValueEditor, ValueEditorProps, and
CELValueEditorContext to apply the change).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@framework/logstore/tables.go`:
- Line 124: SelectedPromptID is declared with `gorm:"type:varchar(32)"` causing
UUID prompt IDs to be truncated; update the struct field `SelectedPromptID` in
tables.go to use `gorm:"type:varchar(36)"` so it matches the canonical
TablePrompt UUID width and preserves full prompt IDs for lookups and storage.

In `@ui/app/workspace/prompt-repo/prompts/page.tsx`:
- Around line 8-10: The useEffect block calling navigate uses the wrong
property: change the navigate call in the useEffect (the one referencing
navigate and searchStr) to pass the route via the to property instead of
href—i.e., navigate({ to: `/workspace/prompt-repo${searchStr}`, replace: true
})—so it uses TanStack Router's internal-route key while keeping replace: true
and the existing dependencies (navigate, searchStr).

---

Nitpick comments:
In `@ui/components/ui/custom/celBuilder/valueEditor.tsx`:
- Around line 23-30: The component signature for ValueEditor uses an
intersection that overrides the existing ValueEditorProps.context (which is any)
and loses type narrowing; change the props type to Omit<ValueEditorProps,
"context"> & { context?: CELValueEditorContext } so the explicit context prop
has strong typing, update the function parameter destructuring to match the new
props type, and ensure any downstream uses of ValueEditor or references to
ValueEditorProps/context respect the Omit-based signature (search for
ValueEditor, ValueEditorProps, and CELValueEditorContext to apply the change).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 59f824c9-65c5-410c-9063-780340f74939

📥 Commits

Reviewing files that changed from the base of the PR and between cf39d55 and c461198.

📒 Files selected for processing (11)
  • framework/logstore/migrations.go
  • framework/logstore/tables.go
  • plugins/logging/main.go
  • plugins/logging/writer.go
  • ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentsAccordionItem.tsx
  • ui/app/workspace/logs/sheets/logDetailView.tsx
  • ui/app/workspace/prompt-repo/deployments/layout.tsx
  • ui/app/workspace/prompt-repo/prompts/page.tsx
  • ui/app/workspace/routing-rules/views/routingRuleSheet.tsx
  • ui/components/ui/custom/celBuilder/valueEditor.tsx
  • ui/lib/types/logs.ts
💤 Files with no reviewable changes (1)
  • ui/app/workspace/prompt-repo/deployments/layout.tsx
✅ Files skipped from review due to trivial changes (3)
  • ui/app/workspace/routing-rules/views/routingRuleSheet.tsx
  • ui/lib/types/logs.ts
  • ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentsAccordionItem.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
  • framework/logstore/migrations.go
  • plugins/logging/writer.go

Comment thread framework/logstore/tables.go Outdated
Comment thread ui/app/workspace/prompt-repo/prompts/page.tsx
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from 58be647 to 6b59828 Compare April 15, 2026 21:42
@roroghost17 roroghost17 force-pushed the 04-09-feat_wires_prompt_deployment_selections_into_logs_view branch 2 times, most recently from 71b2e2e to 1850fe2 Compare April 15, 2026 21:46
Copy link
Copy Markdown
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.

♻️ Duplicate comments (1)
framework/logstore/tables.go (1)

124-124: ⚠️ Potential issue | 🔴 Critical

Prevent selected_prompt_id truncation at the schema layer.

Line 124 defines SelectedPromptID as varchar(32), which can truncate UUID-width prompt IDs and break downstream lookups/joins.

💡 Proposed fix
-	SelectedPromptID        *string   `gorm:"type:varchar(32)" json:"selected_prompt_id"`
+	SelectedPromptID        *string   `gorm:"type:varchar(36)" json:"selected_prompt_id"`

Also ensure the corresponding migration column type matches this width.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@framework/logstore/tables.go` at line 124, The SelectedPromptID field in
tables.go is declared as SelectedPromptID `gorm:"type:varchar(32)"`
(selected_prompt_id) which can truncate standard UUIDs; change the GORM column
type to a width that supports full UUIDs (e.g., varchar(36) or CHAR(36)) in the
SelectedPromptID tag and update the corresponding migration that creates/alter
the selected_prompt_id column so the DB column type matches the new width to
avoid truncation in lookups/joins.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@framework/logstore/tables.go`:
- Line 124: The SelectedPromptID field in tables.go is declared as
SelectedPromptID `gorm:"type:varchar(32)"` (selected_prompt_id) which can
truncate standard UUIDs; change the GORM column type to a width that supports
full UUIDs (e.g., varchar(36) or CHAR(36)) in the SelectedPromptID tag and
update the corresponding migration that creates/alter the selected_prompt_id
column so the DB column type matches the new width to avoid truncation in
lookups/joins.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e08cc5d6-aa5c-4245-9d01-5f2861ac4c7c

📥 Commits

Reviewing files that changed from the base of the PR and between c461198 and 71b2e2e.

📒 Files selected for processing (11)
  • framework/logstore/migrations.go
  • framework/logstore/tables.go
  • plugins/logging/main.go
  • plugins/logging/writer.go
  • ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentsAccordionItem.tsx
  • ui/app/workspace/logs/sheets/logDetailView.tsx
  • ui/app/workspace/prompt-repo/deployments/layout.tsx
  • ui/app/workspace/prompt-repo/prompts/page.tsx
  • ui/app/workspace/routing-rules/views/routingRuleSheet.tsx
  • ui/components/ui/custom/celBuilder/valueEditor.tsx
  • ui/lib/types/logs.ts
💤 Files with no reviewable changes (1)
  • ui/app/workspace/prompt-repo/deployments/layout.tsx
✅ Files skipped from review due to trivial changes (4)
  • ui/app/workspace/routing-rules/views/routingRuleSheet.tsx
  • ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentsAccordionItem.tsx
  • ui/app/workspace/prompt-repo/prompts/page.tsx
  • framework/logstore/migrations.go
🚧 Files skipped from review as they are similar to previous changes (3)
  • ui/lib/types/logs.ts
  • plugins/logging/main.go
  • ui/components/ui/custom/celBuilder/valueEditor.tsx

@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from 6b59828 to f13c53d Compare April 16, 2026 08:05
@roroghost17 roroghost17 force-pushed the 04-09-feat_wires_prompt_deployment_selections_into_logs_view branch from 1850fe2 to a6c42d2 Compare April 16, 2026 08:05
Copy link
Copy Markdown
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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ui/app/workspace/logs/sheets/logDetailsSheet.tsx`:
- Line 65: resolvedSelectedPromptName currently prefers
selectedPromptData?.prompt?.name over the persisted
displayLog.selected_prompt_name, which causes historical logs to show renamed
prompt names; change the order so displayLog.selected_prompt_name is used first
(falling back to selectedPromptData?.prompt?.name and then ""), i.e. use
displayLog.selected_prompt_name ?? selectedPromptData?.prompt?.name ?? "" when
computing resolvedSelectedPromptName to ensure stored log names are preserved.
- Around line 54-61: The useGetPromptQuery hook is conditionally called after an
early return when log is falsy, causing hooks order mismatch; move the call to
useGetPromptQuery above the early return so hooks are always invoked in the same
order, compute selectedPromptId safely (derive it from
log/fullLog/isFullDataReady/open but do not return early before the hook), and
keep the skip option set to true when open is false or selectedPromptId is falsy
(e.g., skip: !open || !selectedPromptId) so the hook runs consistently but does
nothing when there is no prompt.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a7ff0b68-f609-45ae-b3a3-dc7105cf8f16

📥 Commits

Reviewing files that changed from the base of the PR and between 1850fe2 and a6c42d2.

📒 Files selected for processing (13)
  • framework/logstore/migrations.go
  • framework/logstore/tables.go
  • plugins/logging/main.go
  • plugins/logging/writer.go
  • ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentsAccordionItem.tsx
  • ui/app/workspace/logs/sheets/logDetailView.tsx
  • ui/app/workspace/logs/sheets/logDetailsSheet.tsx
  • ui/app/workspace/prompt-repo/deployments/layout.tsx
  • ui/app/workspace/prompt-repo/layout.tsx
  • ui/app/workspace/prompt-repo/prompts/page.tsx
  • ui/app/workspace/routing-rules/views/routingRuleSheet.tsx
  • ui/components/ui/custom/celBuilder/valueEditor.tsx
  • ui/lib/types/logs.ts
💤 Files with no reviewable changes (1)
  • ui/app/workspace/prompt-repo/deployments/layout.tsx
✅ Files skipped from review due to trivial changes (3)
  • ui/app/workspace/routing-rules/views/routingRuleSheet.tsx
  • ui/app/workspace/prompt-repo/layout.tsx
  • ui/lib/types/logs.ts
🚧 Files skipped from review as they are similar to previous changes (6)
  • ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentsAccordionItem.tsx
  • ui/app/workspace/prompt-repo/prompts/page.tsx
  • framework/logstore/migrations.go
  • ui/app/workspace/logs/sheets/logDetailView.tsx
  • framework/logstore/tables.go
  • ui/components/ui/custom/celBuilder/valueEditor.tsx

Comment thread ui/app/workspace/logs/sheets/logDetailsSheet.tsx Outdated
Comment thread ui/app/workspace/logs/sheets/logDetailsSheet.tsx
@roroghost17 roroghost17 force-pushed the 04-09-feat_wires_prompt_deployment_selections_into_logs_view branch 2 times, most recently from e6ae152 to 3fa3852 Compare April 16, 2026 10:53
Copy link
Copy Markdown
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)
ui/components/ui/custom/celBuilder/valueEditor.tsx (1)

17-21: Share CELValueEditorContext between producer and consumer to prevent type drift.

Line 17 defines the context contract locally. Consider exporting this type and reusing it in ui/components/ui/custom/celBuilder/celRuleBuilder.tsx where the context object is constructed, so stacked PR changes can’t silently diverge the shape.

As per coding guidelines: "**: 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)".

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ui/components/ui/custom/celBuilder/valueEditor.tsx` around lines 17 - 21,
Export the CELValueEditorContext type so the producer (where it's defined in
valueEditor.tsx) and the consumer (where the context object is constructed in
celRuleBuilder.tsx) share the exact contract; update valueEditor.tsx to export
the type (CELValueEditorContext) and import that exported type into
ui/components/ui/custom/celBuilder/celRuleBuilder.tsx, then use the imported
type when creating/typing the context object to prevent divergence.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ui/app/workspace/logs/sheets/logDetailsSheet.tsx`:
- Around line 46-50: The sheet readiness check currently blocks rendering until
a successful full-log fetch; update the isFullDataReady boolean (and any similar
readiness checks around the useGetLogByIdQuery usage) to treat fetch errors as
"ready" by including the isError flag from the useGetLogByIdQuery result (e.g.,
change the condition to check fullLog?.id === log.id && (!isLoading ||
isError)), so the component can render the base row while retries continue in
the background; apply the same change to the related readiness checks referenced
around the selectedPromptId logic and any other places that only considered
!isLoading.

---

Nitpick comments:
In `@ui/components/ui/custom/celBuilder/valueEditor.tsx`:
- Around line 17-21: Export the CELValueEditorContext type so the producer
(where it's defined in valueEditor.tsx) and the consumer (where the context
object is constructed in celRuleBuilder.tsx) share the exact contract; update
valueEditor.tsx to export the type (CELValueEditorContext) and import that
exported type into ui/components/ui/custom/celBuilder/celRuleBuilder.tsx, then
use the imported type when creating/typing the context object to prevent
divergence.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: d70fd994-cec2-44ed-b8fc-2cc4015565c8

📥 Commits

Reviewing files that changed from the base of the PR and between a6c42d2 and 3fa3852.

📒 Files selected for processing (14)
  • framework/logstore/migrations.go
  • framework/logstore/tables.go
  • plugins/logging/main.go
  • plugins/logging/writer.go
  • transports/bifrost-http/handlers/prompts.go
  • ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentsAccordionItem.tsx
  • ui/app/workspace/logs/sheets/logDetailView.tsx
  • ui/app/workspace/logs/sheets/logDetailsSheet.tsx
  • ui/app/workspace/prompt-repo/deployments/layout.tsx
  • ui/app/workspace/prompt-repo/layout.tsx
  • ui/app/workspace/prompt-repo/prompts/page.tsx
  • ui/app/workspace/routing-rules/views/routingRuleSheet.tsx
  • ui/components/ui/custom/celBuilder/valueEditor.tsx
  • ui/lib/types/logs.ts
💤 Files with no reviewable changes (1)
  • ui/app/workspace/prompt-repo/deployments/layout.tsx
✅ Files skipped from review due to trivial changes (3)
  • ui/app/_fallbacks/enterprise/components/prompt-deployments/promptDeploymentsAccordionItem.tsx
  • ui/app/workspace/routing-rules/views/routingRuleSheet.tsx
  • ui/app/workspace/prompt-repo/layout.tsx
🚧 Files skipped from review as they are similar to previous changes (5)
  • plugins/logging/main.go
  • ui/app/workspace/prompt-repo/prompts/page.tsx
  • ui/lib/types/logs.ts
  • ui/app/workspace/logs/sheets/logDetailView.tsx
  • plugins/logging/writer.go

Comment thread ui/app/workspace/logs/sheets/logDetailsSheet.tsx Outdated
@roroghost17 roroghost17 force-pushed the 04-09-feat_wires_prompt_deployment_selections_into_logs_view branch from 3fa3852 to 6fd8f22 Compare April 16, 2026 11:20
coderabbitai[bot]
coderabbitai Bot previously approved these changes Apr 16, 2026
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from f13c53d to 31196ed Compare April 16, 2026 11:42
@roroghost17 roroghost17 force-pushed the 04-09-feat_wires_prompt_deployment_selections_into_logs_view branch from 6fd8f22 to 49c6229 Compare April 16, 2026 11:42
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from 31196ed to 7462cc9 Compare April 16, 2026 14:50
@roroghost17 roroghost17 force-pushed the 04-09-feat_wires_prompt_deployment_selections_into_logs_view branch from 49c6229 to 27ce7d3 Compare April 16, 2026 14:50
@roroghost17 roroghost17 force-pushed the 04-09-feat_wires_prompt_deployment_selections_into_logs_view branch from 27ce7d3 to e208a8a Compare April 16, 2026 15:52
@roroghost17 roroghost17 force-pushed the 04-07-refactor_updates_prompt_model_parameters_ui branch from 7462cc9 to 2a1ede0 Compare April 16, 2026 15:52
Copy link
Copy Markdown
Contributor

akshaydeo commented Apr 16, 2026

Merge activity

  • Apr 16, 4:34 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 16, 4:45 PM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 16, 4:46 PM UTC: @akshaydeo merged this pull request with Graphite.

@akshaydeo akshaydeo changed the base branch from 04-07-refactor_updates_prompt_model_parameters_ui to graphite-base/2592 April 16, 2026 16:41
@akshaydeo akshaydeo changed the base branch from graphite-base/2592 to v1.5.0 April 16, 2026 16:43
@akshaydeo akshaydeo dismissed coderabbitai[bot]’s stale review April 16, 2026 16:43

The base branch was changed.

@akshaydeo akshaydeo force-pushed the 04-09-feat_wires_prompt_deployment_selections_into_logs_view branch from e208a8a to bb4ca6e Compare April 16, 2026 16:44
@akshaydeo akshaydeo merged commit 46c171b into v1.5.0 Apr 16, 2026
10 of 15 checks passed
@akshaydeo akshaydeo deleted the 04-09-feat_wires_prompt_deployment_selections_into_logs_view branch April 16, 2026 16:46
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.

3 participants