Skip to content

Fix: Show a pending bucket's agent and purpose in agentop instead of its raw id - #1270

Merged
huang195 merged 2 commits into
rossoctl:mainfrom
huang195:fix/pending-row-display
Oct 5, 2026
Merged

huang195 merged 2 commits into
rossoctl:mainfrom
huang195:fix/pending-row-display

Conversation

@huang195

@huang195 huang195 commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Summary

A pending: bucket is where a coding agent's calls that name no session collect until one does. The server lists it like any session, with no title and no agent, so in agentop it showed up as:

 SESSION         TITLE                              UPDATED   EVENTS  TOKENS  COST
 37a5c732-87bc…  rossoctl authbridge installer      11s ago        8    1.8M  $4.33
 pending:openc…                                     13s ago      265       —      —

That is a truncated id that names nothing and looks unfinished. A chatty bucket was also often the most recently updated row, so it sat near the top. With this PR the same rows render as:

 SESSION         TITLE                                   UPDATED   EVENTS  TOKENS  COST
 37a5c732-87bc…  rossoctl authbridge installer           just now       3    1.0k     —
 opencode        calls outside any session · pid 45462   13s ago      265    1.0k     —

(Captured from the sessions table on this branch, using test fixtures.)

Change

The change is in cmd/agentop/tui/pending_bucket.go, plus three call sites in sessions_pane.go.

  • SESSION shows the bucket's agent, parsed from pending:<agent>[@<pid>.<start>]. It shows only the agent, not agent·pid, because the column is 14 characters wide and claude-code·89949 would lose the pid to truncation.
  • TITLE falls back to calls outside any session · pid <n>, or just calls outside any session for an agent-wide bucket, when nothing else names it.
    • A harvested or served title still wins.
    • The fallback lives in sessionTitleFor, the display precedence, and not in sessionTitle. The re-harvest backoff reads sessionTitle as "named", so a bucket never counts as named.
    • Headers therefore read calls outside any session · pid 45462 (pending:opencode@…), which still includes the full id.
  • AGENT takes the agent from the id when the server leaves Agent blank, which it does for every bucket.
  • Order: buckets are listed after the real sessions, each group keeping its existing order. Selection already goes through sessionRowIDs, so the cursor and drill-down are unaffected.

Unchanged: the server's id, the API, the default bucket, and the agents picker, which still lists buckets under Other. The same rendering applies to rows kept alive only by agentop's cache after the proxy has forgotten them.

Related: #1269 stops OpenCode's own polling from filling the bucket after a proxy restart. That was the case that made this row hard to ignore. A bucket can still appear legitimately, for example from OpenCode's local-model probes or Bob's startup calls before its first header, which is why this PR is still needed.

Tests

cmd/agentop/tui/pending_bucket_test.go:

  • SESSION cell, for both a live row and a cache-only row
  • TITLE cell, with and without a pid, and the header label
  • a served title takes precedence over the fallback
  • buckets are ordered after real sessions
  • AGENT cell
  • the id parser, including pending:, default and a UUID

All were seen failing before the change. env -u SSL_CERT_FILE GOWORK=off go test ./... in cmd/agentop passes; go vet and gofmt -l are clean. The README's sessions-pane section describes the new row.

Deferred from review

  • sessions_pane.go:335: a cached-only row that is not a bucket shows "" under AGENT where it used to show — (emptyCell).
  • pending_bucket.go:47: the AGENT cell names a bucket's agent, but choosing that agent in the picker hides the row, which stays under Other.
  • README.md:682: / also matches the fallback title, not only the id.
  • pending_bucket_test.go:12: fixtures hand-write the pending id format instead of building it with session.PendingProcessID/PendingSessionID.
  • sessions_pane.go:270: why buckets list last is not stated where emit splits them out.

Assisted-By: Claude (Anthropic AI) [email protected]

A pending bucket — where an agent's calls that name no session collect until one
does — is listed by the server like any session, with no title and no agent. Its
row was therefore "pending:openc…" and nothing else: a truncated id that named
nothing, read as unfinished, and, being the most recently updated row whenever
the agent was chatty, sat near the top.

