Skip to content

upstream 取り込み PR #3: host-service 系 / 4 commits#399

Merged
MocA-Love merged 4 commits intomainfrom
upstream/batch-3-host-service
Apr 23, 2026
Merged

upstream 取り込み PR #3: host-service 系 / 4 commits#399
MocA-Love merged 4 commits intomainfrom
upstream/batch-3-host-service

Conversation

@MocA-Love
Copy link
Copy Markdown
Owner

Summary

upstream 取り込みバッチ 3: host-service 系 4 commits。Codex 事前調査 (gpt-5.5 high effort) を経て、当初計画の 9 commits から慎重に 4 commits へ絞り込み。

取り込み内容(4 commits)

当初計画から除外した commits(理由別)

fork 相当実装がある (raw cherry-pick すると fork 独自実装を上書きする懸念)

前提 commit 欠落

PR #6 (version bump) へ移動

Fork 側のコンフリクト解決

  • 全 4 commits は auto-merge で取り込み完了、手動修正なし
  • apps/desktop/src/main/lib/host-service-coordinator.ts, host-service-utils.ts 新規追加は fork の既存 coordinator alias (getHostServiceManager) と整合
  • .superset/lib/setup/steps.sh, apps/desktop/src/renderer/routes/_authenticated/_dashboard/layout.tsx の auto-merge は fork の setup flow / dashboard layout と整合性維持

Fork 固有機能ヘルスチェック

作業前 baseline (/tmp/pr3-baseline/fork-features.txt) と作業後を grep で照合。全 14 項目変化なし (silent regression 検出ゼロ):

  • 19 tRPC プロシージャ全数
  • ansi_up, @vscode/ripgrep, @xyflow/react 依存
  • TERMINAL_OPTIONS (5 ファイル)
  • SUPERSET_WORKSPACE_NAME (24 箇所)
  • moonshot-ai.kimi-code
  • MainWindowEffects / INCEPTION_AUTH_PROVIDER_ID
  • listBranches sortOrder (4) / pinDefault (3) ← PR upstream取り込み: 安全な29コミット (安全・おそらく安全) #388 の silent regression 領域、健在
  • BROWSER_RELOAD, port-scanner Windows 分岐, dmg.size="4g"

Codex 事前調査レポート

/tmp/pr3-codex-preanalysis.md 参照。PR #388 で silent regression が起きた領域 (listBranches) は今回 cherry-pick 対象ではないため直接影響なし。取り込んだ 4 commits はいずれも coordinator / setup / worktree 作成系で、fork の 19 tRPC プロシージャには干渉しない。

Test plan

  • bun install 正常完了
  • bun run typecheck グリーン (27/27 task)
  • bun run lint グリーン (4058 files checked, biome 指摘ゼロ)
  • fork 固有機能 baseline 比較で regression ゼロ
  • desktop dev 起動確認
  • v1 workspace 作成が成功する (--no-track 修正)
  • アプリ update 後に host services がそのまま動く
  • host-service detach (rotation/perms/windowsHide/dev pipes) が正常動作
  • v2 host-service DB が dev setup で clone される

次の PR

Kitenite and others added 4 commits April 24, 2026 06:22
superset-sh#3548)

v1's createWorktree appended ^{commit} to the start point to prevent
implicit upstream tracking. This fails with "fatal: invalid reference"
when the ref isn't locally resolvable with that suffix (e.g. stale or
missing remote-tracking ref, branches with slashes like
feat/workstreams-view).

Replace ^{commit} with --no-track, which has the same effect without
fragile ref suffix manipulation. Matches v2's host-service approach.

Closes superset-sh#3448
Squirrel.Mac's update flow SIGTERMs the old app's process group, which
reached the host-service child and caused two nukes: the child's shutdown
handler deleted its own manifest, and the child itself was in the parent's
process group so it died with the app. On relaunch the new app found no
manifests and spawned fresh host-services, losing all in-memory state.

- Drop removeManifest from the child's SIGTERM handler. The coordinator
  already owns manifest lifecycle on intentional stops and observed exits.
- Spawn with detached: true and file-backed stdio at
  <manifestDir>/host-service.log, so the child lives in its own process
  group and doesn't depend on parent-held pipes. Mirrors the existing
  terminal-daemon pattern.

