Skip to content

fix(ci): remove build:daemon from release workflow#109

Merged
ACCSCI merged 10 commits into
masterfrom
fix/release-workflow-daemon
Jul 2, 2026
Merged

fix(ci): remove build:daemon from release workflow#109
ACCSCI merged 10 commits into
masterfrom
fix/release-workflow-daemon

Conversation

@ACCSCI

@ACCSCI ACCSCI commented Jul 1, 2026

Copy link
Copy Markdown
Owner

问题

release.yml 还在调 bun run build:daemon——这个 script 在 PR #108 里已经从 package.json 删掉了(v2 daemon 架构已经下线,没有东西要 build)。

具体位置:

  • 第 43 行:独立的 Build daemon JS step
  • 第 46 行:嵌入到最终 publish step 里

后果:即使 v0.2.0 tag 触发 release workflow,也会因为 script not found 失败。

改动

删掉这两处 bun run build:daemon 引用。npx electron-vite build 已经能独立完成 main + renderer + preload 的构建,不需要 daemon build。

关联

后续

这个 PR 合并到 master 后:

  1. 删除 GitHub 上指向 PR chore: 打包提交 session 创建修复、DaemonStatusBar 清理与主进程重构 #108 commit 的 v0.2.0 tag
  2. 在 master HEAD 重新打 v0.2.0 tag 并 push
  3. release workflow 重新触发,build 出 AgentDock-Setup-0.2.0.exe 并创建 GitHub Release

Marco Taylor added 8 commits June 30, 2026 21:49
…ain-process refactor

- fix(lifecycle): return backgroundHookPromise=undefined in sync-hook mode
  so the complete event is sent via process.nextTick; previously sync
  hooks never triggered onBackgroundHookComplete, leaving
  createSession.isPending stuck true and the '+' button spinning after
  the session card had already gone active.
- refactor(ui): remove DaemonStatusBar component + styles + testids;
  single-instance architecture has no separate daemon process, so the
  bar was a static 'Running' label with no information value.
- test: drop 4 v2-daemon specs that asserted on the now-removed bar and
  on architecture that no longer exists (status-and-fencing, v2-architecture,
  v2-flow, reconnection).
- test(e2e): add scripts/e2e-bun-start-stepwise.ts that simulates
  bun start → open Copilot-Switch → create session → delete session
  with real UI clicks; includes a regression guard for the
  plus-button-spins bug and uses the inner .session-card class for
  state checks (the testid lives on the wrapper).
- chore: bundle miscellaneous in-progress main-process refactor, new
  e2e specs (agent-e2e-raw, cold-start-race, session-create-progress-
  persistence, etc.), acceptance scripts, screenshots, and minor
  formatting touches across many files.
- port-pool: serialize allocate() through a promise chain and reserve
  picked ports inside the serialized block to prevent two concurrent
  create-session calls from racing past the bind-probe and grabbing the
  same ports.
- ipc/sessions: add null guard for sessionManager in sessions:delete
  (matches the existing guards in sessions:create and sessions:reassignPorts).
- global-settings: route setPortPoolStart/setPortPoolEnd through
  updateSettings with strict 1024..65534/1025..65535 clamps and
  start<end invariant, fixing the 65535→65635 and 1024→1024 edge cases.
- instance-lock: mkdirSync the .agentdock parent directory before
  acquiring the lock, so a fresh userData dir no longer crashes startup
  with ENOENT.
- settings: split handlePortPoolChange (local state) from saveSettings
  (IPC + disk write); the IPC call now fires on input blur instead of
  on every keystroke.
- ipc/db: wrap JSON.parse(s.steps) in try/catch so a corrupted row
  doesn't brick the entire db:projects:list handler.
- package.json: restore the build:daemon script that CI's
  'bun run build:daemon' step still depends on.
Single-instance architecture no longer has a separate daemon process to
build. The 'Build daemon JS' step in .github/workflows/build.yml ran
build:daemon twice (once standalone, once inside dist:win). Both the
script reference and the CI step are removed.
- src/routes/app.$projectId.tsx:22 — change `project?.sessions.find` to
  `project?.sessions?.find`. The original parses as `(project?.sessions).find`,
  which crashes with 'Cannot read properties of undefined (reading find)'
  when useOpenProject inserts a freshly-created project into the React Query
  cache without a `sessions` field.
- src/hooks/useOpenProject.ts:insertOrReplaceProject — normalize the inserted
  project so `sessions` defaults to [] when missing. The row returned by
  `db:projects:create` only has {id, name, path, createdAt}; consumers like
  ProjectWorkspace assume the full ProjectData shape.

Verified with e2e/bun-start-simulation.spec.ts — 'Project loaded (no
Project not found)' step now passes (previously triggered the ErrorBoundary
at app.$projectId.tsx:22).

Also includes:

