Skip to content

A self-improving RLM agent for coding workflows and long-running autonomous tasks.

Rust

feat(coding-agent): show subagent model and effort in agents view (#1479)

Seth Karten35f37ed063c0
diff --git a/packages/coding-agent/src/modes/agents-view/agents-view-mode.ts b/packages/coding-agent/src/modes/agents-view/agents-view-mode.ts
index 611f4be603..4569e22252 100644
--- a/packages/coding-agent/src/modes/agents-view/agents-view-mode.ts
+++ b/packages/coding-agent/src/modes/agents-view/agents-view-mode.ts
@@ -81,6 +81,7 @@ import {
getAgentsViewSummaryIdentity as getSummaryIdentity,
getUnifiedSessionAncestorSessionIds,
hasUnifiedSessionChildren,
+ isSubagentSummary,
migrateAgentsViewIdentitySet,
reconcileUnifiedSessions,
resolveAgentsViewLeftResult,
@@ -2552,11 +2553,16 @@ export class AgentsViewMode implements Component, Focusable {
: pendingKill
? `${keyText("app.agents.delete")} again to ${row.section === "running" ? "stop" : "delete"}`
: styleRowTitle(row);
- // Append the background summary as a dim suffix on the same line, e.g.
- // "fix auth · Refactoring token validation". Hidden during delete/stop
- // confirmations so the warning text stands alone.
+ // Keep stable model information ahead of the variable summary so narrow rows truncate the summary first.
const summaryText = !pendingDelete && !pendingKill ? row.summary.summary : undefined;
- const titleContent = summaryText ? `${title} ${theme.fg("dim", `· ${summaryText}`)}` : title;
+ const modelLabel =
+ isSubagentSummary(row.summary) && !pendingDelete && !pendingKill && row.summary.model
+ ? `${row.summary.model.provider}/${row.summary.model.id}${row.summary.thinkingLevel && row.summary.thinkingLevel !== "off" ? `:${row.summary.thinkingLevel}` : ""}`
+ : undefined;
+ const suffixes = [modelLabel, summaryText].filter(
+ (suffix): suffix is string => suffix !== undefined && suffix.length > 0,
+ );
+ const titleContent = suffixes.length > 0 ? `${title} ${theme.fg("dim", `· ${suffixes.join(" · ")}`)}` : title;
const titleCell = formatTableCell(titleContent, titleWidth);
const cells = [
icon,
diff --git a/packages/coding-agent/src/modes/agents-view/agents-view-state.ts b/packages/coding-agent/src/modes/agents-view/agents-view-state.ts
index 15524d7d6c..50b7ad1138 100644
--- a/packages/coding-agent/src/modes/agents-view/agents-view-state.ts
+++ b/packages/coding-agent/src/modes/agents-view/agents-view-state.ts
@@ -901,7 +901,7 @@ function findParentRow(
return undefined;
}
-function isSubagentSummary(summary: SessionSummary): boolean {
+export function isSubagentSummary(summary: SessionSummary): boolean {
if (summary.runtimeKind) {
return summary.runtimeKind === "subagent";
}
diff --git a/packages/coding-agent/test/suite/regressions/502-unified-session-view.test.ts b/packages/coding-agent/test/suite/regressions/502-unified-session-view.test.ts
index e1b0d8d806..7f28073f76 100644
--- a/packages/coding-agent/test/suite/regressions/502-unified-session-view.test.ts
+++ b/packages/coding-agent/test/suite/regressions/502-unified-session-view.test.ts
@@ -2,6 +2,7 @@ import stripAnsi from "strip-ansi";
import { describe, expect, test, vi } from "vitest";
import { AgentsViewMode } from "../../../src/modes/agents-view/agents-view-mode.js";
import type { SessionSummary } from "../../../src/modes/daemon/daemon-session-list.js";
+import { initTheme } from "../../../src/modes/interactive/theme/theme.js";
import { createDeferred as deferred } from "../scheduling.js";
function summary(id: string): SessionSummary {
@@ -470,4 +471,68 @@ describe("#502 unified session view regressions", () => {
);
expect(rendered).toMatch(/123456 · 2h\s*$/);
});
+
+ test("scoped subagent rows keep model and effort ahead of summaries", () => {
+ initTheme("dark");
+ const subagent = {
+ // Direct children in a scoped Agents View render as agent rows while
+ // retaining their persisted subagent runtime kind.
+ kind: "agent" as const,
+ section: "idle" as const,
+ summary: {
+ ...summary("effort-child"),
+ runtimeKind: "subagent" as const,
+ summary: "Investigate a variable background status that can be truncated",
+ model: { provider: "prime-inference", id: "gpt-5.6-terra" } as SessionSummary["model"],
+ thinkingLevel: "high" as SessionSummary["thinkingLevel"],
+ } as SessionSummary,
+ title: "Inspect agents view",
+ subtitle: "",
+ statusLabel: "idle",
+ depth: 1,
+ selectable: true,
+ runningSubagentCount: 0,
+ identity: "effort-child",
+ parentIdentity: "parent",
+ };
+ const harness = {
+ rows: [subagent],
+ selectedIndex: -1,
+ isPendingDeleteRow: () => false,
+ isPendingKillSubagentRow: () => false,
+ getRowIcon: () => "·",
+ formatRowIcon: (_section: string, icon: string) => icon,
+ };
+ const render = (width: number) =>
+ stripAnsi(
+ privateMethod<(this: typeof harness, row: typeof subagent, width: number) => string>("renderRow").call(
+ harness,
+ subagent,
+ width,
+ ),
+ );
+
+ const full = render(120);
+ expect(full).toContain(
+ "Inspect agents view · prime-inference/gpt-5.6-terra:high · Investigate a variable background status",
+ );
+ const narrow = render(75);
+ expect(narrow).toContain("prime-inference/gpt-5.6-terra:high");
+ expect(narrow).not.toContain("Investigate a variable background status");
+
+ subagent.summary.summary = "";
+ expect(render(100)).toContain("Inspect agents view · prime-inference/gpt-5.6-terra:high");
+
+ // Older daemons identify subagents through persisted linkage instead of runtimeKind.
+ subagent.summary.runtimeKind = undefined;
+ subagent.summary.rlmChildId = "effort-child";
+ expect(render(100)).toContain("Inspect agents view · prime-inference/gpt-5.6-terra:high");
+
+ subagent.summary.thinkingLevel = "off";
+ subagent.summary.summary = "A later summary";
+ expect(render(100)).toContain("Inspect agents view · prime-inference/gpt-5.6-terra · A later summary");
+ expect(render(100)).not.toContain(":off");
+
+ expect(render(20)).toHaveLength(20);
+ });
});