Skip to content

T-C8B9-dashboard-term-server-packaged

State: planning/draft · Impact: medium · Complexity: small

When sdlc runs from the packaged CLI (the plain-Node cli/sdlc.js bundle, or the compiled binary), the dashboard’s Sessions page silently falls back to read-only mode, because the terminal server it spawns can’t be found. Users who install the plugin never get live terminals, and nothing tells them why.

startTermServer resolves term-server.mjs via moduleDir(import.meta.url). From source, that is the dashboard service directory. Inside the bundle, import.meta.url collapses to <plugin>/cli/sdlc.js, so it looks in <plugin>/cli/. term-server.mjs isn’t listed in agent-pants.yaml’s assets anyway, so it isn’t in any of the three packs, and the compiled binary’s asset globs exclude *.js/*.mjs. The Sessions page detects the missing server and degrades to read-only without any message.

The automated review of #2434 (the bundled-Node dashboard fix) flagged it as a pre-existing issue outside that PR’s scope.

Under all three runtimes (bun from source, node cli/sdlc.js, and the compiled binary), the Sessions page gets a working terminal server. Where a runtime genuinely can’t host one, the page says so explicitly.

  1. Resolve the terminal server through the embedded-root-aware pluginLibDir() / pluginRootDir() helpers, not moduleDir(import.meta.url), the same way index_template.eta resolves.
  2. Ship term-server.mjs, and anything it imports, as a plugin asset in agent-pants.yaml, and include it in the compiled binary’s asset set. Decide whether it stays a separate .mjs process or re-enters through a CLI route (sdlc dashboard term-server), as the dashboard’s detached child does since #2434. The CLI route avoids the asset entirely and reuses sdlcSelfInvocation().
  3. Replace the silent fallback with a visible notice when the terminal server isn’t available.
  4. Extend bundle-node.test.ts (and the release.yml binary smoke) to check that the terminal server starts under the packaged CLI.
AreaNote
solutions/ontological/lib/services/dashboard/startTermServer and the terminal-server module
solutions/ontological/lib/util/plugin-root.tsthe asset-root and self-invocation helpers
solutions/ontological/agent-pants.yamlpack asset list
solutions/ontological/scripts/build-binary.tscompiled-binary asset globs
packages/ts/dashboard-spa/the Sessions page fallback notice
  • AC-1: under node cli/sdlc.js dashboard start, the Sessions page opens a live terminal. A bundle-level test asserts that the terminal server starts.
  • AC-2: the same holds under the compiled binary. The release.yml binary smoke covers it.
  • AC-3: when the terminal server can’t start, the Sessions page shows an explicit notice instead of silently going read-only.
  • Embedding PTYs in hosts other than the dashboard; hosts keep linking out (P12 decision).
  • #2434, which introduces sdlcSelfInvocation() and the bundle-level dashboard test this builds on.

The automated review on #2434, 2026-09-29, raised it as an FYI.


← Back to Tasks