Skip to content

feat: extract headless daemon host bootstrap#196

Open
parsakhaz wants to merge 1 commit into
phase2-daemon-validation-hardeningfrom
phase3-headless-daemon-host-bootstrap
Open

feat: extract headless daemon host bootstrap#196
parsakhaz wants to merge 1 commit into
phase2-daemon-validation-hardeningfrom
phase3-headless-daemon-host-bootstrap

Conversation

@parsakhaz
Copy link
Copy Markdown
Member

Summary

  • extract the daemon-owned service/runtime bootstrap into a reusable createPaneDaemonHost() host object
  • add a dedicated headless daemon entrypoint and runnable scripts for booting Pane without a BrowserWindow
  • remove remaining index.ts bootstrap assumptions from task queue, resource monitor, app-directory parsing, and panel webview context wiring

What changed

  • added main/src/daemon/bootstrap.ts to own service initialization, local daemon startup, runtime sink installation, and shared shutdown
  • added main/src/daemon/headless.ts as the first headless Electron entrypoint for self-hosted daemon mode
  • updated main/src/index.ts so desktop mode uses the extracted host instead of duplicating service startup
  • made TaskQueue choose its local in-process queue without depending on process.versions.electron
  • made ResourceMonitorService accept injected session/app dependencies instead of requiring ../index
  • made app-directory resolution safe to use outside the desktop entrypoint and added CLI parsing helpers/tests
  • routed panel webview registration through the runtime webview-context accessor instead of importing ../index

Validation

  • pnpm typecheck
  • pnpm lint (passes with existing repo warnings)
  • CI=1 pnpm --filter main test -- --run
  • pnpm run build:main
  • PANE_DIR=/tmp/pane-phase3-remote-smoke-final xvfb-run -a pnpm test:ci
  • manual headless smoke: booted main/dist/main/src/daemon/headless.js without creating a BrowserWindow, confirmed the local daemon socket was announced, and confirmed clean external SIGTERM exit

Review note

  • terminal Ctrl+C against the Electron wrapper is still noisy in local shell smoke, but an external SIGTERM to the Electron process exits cleanly after shutdown. I treated external signal stop as the meaningful daemon validation path for this slice.

@parsakhaz
Copy link
Copy Markdown
Member Author

@codex review

@parsakhaz
Copy link
Copy Markdown
Member Author

@claude review

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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