Tray Stop / Quit & Stop Services are unchanged — coordinator.stop()
signals by pid, independent of process group.
…, dev pipes (superset-sh#3616)

* fix(desktop): keep v2 host-service alive across app updates

The host-service child was spawned without `detached: true`, so it
shared the Electron main's process group. When Squirrel relaunched
the app on auto-update, the old app's process group got killed —
taking the host-service and all its PTYs with it. The whole
manifest-adoption design in HOST_SERVICE_LIFECYCLE.md assumed the
child survives, but the spawn options contradicted that.

Mirror the v1 terminal-host daemon pattern (client.ts:1160-1221):
`detached: true` in prod, stdio pointed at a per-org rotating log
file at `~/.superset/host/{orgId}/host.log` (piped stdio would EPIPE
once the parent exits). Dev mode keeps pipes for live console logs
since enableDevReload restarts instances on bundle rebuild anyway.

* address review: normalize log perms + windowsHide

- chmodSync log file after open: openSync's mode arg only applies on
  create, so a pre-existing file rotated out-of-band keeps old perms.
- windowsHide: true on the spawn so the detached Node child doesn't
  flash a CMD window on Windows.

* refactor(desktop): extract pure host-service helpers to host-service-utils

* address review feedback

- Gate detach on app.isPackaged instead of NODE_ENV. NODE_ENV is ambient
  and could silently flip detach off in a packaged app (e.g. shell env),
  reintroducing the Squirrel kill-chain this PR exists to fix.
- Log a warning on chmodSync failure so permission issues are observable
  instead of being swallowed silently.
- Move clearTimeout into finally in pollHealthCheck so the 2s abort timer
  is also cleared when fetch rejects, not just on success.
…t-sh#3630)

* feat(setup): clone v2 host-service DBs alongside v1 local DB

Seeds ~/.superset/host/<orgId>/host.db into superset-dev-data/host/<orgId>/
so v2 workspaces open with host-service state prefilled, matching the
existing v1 local.db clone behavior.

* feat(setup): seed Electron renderer Local Storage from prod userData

The v2 sidebar reads pinned-workspace state from renderer localStorage
(`v2WorkspaceLocalState`, etc.), which lives in the per-app userData dir.
Each dev worktree gets a fresh `Superset (<workspace>)` userData → empty
sidebar even when the cloud + host.db clones have plenty of accessible
workspaces. Copy `Local Storage/` from the prod app's userData using APFS
clonefile so prod can keep running.

* feat(desktop): auto-pin accessible v2 workspaces in dev sidebar

Drop the renderer-state file-copy approach (Chromium localStorage is
per-origin: dev runs on http://localhost:<port>, prod is file://, so
copying the leveldb seeds the wrong namespace). Instead, add a small
dev-only hook in the dashboard layout that pins every accessible v2
workspace once per worktree's userData. A localStorage flag prevents
re-pinning workspaces the user has explicitly unpinned later.

* chore(deslop): tighten useDevSeedV2Sidebar JSDoc and drop restate-the-code comment

* chore(deslop): drop restate-the-code comment in step_seed_host_dbs

* Lint

* fix(setup): clean up partial host DB copies on failure

If host.db copies but a -wal/-shm sibling fails, leaving the lone host.db
in place would make the next non-force run skip the org as "already seeded."
Wipe the per-org dest before returning the error.

Caught by coderabbitai on PR superset-sh#3630.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

Warning

Rate limit exceeded

@MocA-Love has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 22 minutes and 37 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 22 minutes and 37 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3eda491c-d6b7-41ca-b288-f0e07d218b5e

📥 Commits

Reviewing files that changed from the base of the PR and between 876b482 and 3da4dd0.

📒 Files selected for processing (10)
  • .superset/lib/setup/main.sh
  • .superset/lib/setup/steps.sh
  • apps/desktop/src/lib/trpc/routers/workspaces/utils/git.test.ts
  • apps/desktop/src/lib/trpc/routers/workspaces/utils/git.ts
  • apps/desktop/src/main/host-service/index.ts
  • apps/desktop/src/main/lib/host-service-coordinator.ts
  • apps/desktop/src/main/lib/host-service-utils.ts
  • apps/desktop/src/renderer/routes/_authenticated/_dashboard/layout.tsx
  • apps/desktop/src/renderer/routes/_authenticated/hooks/useDevSeedV2Sidebar/index.ts
  • apps/desktop/src/renderer/routes/_authenticated/hooks/useDevSeedV2Sidebar/useDevSeedV2Sidebar.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch upstream/batch-3-host-service

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 and usage tips.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 23, 2026

🧹 Preview Cleanup Complete

The following preview resources have been cleaned up:

  • ⚠️ Neon database branch
  • ⚠️ Electric Fly.io app

Thank you for your contribution! 🎉

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3da4dd01a3

ℹ️ 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".

@MocA-Love MocA-Love merged commit ac645b2 into main Apr 23, 2026
12 of 13 checks passed
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.

3 participants