The SESSION cell now shows the agent, the TITLE cell falls back to "calls
outside any session · pid <n>" when nothing else names the bucket, the AGENT
cell takes the agent from the id, and pending buckets list after the real
sessions. A served or harvested title still wins, and the fallback lives in
sessionTitleFor rather than sessionTitle so the re-harvest backoff never reads a
bucket as named. Headers keep the full id. Rendering only: the server's id, the
API and the agents picker's Other scope are unchanged.

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Hai Huang <[email protected]>
@huang195
huang195 requested a review from a team as a code owner October 5, 2026 00:17
@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 13 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2209f368-e8a8-4050-8fe2-d7cc68133ff0
📥 Commits

Reviewing files that changed from the base of the PR and between e18722f and 962e588.

📒 Files selected for processing (4)
  • cmd/agentop/README.md
  • cmd/agentop/tui/pending_bucket.go
  • cmd/agentop/tui/pending_bucket_test.go
  • cmd/agentop/tui/sessions_pane.go
  • Autopilot · 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Fixes review: pending buckets were reordered among server-listed rows only, so after a proxy restart a listed bucket sat above the cached-only real sessions (sessions_pane.go:268)
Files:
- cmd/agentop/tui/pending_bucket.go
- cmd/agentop/tui/pending_bucket_test.go
- cmd/agentop/tui/sessions_pane.go

Assisted-By: Claude (Anthropic AI) <[email protected]>
Signed-off-by: Hai Huang <[email protected]>

@pdettori pdettori left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Solid, well-scoped rendering fix. The parser correctly targets the real pending:<agent>[@<pid>.<start>] format (matches PendingProcessID in core/session/process.go), the title fallback correctly lives in sessionTitleFor rather than sessionTitle so the re-harvest backoff never reads a bucket as named, and the ordering change preserves the rows/ids lockstep in both the server-listed and cached-only paths. Tests are table-driven and assertive, and the deferred-from-review list is accurate — every listed item is genuinely present in the code as described. No must-fix issues.

Author: huang195 (MEMBER — maintainer)
Areas reviewed: Go, Tests, Docs
Agent/IDE config (.claude/.vscode): none
Commits: 2, all signed-off: yes
CI status: all green

🤖 Assisted-By: Claude Code

rows, ids = append(rows, bucketRows...), append(ids, bucketIDs...)
// ONLY WHEN THE HEADER ACTUALLY CHANGES, which is a resize and nothing else. SetRows(nil)
// resets the viewport's offset, and this function runs on every poll — clearing
// unconditionally scrolled the picker back under the operator twice a second, which

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Cursor preservation across the bucket reorder is claimed via sessionRowIDs, but no test plants a cursor on a real session and then rebuilds with a bucket appearing/disappearing around it — the cached-source test only checks the default cursor. A test would pin the claim rather than leave it to the mechanism's continued correctness.

{"pending:claude-code", "claude-code", "", true},
{"pending:", "", "", false},
{session.DefaultSessionID, "", "", false},
{uuidOpened, "", "", false},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: This test asserts Rows()[0] directly instead of using the file's own rowOf helper, and only covers the served-title precedence. A harvested-title-wins case would close the PR description's claim that both title sources take precedence over the fallback.

}
if agentW > 0 {
row = append(row, emptyCell)
row = append(row, sessionAgentCell(session.SessionSummary{ID: id}, agentW))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (deferred-list visibility): cached non-bucket rows now show "" under AGENT where they showed — (emptyCell). Acknowledged in the PR body — flagging so it isn't rediscovered as a regression later.

return trunc(sanitizeLabel(agent), w)
}
return trunc(id, w)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: The bucket branch sanitizes the agent (sanitizeLabel) but the non-bucket branch truncates the raw id unsanitized. Presumably intentional (server-issued ids vs client-shaped agent names) — a one-line comment would settle it.

@huang195
huang195 merged commit 4b81beb into rossoctl:main Oct 5, 2026
28 checks passed
@github-project-automation github-project-automation Bot moved this from New/ToDo to Done in Rossoctl Issue Prioritization Oct 5, 2026
@huang195
huang195 deleted the fix/pending-row-display branch October 5, 2026 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants