fix(kap-server): keep foreground tasks out of REST polling - #1648
fix(kap-server): keep foreground tasks out of REST polling#1648wbxl2000 wants to merge 2 commits into
Conversation
🦋 Changeset detectedLatest commit: 3b39182 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 |
commit: |
|
Codex Review: Didn't find any major issues. What shall we delve into next? 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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. 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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. 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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! 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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! 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". |
|
@codex review |
|
Codex Review: Didn't find any major issues. 🎉 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". |
|
@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". |
agent-core-v2 registers foreground Agent runs in the task service too (detached: false, so the LLM can drive them via TaskList/TaskOutput/ TaskStop). The REST projection dropped that distinction and the web client defaults subagent tasks to background, so foreground subagents showed up in the dock as entries that never settle and cannot be stopped. Add the optional run_in_background field to the protocol Task schema and project info.detached onto it; older servers keep omitting the field and the client default stays correct for them.
c756d1e to
3b39182
Compare
Related Issue
Depends on #1623 and supersedes #1644. Independent from #1645.
Problem
On the v2 backend, foreground Agent runs are present in the internal task service with
detached: false. The/api/v1task list exposed them as incomplete REST task records, while foreground subagent identity and grouping belong to the snapshot and WebSocket roster. A Web task refresh could therefore replace the richer foreground entry with a record that lacked its parent tool call, subagent type, and swarm index.Filtering those records is only safe once snapshot roster recovery exists, so this PR is stacked directly on
fix/kap-server-subagent-roster. #1623 must merge first. #1623 owns refresh recovery, detached task identity, terminal state, monotonic roster lifecycle, and authoritative empty snapshots; this PR only fixes REST polling.What changed
GET /api/v1/sessions/{sid}/tasksbackground-only by filteringdetached: falserecords, matching the v1 endpoint.Task.run_in_backgroundprojection for precise GET-by-id compatibility; a directly requested foreground task reportsfalse.The branch includes the refreshed #1623 head (
d2d8e2f77) through ordinary merge commits. The PR remains exactly the 6 foreground-polling files relative to #1623. No Agent/swarm stop behavior from #1645 is included here.Verification
check:style: baseline mode, 29 existing findings, no failure.git diff --check origin/fix/kap-server-subagent-roster...HEAD: passed.Checklist
gen-changesetsskill; the existing foreground-task patch changeset covers this compatibility projection.gen-docsskill; no user guide or changelog update is needed for this internal REST projection.