Skip to content

feat(config): make dashboard URL configurable for self-hosted deployments#67

Open
djuntgen wants to merge 1 commit into
plastic-labs:mainfrom
djuntgen:feat/configurable-dashboard-url
Open

feat(config): make dashboard URL configurable for self-hosted deployments#67
djuntgen wants to merge 1 commit into
plastic-labs:mainfrom
djuntgen:feat/configurable-dashboard-url

Conversation

@djuntgen

@djuntgen djuntgen commented Jul 9, 2026

Copy link
Copy Markdown

Problem

The plugin's clickable "view your session in honcho GUI" links are hardcoded to https://app.honcho.dev:

// src/styles.ts
export function honchoSessionUrl(workspace, sessionName) {
  return `https://app.honcho.dev/explore?workspace=...&view=sessions&session=...`;
}

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 at app.honcho.dev.

It can't simply be derived from endpoint.baseUrl either: the GUI is commonly served on a different host than the API (e.g. API at honcho.example.com, dashboard at dashboard.example.com).

Change

Add an independently configurable dashboard base URL:

  • endpoint.dashboardUrl config field
  • HONCHO_DASHBOARD_URL env var (takes precedence, matching the existing env-override pattern)
  • set_config MCP field endpoint.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 --noEmit passes.
  • Runtime-verified the URL builder + resolver: default unchanged, self-host honored, trailing slash normalized, env var wins over config field.

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

    • Session “view” links can now point to a configurable dashboard URL, making them work with self-hosted setups.
    • Added support for setting the dashboard link destination through configuration or an environment variable, with a hosted default.
  • Documentation

    • Updated the changelog and README with the new configuration option, environment variable, and self-hosting examples.
  • Bug Fixes

    • Session links now keep their dashboard destination when switching API settings, instead of resetting unexpectedly.

…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
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This PR adds a configurable dashboard base URL for session links, defaulting to https://app.honcho.dev. It introduces endpoint.dashboardUrl config and HONCHO_DASHBOARD_URL env var, new helper functions to resolve the URL, updated honchoSessionUrl/sessionLine signatures, propagation through hooks and MCP server session-link generation, and README/CHANGELOG documentation.

Changes

Configurable Dashboard URL for Session Links

Layer / File(s) Summary
Session URL builder
plugins/honcho/src/styles.ts
Adds DEFAULT_DASHBOARD_URL constant; honchoSessionUrl and sessionLine accept an optional dashboardBaseUrl parameter, replacing the hard-coded host.
Config schema, env var, and resolution helpers
plugins/honcho/src/config.ts
Adds dashboardUrl to HonchoEndpointConfig, reads HONCHO_DASHBOARD_URL in loadConfigFromEnv, adds getDashboardUrlForEndpoint/getDashboardUrl, and updates setEndpoint to preserve existing dashboardUrl when not provided.
Hooks pass dashboard URL into links
plugins/honcho/src/hooks/session-start.ts, plugins/honcho/src/hooks/user-prompt.ts
Session link generation in both hooks now uses getDashboardUrl(config) when building honchoSessionUrl links.
MCP server diagnostics and set_config
plugins/honcho/src/mcp/server.ts
Adds endpoint.dashboardUrl env-shadow mapping, uses getDashboardUrl for session URLs in get/set config responses, adds a set_config case for endpoint.dashboardUrl, and extends the tool schema enum.
Documentation
README.md, CHANGELOG.md
Documents the new endpoint.dashboardUrl config field, HONCHO_DASHBOARD_URL env var, troubleshooting examples, and adds an Unreleased changelog entry.

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
Loading

Possibly related PRs

  • plastic-labs/claude-honcho#48: Both PRs modify session-link behavior in plugins/honcho/src/hooks/user-prompt.ts, one around nag timing and this one around URL construction.

Suggested reviewers: erosika

Poem

A rabbit hops from host to host,
Dashboard links no longer toast! 🐇
With getDashboardUrl in tow,
Self-hosted paths now brightly glow.
HONCHO_DASHBOARD_URL set with care—
Every session link lands right there!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: making the dashboard URL configurable for self-hosted deployments.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

❤️ Share

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
plugins/honcho/src/styles.ts (1)

149-163: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consider eliminating the duplicated DEFAULT_DASHBOARD_URL constant.

The same constant "https://app.honcho.dev" is defined independently here and in config.ts (line 62). If they diverge, getDashboardUrl() (config.ts) and the honchoSessionUrl default (styles.ts) would resolve to different hosted URLs, producing inconsistent session links for any caller that relies on the default.

Export it from config.ts and 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

📥 Commits

Reviewing files that changed from the base of the PR and between 15d07cd and a7f871a.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • README.md
  • plugins/honcho/src/config.ts
  • plugins/honcho/src/hooks/session-start.ts
  • plugins/honcho/src/hooks/user-prompt.ts
  • plugins/honcho/src/mcp/server.ts
  • plugins/honcho/src/styles.ts

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