Skip to content

fix: agent requestStart dedupe and stuck STARTING on daemon restart#580

Merged
conradkoh merged 3 commits into
release/v1.49.2from
fix/agent-request-start-stuck
May 29, 2026
Merged

fix: agent requestStart dedupe and stuck STARTING on daemon restart#580
conradkoh merged 3 commits into
release/v1.49.2from
fix/agent-request-start-stuck

Conversation

@conradkoh
Copy link
Copy Markdown
Owner

Summary

Combined fix for stuck agent STARTING UI and phantom running slots after daemon restart. Supersedes closed PRs #575 and #577 (and incorporates backend dedupe from #559 approach).

  • Backend: dedupeRequestStartEventsgetCommandEvents returns only the latest agent.requestStart per chatroomId:role (by timestamp)
  • CLI live session: ensureRunning verifies running slots with kill(pid, 0); dead PIDs reset to idle and respawn instead of returning early success
  • CLI daemon restart: recover() SIGTERM-kills alive persisted agents (-pid), records daemon.shutdown, clears disk — never adopts as running (no updateSpawnedAgent)

Test plan

  • pnpm typecheck
  • pnpm test
  • Manual: double-click start / start-all — daemon processes one requestStart per role
  • Manual: kill agent process while slot shows running — next requestStart respawns
  • Manual: restart daemon with running agent — no phantom running slot in UI

Closes superseded: #575, #577

Made with Cursor

Combine backend dedupe of agent.requestStart per chatroom+role with CLI
ensureRunning PID liveness checks and recover() kill-all on daemon restart.
Supersedes closed #575 and #577.

Co-authored-by: Cursor <cursoragent@cursor.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chatroom Ready Ready Preview, Comment May 29, 2026 8:21am

Co-authored-by: Cursor <cursoragent@cursor.com>
Centralize process liveness probing in infrastructure/deps/process.ts
and reuse in AgentProcessManager ensureRunning, recover, and stop paths.

Co-authored-by: Cursor <cursoragent@cursor.com>
@conradkoh conradkoh changed the base branch from master to release/v1.49.2 May 29, 2026 08:24
@conradkoh conradkoh merged commit 6a9b3aa into release/v1.49.2 May 29, 2026
2 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.

1 participant