Skip to content

fix(dashboard): initialize prompts at startup for System Prompt tab#592

Merged
zbigniewsobiecki merged 1 commit intodevfrom
fix/dashboard-init-prompts
Mar 1, 2026
Merged

fix(dashboard): initialize prompts at startup for System Prompt tab#592
zbigniewsobiecki merged 1 commit intodevfrom
fix/dashboard-init-prompts

Conversation

@zbigniewsobiecki
Copy link
Copy Markdown
Member

Summary

  • Fix blank System Prompt tab in Agent Definition Editor by calling initPrompts() at dashboard startup
  • Add proper error handling with Sentry capture and graceful exit on startup failure
  • Match the async startup pattern used in src/router/index.ts

Root Cause

The dashboard API (src/dashboard.ts) was not calling initPrompts() at startup. When the frontend called trpc.prompts.getDefault, the API called getRawTemplate() which threw because prompts weren't initialized. The frontend had no error handling for this, resulting in a blank textarea.

Changes

  • Add initPrompts() import and call in async startDashboard() function
  • Add flush import from sentry for proper error handling
  • Wrap server startup in named async function with .catch() error handler
  • On startup failure: log error, capture to Sentry with level: 'fatal', flush events, exit with code 1

Test plan

  • Lint passes (npm run lint)
  • Typecheck passes (npm run typecheck)
  • All 3557 unit tests pass (npm test)
  • After deployment: Open dashboard → Agent Definitions → Select any agent → System Prompt tab shows content
  • "Reset to Default" button populates editor with default template

🤖 Generated with Claude Code

The dashboard API was not calling initPrompts() at startup, causing
the System Prompt tab in the Agent Definition Editor to show blank
content. The prompts tRPC router calls getRawTemplate() which requires
initPrompts() to be called first.

Changes:
- Add initPrompts() call in async startDashboard() function
- Add proper error handling with Sentry capture and flush before exit
- Match the startup pattern used in src/router/index.ts

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@zbigniewsobiecki zbigniewsobiecki merged commit e8719a1 into dev Mar 1, 2026
6 checks passed
@zbigniewsobiecki zbigniewsobiecki deleted the fix/dashboard-init-prompts branch March 1, 2026 13:52
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.

1 participant