#631

fix(mux-activity): show Claude background agents under Luvus when agent list fails

Openwiiiimmwants to merge intofrom

Fixes OPS-280

Summary

Under Luvus, background agents (jobs/*/state.json) were read only inside the success branch of luvus agent list. When the snapshot answered and agent list failed, AGENTS showed the failure and no background-agent rows, so a blocked background agent went missing.

  • The poll reads the jobs on every round. A new with_jobs files them into the listed agents as before. When the list failed, it files them into a list of their own (State::unlisted_jobs) and keeps the error.
  • The board draws agents_drawn(...): the listed agents, or, after a failure, the background agents. Those rows go through the same row drawer, the rows_now cursor list, the e panel and the Enter no-pane note.
  • AGENTS now gives the agent list error in place of the pane agents even when a background agent is filed in a workspace (agents_note). Before, the error appeared only when the section was empty.
  • The e panel finds its job among the drawn rows (job_in) instead of only in a successful agents, so it opens in the failed state too.
  • With no list, nothing proves that a pane row already draws a job. A job running in a pane therefore gets its own row in that pane's workspace instead of none. The README says this.
  • The snapshot-absent path clears unlisted_jobs together with every other reading.

Rex and Herdr are unchanged.

Evidence

  • New test luvus::tests::a_failed_agent_list_still_draws_the_background_agents. It writes a working job to a temporary jobs/<id>/state.json, reads it with read_jobs, and files it against a failed agent list. The test checks that the error is kept, the row is drawn under BACKGROUND AGENTS, AGENTS gives the error (also when a job is seated there), e finds the job among the drawn rows, and the row is a job row with no pane, which is what Enter keys off. It also covers the Ok path.
  • cargo test from the root passes, including widgets/tests/check.rs.
  • Not checked live: agent list cannot easily be made to fail in a running Luvus session, and this run was not inside one.

Merge Danger

Low. The change touches only the Luvus board's poll and AGENTS drawing. On the success path, filing, sorting and grouping are the same code moved into with_jobs. The only visible change on that path is where the "no agents under this session" line sits, which is at the top of the empty AGENTS section, the same place as before.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Activity

6
linear-code[bot]11d ago
coderabbitai[bot]11d ago

No actionable comments were generated in the recent review.

Summary by CodeRabbit

  • Bug Fixes
    • Background jobs remain visible when the agent list cannot be retrieved, and the list failure is shown alongside them.
    • Jobs running in a pane are displayed separately in that pane’s workspace when they cannot be matched to a listed agent.
    • The e and Enter actions work on these separately displayed jobs, as they do on other background-agent rows.

Walkthrough

Luvus now reads background jobs when luvus agent list fails. It retains the list error and renders jobs as separate rows. The board displays the error alongside those rows, and detail lookup can find jobs in them.

Changes

Luvus background-job handling

Layer / File(s)Summary
Store and group background jobs
widgets/src/widgets/mux-activity/luvus.rs
State now stores unlisted jobs when the agent list fails. Job processing reads background jobs on each poll and groups them with listed agents or as separate rows.
Draw and find fallback rows
widgets/src/widgets/mux-activity/luvus.rs, widgets/src/widgets/mux-activity/README.md
The render loop draws fallback rows and shows the list failure note. Detail lookup searches the drawn rows. The documentation describes row placement and keyboard actions. Tests cover failed-list and successful-empty-list cases.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Possibly related issues

  • stealth-factory/opscope#627: Describes background agents being hidden when luvus agent list fails. This PR adds fallback rows for that case.

Possibly related PRs

Suggested reviewers: greptile-apps

Merge Risk: Minimal · up to ad29c

When the Luvus agent list fails, background agents now still appear, with the failure noted on the AGENTS board. The change is local to the activity widget and is covered by a regression test, so no merge-blocking risk is evident.

Security architecture risk: Minimal · up to ad29c

Background work remains visible when listing fails, while the failure stays visible. The inspected changes do not grant new actions or weaken access controls.

Pre-merge checks: 4

Check nameStatusExplanation
Title checkThe title names the main change: Claude background agents under Luvus are now shown when agent list fails. The changeset matches this. The README, luvus.rs, and the PR objectives all describe backgrou…
Description checkThe description states the bug (background agents in jobs/*/state.json were read only in the agent list success branch), the fix (with_jobs, unlisted_jobs, agents_drawn, agents_note, job_in), a new re…
Linked Issues checkCheck skipped because no linked issues were found for this pull request.
Out of Scope Changes checkCheck skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: Claude background agents under Luvus are now shown when agent list fails. The changeset matches this. The README, luvus.rs, and the PR objectives all describe background jobs being drawn when the list fails. The conventional-commit prefix is specific and accurate.

