Skip to content

feat(framework): bare framework foregrounds the dashboard; --daemon backgrounds it#459

Merged
suleimansh merged 1 commit into
mainfrom
feat/daemon-foreground-456
Jul 13, 2026
Merged

feat(framework): bare framework foregrounds the dashboard; --daemon backgrounds it#459
suleimansh merged 1 commit into
mainfrom
feat/daemon-foreground-456

Conversation

@suleimansh

Copy link
Copy Markdown
Member

Closes #456.

Rom's ask: bare framework should just spin up the (Telefunc) server in the foreground so Ctrl+C terminates it and the server's logs/errors are visible; framework --daemon should do what happens today (background it).

What

  • Bare framework now runs the dashboard in the foreground (runForegroundDaemonCmd): prints ◆ dashboard running: <url> + Ctrl+C to stop. Server logs stream below., serves in-process, and stops cleanly on SIGINT/SIGTERM. If a background daemon already owns the port, it reports the URL and defers instead of fighting for the bind.
  • framework --daemon now does what bare framework used to: ensureDaemon spawns the detached background server and prints the convenience commands, then returns.
  • The detached child's server entry moved from --daemon to an internal --daemon-serve flag (undocumented; the background path spawns it), so --daemon no longer re-serves.
  • runDaemon gained an onListening(state) hook for the foreground banner (fires after the port binds + state is written, before it blocks).

Verify (real daemon, driven end-to-end)

  • framework --daemon -> background child serving HTTP 200, convenience printed, exit 0.
  • bare framework while one runs -> already running in the background: <url>, exit 0 (defers, no port fight).
  • framework stop -> stops it, port closes.
  • bare framework with none running -> foreground banner, serves HTTP 200, SIGINT stops it cleanly and frees the port.
  • framework tests 470 (469 pass / 0 fail / 1 skip); build + typecheck clean. New: parseArgs --daemon-serve; bare-framework foreground-defer routing; --daemon background routing.

…d; `--daemon` backgrounds it

Closes #456.

Bare `framework` now serves the dashboard in the foreground so its logs and
server-thrown errors are visible and Ctrl+C stops it. `framework --daemon`
does what bare `framework` used to: run detached in the background and return
after printing the convenience commands. The detached child's server entry moved
to an internal `--daemon-serve` flag (the background path spawns it), and bare
`framework` defers to an already-running background daemon instead of fighting
for the port. runDaemon gained an onListening hook for the foreground banner.
@suleimansh suleimansh self-assigned this Jul 13, 2026
@suleimansh suleimansh merged commit 7ca71be into main Jul 13, 2026
2 checks passed
@suleimansh suleimansh deleted the feat/daemon-foreground-456 branch July 13, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--daemon

1 participant