fix: stop individual swarm members from the web UI - #1645
Conversation
|
@codex review |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7e47efe0d5
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
🦋 Changeset detectedLatest commit: 1b7551d The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8daa22185d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8678de1fe2
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback". |
Related Issue
Related to #1623. Independent from the stacked foreground-polling PR #1648.
Problem
The web swarm card could display a running or suspended member but had no member-level stop action. The
/api/v1cancel route only understood task-service IDs, while AgentSwarm members are owned by the session swarm domain. Two additional lookup bugs made this worse: one caller could retain only its newest batch, and an old terminal Agent task could hide a resumed active swarm member with the same Agent ID. The route also assumed every swarm was launched bymain, so members launched by another agent could not be stopped.A later cancellation gap remained around the requester-side
SubagentStarthook: stop could succeed while the only emitted event stayedsubagent.started, leaving other clients and replay stuck on a running row.What changed
The stop path is explicit and stays within existing domains:
POST /api/v1/sessions/{sid}/tasks/{id}:canceland applies the cancelled terminal state.mirrorAgentRunnow sends exactly one cancelled failure whether stop lands before, during, or after the requester start hook. The early completion rejection is observed while a hook is pending, so cancellation does not become an unhandled rejection. This follow-up does not change stop lookup.Explicit cancellation is carried as an optional
subagent.failed.cancelledmarker so refresh/replay and the live Web state agree. Repeated stop stays idempotent. This PR does not include the session-close/background cleanup work from #1635.Verification
lint:domain.test/tasks.test.ts, 16 tests passed, including a real non-main-caller/api/v1cancel during a deferred start hook; typecheck.check:style: baseline mode, 29 existing warnings, no failure.git diff --check origin/main.Checklist
gen-changesets; the existingweb-stop-swarm-membersCLI patch changeset covers this follow-up.gen-docsimpact check; no user guide change is needed. The skill's changelog sync prerequisite is absent in this checkout (docs/scripts/sync-changelog.mjs).