Full details: Description check

Explanation

The description states the bug (background agents in jobs/*/state.json were read only in the agent list success branch), the fix (with_jobs, unlisted_jobs, agents_drawn, agents_note, job_in), a new regression test, and merge risk. It matches the changeset and the raw summary closely.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the agent list with care,
When it fails, the job rows still appear.
In each workspace, the fallback rows take their place,
A note keeps the list error clear to trace.
Press e or Enter; details are there.

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 783de8cb-8afa-4512-9ceb-196db6f9281c
Commits

Reviewing files that changed from the base of the PR and between 699d58b28989dad08064719cfebd241c389701e7 and ad29ca0782fa4bdad9f6aab2b59d9a2a52aa55bb.

Files selected for processing: 2

  • widgets/src/widgets/mux-activity/README.md
  • widgets/src/widgets/mux-activity/luvus.rs

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.

Recent review details

Context from checks skipped due to timeout: 1

  • GitHub Check: CodeRabbit
Additional context used

Code guidelines: 5

.agents/skills/principle-experience-first/SKILL.md — Agent Skill
CLAUDE.md — auto-discovered
README.md — auto-discovered
.agents/skills/agents-md-setup/SKILL.md — Agent Skill
.agents/skills/principle-minimize-reader-load/SKILL.md — Agent Skill
Path-based instructions: 5

Source excerpt: When implementation convenience conflicts with user delight, choose delight.

CodeRabbit inference engine (.agents/skills/principle-experience-first/SKILL.md)

Files:

  • widgets/src/widgets/mux-activity/README.md
  • widgets/src/widgets/mux-activity/luvus.rs
Source excerpt: Every widget is one folder under `widgets/src/widgets//`, containing its `main.rs`, `help.txt`, `README.md`, `CONFIGURE.md`, and `settings.json` when configurable.

CodeRabbit inference engine (CLAUDE.md)

Files:

  • widgets/src/widgets/mux-activity/README.md
Applicability reference: AGENTS.md: # Working on opscope Every widget is one folder under `widgets/src/widgets//`, containing its `main.rs`, `help.txt`, `README.md`, `CONFIGURE.md`, and `settings.json` Source excerpt: Every widget has...

CodeRabbit inference engine (README.md)

Files:

  • widgets/src/widgets/mux-activity/README.md
Source excerpt: If there's no `README.md`, scaffold a minimal one (project name, one-line description, setup/run commands).

CodeRabbit inference engine (.agents/skills/agents-md-setup/SKILL.md)

Files:

  • widgets/src/widgets/mux-activity/README.md
Source excerpt: **Collapse layers** that cost more than they save: wrappers with one caller, adapters with no second implementation, speculative indirection that was never needed.

CodeRabbit inference engine (.agents/skills/principle-minimize-reader-load/SKILL.md)

Files:

  • widgets/src/widgets/mux-activity/README.md
  • widgets/src/widgets/mux-activity/luvus.rs
Learnings: 1

Learning: 2026-11-12T23:22:47.943Z

Learnt from: wiiiimm
Repo: stealth-factory/opscope PR: 618
File: widgets/src/widgets/mux-activity/luvus.rs:313-318
Timestamp: 2026-11-12T23:22:47.943Z
Learning: In `widgets/src/widgets/mux-activity/luvus.rs`, `State.agents` is a `Result<Vec<Agent>, String>`. When `luvus agent list` fails, the AGENTS section shows the error and an unread count, rather than a successful empty list. If the board is changed to show local background jobs during that failure, preserve the agent-list error separately from the available job rows.

Applied to files:

  • widgets/src/widgets/mux-activity/luvus.rs
Clippy (1.99.1)

widgets/src/widgets/mux-activity/luvus.rs

[warning] 501-501: redundant closure

(warning)

LanguageTool

widgets/src/widgets/mux-activity/README.md

[style] ~212-~212: Consider shortening this phrase to just ‘whether’, unless you mean ‘regardless of whether’. Context: Under Luvus, the jobs are read whether or not luvus agent list answered. When it fa...

(WHETHER)

chatgpt-codex-connector[bot]11d ago
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

ReviewStatusCommitReview trigger
📝 Code Review✅ Completed 2026-11-17T07:37:51.440492Zad29ca0Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

coderabbitai[bot]approved changes11d ago