feat(config): make dashboard URL configurable for self-hosted deployments#67
feat(config): make dashboard URL configurable for self-hosted deployments#67djuntgen wants to merge 1 commit into
Conversation
…ents Session "view your session" links were hardcoded to https://app.honcho.dev, so self-hosters — whose data lives on their own instance — got links pointing at the SaaS dashboard (which doesn't have their sessions). The GUI is commonly served on a different host than the API (e.g. API at honcho.example.com, GUI at dashboard.example.com), so it can't just be derived from endpoint.baseUrl. Add an independently configurable dashboard base URL: - endpoint.dashboardUrl config field - HONCHO_DASHBOARD_URL env var (takes precedence, matching existing env pattern) - set_config MCP field (endpoint.dashboardUrl; empty string clears the override) Resolution: HONCHO_DASHBOARD_URL > endpoint.dashboardUrl > https://app.honcho.dev. Trailing slashes are normalized. honchoSessionUrl()/sessionLine() keep the hosted default, so hosted users see no change; all call sites (session-start, user-prompt, mcp/server) thread the resolved value. setEndpoint() preserves an existing custom dashboard URL across API-environment switches. README + CHANGELOG documented. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Km4oh3yBKgksgH4e5HExMw
WalkthroughThis PR adds a configurable dashboard base URL for session links, defaulting to ChangesConfigurable Dashboard URL for Session Links
Estimated code review effort: 2 (Simple) | ~15 minutes Sequence Diagram(s)sequenceDiagram
participant Hook as session-start/user-prompt Hook
participant Config as config.ts
participant Styles as styles.ts (honchoSessionUrl)
participant MCP as mcp/server.ts
Hook->>Config: getDashboardUrl(config)
Config->>Config: resolve env var / endpoint.dashboardUrl / default
Config-->>Hook: dashboardBaseUrl
Hook->>Styles: honchoSessionUrl(workspace, sessionName, dashboardBaseUrl)
Styles-->>Hook: session link URL
MCP->>Config: getDashboardUrl(cfg)
Config-->>MCP: dashboardBaseUrl
MCP->>Styles: honchoSessionUrl(..., dashboardBaseUrl)
Styles-->>MCP: sessionUrl for get_config/set_config response
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
plugins/honcho/src/styles.ts (1)
149-163: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winConsider eliminating the duplicated
DEFAULT_DASHBOARD_URLconstant.The same constant
"https://app.honcho.dev"is defined independently here and inconfig.ts(line 62). If they diverge,getDashboardUrl()(config.ts) and thehonchoSessionUrldefault (styles.ts) would resolve to different hosted URLs, producing inconsistent session links for any caller that relies on the default.Export it from
config.tsand import it here to establish a single source of truth — the dependency direction (presentation → config) is correct.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@plugins/honcho/src/styles.ts` around lines 149 - 163, The issue is that the hosted dashboard URL is duplicated in honchoSessionUrl via DEFAULT_DASHBOARD_URL, which can drift from getDashboardUrl() in config.ts and create inconsistent session links. Move the single source of truth to config.ts by exporting the shared constant there, then import and use it in styles.ts for honchoSessionUrl’s default parameter so both paths resolve the same base URL.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@plugins/honcho/src/styles.ts`:
- Around line 149-163: The issue is that the hosted dashboard URL is duplicated
in honchoSessionUrl via DEFAULT_DASHBOARD_URL, which can drift from
getDashboardUrl() in config.ts and create inconsistent session links. Move the
single source of truth to config.ts by exporting the shared constant there, then
import and use it in styles.ts for honchoSessionUrl’s default parameter so both
paths resolve the same base URL.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 9e0bf4d3-0cac-46a5-9cb4-8e17bc404d17
📒 Files selected for processing (7)
CHANGELOG.mdREADME.mdplugins/honcho/src/config.tsplugins/honcho/src/hooks/session-start.tsplugins/honcho/src/hooks/user-prompt.tsplugins/honcho/src/mcp/server.tsplugins/honcho/src/styles.ts
Problem
The plugin's clickable "view your session in honcho GUI" links are hardcoded to
https://app.honcho.dev:For anyone running a self-hosted Honcho, this link is wrong — their sessions live on their own instance, but the link sends them to the SaaS dashboard (which doesn't have their data). The link target is completely decoupled from the configured
endpoint.baseUrl, so even a fully self-hosted setup still points atapp.honcho.dev.It can't simply be derived from
endpoint.baseUrleither: the GUI is commonly served on a different host than the API (e.g. API athoncho.example.com, dashboard atdashboard.example.com).Change
Add an independently configurable dashboard base URL:
endpoint.dashboardUrlconfig fieldHONCHO_DASHBOARD_URLenv var (takes precedence, matching the existing env-override pattern)set_configMCP fieldendpoint.dashboardUrl(empty string clears the override)Resolution order:
HONCHO_DASHBOARD_URL>endpoint.dashboardUrl>https://app.honcho.dev. Trailing slashes are normalized.honchoSessionUrl()/sessionLine()keep the hosted default, so hosted users see no change. All call sites (session-start,user-prompt,mcp/server) thread the resolved value.setEndpoint()preserves a custom dashboard URL across API-environment switches.Example
{ "endpoint": { "baseUrl": "https://honcho.example.com/v3", "dashboardUrl": "https://dashboard.example.com" } }→
https://dashboard.example.com/explore?workspace=...&view=sessions&session=...Testing
tsc --noEmitpasses.README (config block, env-var table, self-hosting section) and CHANGELOG updated.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Km4oh3yBKgksgH4e5HExMw
Summary by CodeRabbit
New Features
Documentation
Bug Fixes