- AGENTS.md rewritten in Chinese to match the single-instance architecture,
  testing isolation pipeline (CI does NOT run e2e; parallel tests must use
  --user-data-dir + AGENTDOCK_DEV_INSTANCE=1), and the user-agent testing
  approach via .flue/. Old link to docs/新架构.md removed (v2 daemon
  architecture no longer in use).
- Remove obsolete v2-daemon docs: 新架构.md, v1-deprecation.md,
  new-arch-progress.md, main-alignment-audit.md, post-fix-iterations.md,
  sse-race-debug.md.
- .flue/ skeleton (agents/user-agent.ts, app.ts, tools/launch-electron.ts)
  + flue.config.ts — initial scaffolding for user-agent testing. The agent
  successfully runs end-to-end (Claude Sonnet 4.6 via the project's
  Anthropic-compatible gateway) and produced a UX bug report on first run.
  The launcher itself hits a Playwright / Node v24 inspector handshake bug
  tracked separately; user-agent findings were validated against
  e2e/bun-start-simulation.spec.ts instead.
- .gitignore: e2e-report-html/ → e2e/report-html/ (typo: underscore vs slash).
0.2.0 marks the completion of the v2-daemon deprecation arc:
- DaemonStatusBar component removed (UI no longer pretends to track a
  non-existent daemon process)
- Single-instance architecture fully documented in AGENTS.md
- Project DB + global DB isolation (--user-data-dir + AGENTDOCK_DEV_INSTANCE)
  replaces what used to be a shared ~/.agentdock/projects.db
- 6 obsolete v2-daemon design docs removed (新架构.md, v1-deprecation.md,
  new-arch-progress.md, main-alignment-audit.md, post-fix-iterations.md,
  sse-race-debug.md)
- project?.sessions.find optional-chain bug fixed; useOpenProject now
  normalizes inserted projects before writing to the React Query cache

See PR #108 for the full diff.
The @flue/cli and @flue/runtime packages were added to package.json but
bun.lock was not regenerated. CI's 'bun install --frozen-lockfile' step
failed with 'lockfile had changes' — running 'bun install' locally now
to capture the resolved package versions.
The 'Build daemon JS' step ran `bun run build:daemon`, which we removed
in PR #108 because the v2-daemon architecture is gone and there's nothing
to build. The release workflow also had `bun run build:daemon` chained
into the final publish step — same removal.

After this lands, retag v0.2.0 against master HEAD so the release
workflow fires correctly.
Copilot AI review requested due to automatic review settings July 1, 2026 16:34

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request refactors AgentDock to a single-instance architecture, eliminating the daemon process and unifying the database structure. Key feedback highlights several critical and high-severity issues, including a Promise rejection lockup in the port pool allocation queue, a ReferenceError from an undefined projectPath in the sessions IPC handler, potential TypeError crashes due to missing null checks on the database handle, and unhandled JSON.parse exceptions. Additionally, the reviewer recommends replacing hardcoded absolute paths in the launcher and E2E simulation scripts with dynamic paths to ensure portability.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread electron/main/port-pool.ts
Comment thread electron/main/ipc/sessions.ts
Comment thread electron/main/ipc/db.ts
Comment thread electron/main/ipc/db.ts
Comment thread electron/main/ipc/sessions.ts Outdated
Comment thread .flue/tools/launch-electron.ts
Comment thread e2e/bun-start-simulation.spec.ts
Marco Taylor added 2 commits July 2, 2026 00:51
…arse

Address review comments from gemini-code-assist on PR #108 (now merged
into master). Four real bugs fixed:

1. port-pool: serialize allocation via a chain, but a thrown error
   (e.g. PortPoolExhaustedError) used to poison the queue forever —
   every subsequent allocate() would reject. Now the queue absorbs the
   rejection while the original error still propagates to the caller.
2. db:projects:list: per-project DB can be null if db:init hasn't run;
   return empty session list instead of crashing the renderer.
3. db:projects:delete: same — guard against null per-project DB.
4. ipc/sessions:steps callback: wrap JSON.parse(row.steps) in try/catch
   to match the defensive parsing in db.ts:322. A corrupted steps blob
   no longer kills the step-update loop.

The 'projectPath is not defined' thread was a false positive — the
variable is declared at the top of sessions:create (line 74). The two
'hardcoded local paths' threads (test scripts) are pre-existing
technical debt out of scope for this PR.
Conflict resolution: kept the HEAD-side fixes (port-pool queue
absorption + sessions.ts defensive JSON.parse) and let the post-#108
master changes (e4ffc60) land alongside.
@ACCSCI ACCSCI merged commit cafe643 into master Jul 2, 2026
1 check passed
@ACCSCI ACCSCI deleted the fix/release-workflow-daemon branch July 2, 2026 01:50
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.

2 participants