You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(tasks): list a GJC pane's background jobs - #5119
Since #3880 a GJC pane's background count includes its background bash jobs and detached subagents, but the Composer menu is gated to OmO (omo={kind === "omo"}) and /api/pane/omo-tasks answers nothing for a GJC pane, so the count cannot be opened to see what is running.
Change
OmoStatus.detachedOf(paneId): the open detached jobs the background count is read from (same startedAt cut), as running OmoTasks (bg_N -> bash, else subagent).
/api/pane/omo-tasks answers a GJC pane from it (gjc passed through dispatch / server-core).
Composer enables the tasks menu for gjc.
Verification
bun test server/tasks-routes.test.ts server/gjc-status.test.ts: 53 pass, including new cases for the route and detachedOf (including the previous-process cut).
devswha#3880 counts a GJC session's background jobs and detached subagents
in the badge, but the tasks menu stayed off for GJC panes and the
route answered none, so the count could not be opened. Serve the
open jobs the count is read from and enable the menu for GJC.
Auto incremental reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Summary
Summary by CodeRabbit
New Features
GJC sessions now show detached background jobs in the task view, including their running status and task category. These jobs appear alongside the session’s other background tasks.
The change exposes GJC detached jobs as running tasks through the tasks route and enables the Composer background-task setting for GJC.
OmoStatus.detachedOf filters detached cells by startedAt and maps them to running tasks. IDs matching bg_<digits> are categorized as bash; other IDs are categorized as subagent. Tests cover excluded older jobs and a current open job.
handleTasksRequest returns detached tasks and an empty runs list when the GJC tracker reports a matching session. Dispatch passes gjc to the route. createCore also exposes fapEvents. The route test checks the GJC response.
devswha/ovis#3880: Adds the GJC background-job tracker that this change uses to expose jobs through the tasks route and Composer.
Suggested reviewers:devswha, joaomoreno
Merge Risk: Minimal · previous review 3bf8a
GJC panes now list their open background jobs in the tasks menu. No concrete merge-blocking risk was found; the only open points are cosmetic or speculative.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title "feat(tasks): list a GJC pane's background jobs" matches the main change: the PR adds OmoStatus.detachedOf, routes GJC panes through /api/pane/omo-tasks, and enables the Composer tasks menu …
Description check
The description follows the template's Change and Validation sections. The Change section explains the problem (background count not openable for GJC panes) and the resulting behavior. The Validation …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title "feat(tasks): list a GJC pane's background jobs" matches the main change: the PR adds OmoStatus.detachedOf, routes GJC panes through /api/pane/omo-tasks, and enables the Composer tasks menu for GJC. It is concise, specific, and follows a conventional commit style.
Full details: Description check
Explanation
The description follows the template's Change and Validation sections. The Change section explains the problem (background count not openable for GJC panes) and the resulting behavior. The Validation section lists the test command with results and a typecheck result. Gaps: it does not link an issue for the feature as the template asks, it does not mention the changelog.d entry the template references, and it does not state whether the contract tests for the HTTP route change were run or skipped, though the route is an HTTP change.
Resolution
Optional improvements: link the issue where a maintainer agreed to the feature, add a changelog.d/ entry if required by CONTRIBUTING.md, and state whether contract-test coverage was run for the changed /api/pane/omo-tasks route (or skipped, and why).
Finishing Touches
Generate unit tests (beta)
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
Reviewing files that changed from the base of the PR and between 857ecf5 and 3bf8ab6.
Files selected for processing: 7
server/core/server-core.ts
server/dispatch.ts
server/gjc-status.test.ts
server/omo-status.ts
server/tasks-routes.test.ts
server/tasks-routes.ts
src/components/Composer.tsx
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
… a pane runs now answer
- OmoStatus keeps the open detached jobs it counted beside the count, and restores both for a pane found again, so the list never reads empty while the count it restored says a job runs.
- /api/pane/omo-tasks answers from GJC only while the pane holds no OmO session and no live Claude Code or OpenCode one: GJC can hold a pane until its next discovery.
- The Composer keeps main's gate: a GJC pane's chip already opens once its count is above 0, and an idle one gains no empty menu.
Thanks @sskys18, this is a nice fit: the count was already there, and now it opens to what is running. I pushed one maintainer commit on top (a5ba6fa) for what review turned up:
List and count stay in step.OmoStatus now keeps the open detached jobs it counted beside the count, and restores both for a pane found again. Before, a pane rediscovered while its transcript could not be read yet restored a count of 1 with an empty list.
The agent a pane runs now answers./api/pane/omo-tasks answers from GJC only while the pane holds no OmO session and no live Claude Code or OpenCode one. GJC can keep a pane until its next discovery, so the early return could show the previous GJC session's jobs over OmO's. Covered by a new route test.
No Composer change. A GJC pane's chip already opens once its count is above 0 (on main too). omo={... || kind === "gjc"} only added an always-visible, empty "Background tasks" chip to every idle GJC pane, so I dropped it.
Checked with a real GJC 0.18.12 in an isolated HOME (test herdr session, Ovis GJC extension installed, async.enabled: true): a background subagent (0-SleepRunner, listed as subagent) and an async bash job (bg_1, listed as bash) each appeared in the list within a second of starting and left it when their async-result landed. bun test server/tasks-routes.test.ts server/gjc-status.test.ts server/omo-status.test.ts: 123 pass; the new tests fail on main.
Merged through pr-merge at head 2725b4485. Seen before the merge was asked for: required checks green, no unresolved thread, no conflict, no hold, main not red, no release in progress. CodeRabbit said it did not review (a limit or a skip) since this head.
main had moved since the checks of a5ba6fa22: pr-merge --update merged it in (1e50e372b), and every required check was green at this head.
It waited in the merge queue behind #5128, whose change overlaps it, before it was updated.
main moved but untouched: merged without update. Its new commits up to 76e968aa9 change no file of this pull request, none imported by one, nothing that decides which checks run, and no core path.
Owner's word in the lane brief (bg-tasks-all): take #5119. Reviews at a5ba6fa: omo gate CLEAR (dori review receipt); Codex gpt-6.2-sol-fast xhigh BLOCK on 2 reproduced MEDIUMs, both fixed in maintainer commit a5ba6fa with tests. Supply chain: no dependency, lockfile, script or workflow change. Real GJC 0.18.12 in an isolated HOME: a background subagent and an async bash job each appeared in /api/pane/omo-tasks and left when they ended. CodeRabbit did not review this head.
Merged, thank you @sskys18! A GJC pane's background count now opens to the jobs and subagents behind it. Following on from this, the same list is coming for Grok, Kimi and Muse panes in a separate PR.
## Problem
The background-tasks chip opens to a list for OmO, Claude Code,
OpenCode, pi, agy and (since #5119) GJC. Grok counts its background jobs
but its menu opens to nothing, and Kimi and Muse write their background
jobs and subagents to their own session files yet show neither a count
nor a list.
## Change
From the records each agent writes, read once per poll so the list's
running rows are always the count:
- **Grok** (`updates.jsonl`): the jobs of its newest `background_tasks`
update, with their command and status. A job that only disappears from a
snapshot is not marked completed. Its count and turn hold are unchanged;
subagents are not in that snapshot and finish with `will_wake: false`,
so they stay out of both.
- **Kimi** (`wire.jsonl`): `task.started` / `task.terminated` paired by
`taskId`, for detached shell jobs and subagents; `timed_out`, `killed`
and `lost` end a job as failed, cancelled or lost.
- **Muse** (`session.jsonl`): background `tool.bash` task streams and
`subagent.control` spawn / status / result records.
Kimi and Muse gain a count and a list only: no turn hold, status, finish
or alert change. Only jobs started by the process holding the pane
count; a session rebound to a newer process does not inherit the old
one's jobs. A tracker for an agent the pane no longer runs does not
answer.
Not in this change: OMP. Its `wait` tool consumes job results so no
`async-result` follows, kills are recorded under `details.proc`, and
pairing a transcript with the pane's process is not reliable enough yet.
Other agents: see the survey in the lane report.
No new buttons or settings: the existing chip opens for more agents.
## Verification
- Fixtures are real sessions recorded with Grok 1.0.92, Kimi 2.8.1 and
Muse 1.4.25 in isolated HOMEs (team proxy, cheap model): one background
shell job and one subagent each, both completed
(`server/fixtures/{grok,kimi,muse}/`).
- The fixture tests fail on main (the list reads `[]`) and pass here.
- New tests, all failing on main and passing here: `grok|kimi|muse lists
its recorded background jobs through delivery, counting only running
rows`, `kimi|muse does not inherit in-flight jobs on a five-second
restart of the same file`, `keeps Kimi timed_out, killed and lost jobs
as ended rows`, `yields a large Kimi replay between polls and reuses its
cursor for a new owner`, `a Kimi count frame preserves the machine epoch
and another pane's finish ID`; route tests for a pane that changed
agents (Grok -> OpenCode, a stale GJC binding while Kimi runs).
- `bun test` on the touched server tests plus agent-tasks, gjc-status,
omo-status, agy, grok, kimi, muse, tasks-routes: 308 pass. `bun run
typecheck` passes. Conventions pass (two repository-scanning cases need
more than 5 s on this loaded PC and pass alone).
- One review round before opening: a Codex adversarial review found 2
HIGH and 4 MEDIUM; every one is fixed here with a test that reproduces
it, and OMP was dropped for the reasons above.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Since #3880 a GJC pane's background count includes its background bash jobs and detached subagents, but the Composer menu is gated to OmO (
omo={kind === "omo"}) and/api/pane/omo-tasksanswers nothing for a GJC pane, so the count cannot be opened to see what is running.Change
OmoStatus.detachedOf(paneId): the open detached jobs the background count is read from (samestartedAtcut), as runningOmoTasks (bg_N->bash, elsesubagent)./api/pane/omo-tasksanswers a GJC pane from it (gjcpassed throughdispatch/server-core).gjc.Verification
bun test server/tasks-routes.test.ts server/gjc-status.test.ts: 53 pass, including new cases for the route anddetachedOf(including the previous-process cut).bun run typecheckpasses.