Skip to content

[Dashboard] Link Workers to Actor Detail pages and handle Nil IDs#63795

Open
AyushKashyapII wants to merge 1 commit into
ray-project:masterfrom
AyushKashyapII:dashboard-ui-links-49342
Open

[Dashboard] Link Workers to Actor Detail pages and handle Nil IDs#63795
AyushKashyapII wants to merge 1 commit into
ray-project:masterfrom
AyushKashyapII:dashboard-ui-links-49342

Conversation

@AyushKashyapII
Copy link
Copy Markdown

Why are these changes needed?

This PR partially resolves #49342 (specifically addressing the first bullet point regarding Cluster view navigation).

The Problem: Currently, when viewing the Nodes table in the Cluster view, the worker process name is plain text. There is no quick way to jump to the details of a specific Actor running on that node without manually copy-pasting IDs into the search bar.

The Solution: This PR updates the WorkerRow component inside NodeRow.tsx so that the worker's process name (the cmdline string) now acts as a direct <Link> to the Actor Detail page (if the worker is hosting an Actor).

Architectural Code Choices

During implementation, I had to account for several backend data structures exported by Ray:

  1. Array Extraction: worker.coreWorkerStats is passed as an array to the frontend. The logic extracts coreWorkerStats[0] to safely access the ID.
  2. "Nil" ID Handling: If a worker is not an actor, Ray does not set actorId to null/undefined. Instead, it passes a "Nil" ID (a string of 32 or 40 fs). I added an explicit check against this ffff... string to prevent linking users to non-existent actor pages.
  3. Task IDs are 1:N: We cannot natively link generic task workers to a specific /tasks/{taskId} page from this view. A worker process is long-lived and executes many tasks sequentially, so the backend does not expose a single taskId in the top-level worker stats.
  4. The Fallback: If the worker is not an Actor, it safely falls back to linking to /cluster/nodes/{nodeId} (the Node Detail page) to preserve navigation utility.

Related issue number

Resolves #49342

Testing Instructions

  1. Start a local Ray cluster.
  2. Run a script that spawns a long-running Actor:
import ray
import time

ray.init()

@ray.remote
class DummyActor:
    def do_work(self):
        time.sleep(3600)

a = DummyActor.remote()
a.do_work.remote()

while True:
    time.sleep(1)

@AyushKashyapII AyushKashyapII requested a review from a team as a code owner June 2, 2026 10:19
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request updates the worker row component to conditionally wrap the command line text in a link, pointing to either the specific actor page or the node page. The feedback suggests adding defensive checks to prevent runtime errors if the command line array is empty or undefined, and refactoring the conditional logic to reduce code duplication.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +251 to +264
<TableCell align="center">
{coreWorker &&
coreWorker.actorId &&
coreWorker.actorId !== "ffffffffffffffffffffffffffffffffffffffff" &&
coreWorker.actorId !== "ffffffffffffffffffffffffffffffff" ? (
<Link component={RouterLink} to={`/actors/${coreWorker.actorId}`}>
{cmdline[0]}
</Link>
) : (
<Link component={RouterLink} to={`/cluster/nodes/${nodeId}`}>
{cmdline[0]}
</Link>
)}
</TableCell>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Correctness & Maintainability Issues

  1. Defensive Programming: If cmdline is undefined or empty, accessing cmdline[0] can cause a runtime TypeError or render an empty, unclickable link, which is a poor user experience.
  2. Code Duplication: The <Link component={RouterLink} ...> wrapper is duplicated for both the actor and fallback paths. We can simplify this by inlining the conditional logic for the to prop and using a safe fallback for the link text.
      <TableCell align="center">
        <Link
          component={RouterLink}
          to={
            coreWorker &&
            coreWorker.actorId &&
            coreWorker.actorId !== "ffffffffffffffffffffffffffffffffffffffff" &&
            coreWorker.actorId !== "ffffffffffffffffffffffffffffffff"
              ? "/actors/" + coreWorker.actorId
              : "/cluster/nodes/" + nodeId
          }
        >
          {(cmdline && cmdline[0]) || "Worker (PID: " + pid + ")"}
        </Link>
      </TableCell>

@AyushKashyapII AyushKashyapII force-pushed the dashboard-ui-links-49342 branch 2 times, most recently from 723282b to 83e8142 Compare June 2, 2026 10:25
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

Reviewed by Cursor Bugbot for commit 83e8142. Configure here.

Comment thread python/ray/dashboard/client/src/pages/node/NodeRow.tsx Outdated
Signed-off-by: Ayush KAshyap <kashyap11ayush02@gmail.com>
@AyushKashyapII AyushKashyapII force-pushed the dashboard-ui-links-49342 branch from 83e8142 to d39a808 Compare June 2, 2026 10:37
@ray-gardener ray-gardener Bot added dashboard Issues specific to the Ray Dashboard core Issues that should be addressed in Ray Core community-contribution Contributed by the community labels Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-contribution Contributed by the community core Issues that should be addressed in Ray Core dashboard Issues specific to the Ray Dashboard

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Dashboard] Improve displaying and navigation for tasks/actors

1 participant