GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test(web): fix the agents relationship browser tests (#395) · adampeterhiggins/t3code@e045d81

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • apps/web/src/components/chat
    • AgentFleetRow.tsx
    • ThreadRelationshipsControl.agents.browser.test.tsx
  • packages/client-runtime/src/state
    • agentFleet.ts
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎apps/web/src/components/chat/AgentFleetRow.tsx‎

Copy file name to clipboardExpand all lines: apps/web/src/components/chat/AgentFleetRow.tsx
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,8 @@ export function AgentPreviewContent(props: {
193193
<span className="shrink-0">
194194
{[STATUS_VISUALS[agent.status].label, props.provider?.displayName]
195195
.filter(Boolean)
196-
.join(" · ")}{" "}
197-
·
196+
.join(" · ")}
197+
{" · "}
198198
</span>
199199
<SubagentModelLabel
200200
model={agent.model}
Collapse file

‎apps/web/src/components/chat/ThreadRelationshipsControl.agents.browser.test.tsx‎

Copy file name to clipboardExpand all lines: apps/web/src/components/chat/ThreadRelationshipsControl.agents.browser.test.tsx
+64-30Lines changed: 64 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,37 @@ vi.mock(import("@tanstack/react-router"), async (original) => ({
3535
vi.mock(import("../../state/entities"), async (original) => ({
3636
...(await original()),
3737
useThreadShells: (() => state.shells) as never,
38+
// Only the viewed thread is loaded; agent rows and previews that read a child thread find it
39+
// unloaded, as before its subscription delivers.
3840
useThreadProjection: ((ref: ScopedThreadRef | null) =>
3941
ref === null
4042
? undefined
41-
: {
42-
projection: state.projections
43-
? state.projections.get(scopedThreadKey(ref))
44-
: state.projection,
45-
}) as never,
43+
: state.projections
44+
? { projection: state.projections.get(scopedThreadKey(ref)) }
45+
: (state.projection as { thread?: { id?: string } } | null)?.thread?.id === ref.threadId
46+
? { projection: state.projection }
47+
: null) as never,
4648
useThreadRelationshipShells: ((ref: { readonly environmentId: string }) =>
4749
(state.shells as ReadonlyArray<{ readonly environmentId: string; readonly source: unknown }>)
4850
.filter((shell) => shell.environmentId === ref.environmentId)
4951
.map((shell) => shell.source)) as never,
5052
useProjects: (() => state.projects) as never,
53+
// Agent previews compare an agent's workspace with its owner's.
54+
useThreadShell: ((ref: ScopedThreadRef | null) => {
55+
if (ref === null) return null;
56+
const viewed = (state.projection as { thread?: { id?: string } } | null)?.thread;
57+
const source =
58+
(state.shells as ReadonlyArray<{ readonly source: { readonly id?: string } }>).find(
59+
(shell) => shell.source.id === ref.threadId,
60+
)?.source ?? (viewed?.id === ref.threadId ? viewed : null);
61+
return source === null ? null : { ...source, environmentId: ref.environmentId, source };
62+
}) as never,
63+
useProject: ((ref: { readonly environmentId: string; readonly projectId: string } | null) =>
64+
ref === null
65+
? null
66+
: ((state.projects as ReadonlyArray<{ id: string; environmentId: string }>).find(
67+
(project) => project.id === ref.projectId && project.environmentId === ref.environmentId,
68+
) ?? null)) as never,
5169
}));
5270
vi.mock(import("../../state/environments"), async (original) => ({
5371
...(await original()),
@@ -106,6 +124,7 @@ vi.mock(import("../ui/preview-card"), async (original) => ({
106124
state.showTooltips ? <div role="tooltip">{children}</div> : null) as never,
107125
}));
108126

127+
import { STATUS_VISUALS } from "../AgentStatus";
109128
import { ThreadRelationshipsPanel } from "./ThreadRelationshipsControl";
110129

111130
let root: Root;
@@ -357,6 +376,7 @@ it("opens the correct chat for every workflow phase and unphased member", async
357376
providerInstanceId: "claude-work",
358377
childThreadId: "workflow-chat",
359378
title: "Checkout review",
379+
prompt: "Review the checkout flow",
360380
status: "running",
361381
startedAt: null,
362382
completedAt: null,
@@ -372,6 +392,9 @@ it("opens the correct chat for every workflow phase and unphased member", async
372392
lineage: { parentThreadId: "workflow-chat", relationshipToParent: "subagent" },
373393
status: "completed",
374394
activityRunStatus: null,
395+
createdAt: DateTime.makeUnsafe("2026-09-21T12:00:00Z"),
396+
providerInstanceId: "claude-work",
397+
modelSelection: { instanceId: "claude-work", model: "claude-sonnet-4-6" },
375398
}));
376399
state.shells = memberShells.map((source) => ({ environmentId: "other", source }));
377400
const panel = (
@@ -410,7 +433,8 @@ it("opens the correct chat for every workflow phase and unphased member", async
410433
});
411434
}
412435
const rendered = textNodes("|");
413-
expect(rendered.match(/Sonnet · Work account/g)).toHaveLength(7);
436+
// Each member's preview names its account, then its model as the account's catalog does.
437+
expect(rendered.match(/Work account\| · \|Sonnet\|/g)).toHaveLength(7);
414438
expect(rendered).not.toContain("Personal account");
415439
for (const phase of phases) expect(rendered).toContain(phase.title);
416440
expect(rendered).not.toContain(" phases");
@@ -451,6 +475,7 @@ it("groups and counts a workflow by its run status instead of its coordinator ch
451475
providerInstanceId: "claudeAgent",
452476
childThreadId: "workflow-chat",
453477
title: "Checkout review",
478+
prompt: "Review the checkout flow",
454479
status: "running",
455480
startedAt: DateTime.makeUnsafe("2026-09-21T12:00:00Z"),
456481
progress: "Inspecting the checkout workflow",
@@ -475,6 +500,7 @@ it("groups and counts a workflow by its run status instead of its coordinator ch
475500
id: "workflow-chat",
476501
title: "Coordinator chat",
477502
createdAt: DateTime.makeUnsafe("2026-09-16T12:00:00Z"),
503+
modelSelection: { instanceId: "claudeAgent", model: "claude-opus-5-5" },
478504
lineage: { parentThreadId: "parent", relationshipToParent: "subagent" },
479505
status: "completed",
480506
activityRunStatus: null,
@@ -506,6 +532,8 @@ it("groups and counts a workflow by its run status instead of its coordinator ch
506532
},
507533
],
508534
};
535+
// A finished workflow's chat is no longer waiting on a follow-up.
536+
state.shells = [{ environmentId: "test", source: child }];
509537
await update();
510538
expect(heading()).toBe("Lineage");
511539
expect(text()).toContain("Previous agents");
@@ -763,6 +791,8 @@ it("keeps active supervisor status, progress, and task timing after its child tu
763791
source: {
764792
id: "child-1",
765793
title: "Supervisor",
794+
modelSelection: { instanceId: "claudeAgent", model: "claude-opus-5-5" },
795+
createdAt: DateTime.makeUnsafe("2026-09-16T12:00:00Z"),
766796
status: "completed",
767797
activityRunStatus: null,
768798
latestRunId: "run-child-1",
@@ -802,7 +832,7 @@ it("keeps active supervisor status, progress, and task timing after its child tu
802832
},
803833
],
804834
};
805-
for (const status of ["pending", "running", "waiting"]) {
835+
for (const status of ["pending", "running", "waiting"] as const) {
806836
state.projection = {
807837
...projection,
808838
subagents: [{ ...projection.subagents[0], status }],
@@ -817,8 +847,12 @@ it("keeps active supervisor status, progress, and task timing after its child tu
817847
expect(heading()).toBe(status === "running" ? "Lineage · 1 running" : "Lineage");
818848
expect(textNodes(" ")).not.toContain("Previous agents");
819849
expect(buttons().some((button) => button.textContent?.includes("Supervisor"))).toBe(true);
820-
const tooltip = container.querySelector('[role="tooltip"]')?.textContent;
821-
expect.soft(tooltip).toContain(status);
850+
// The panel header's "Open in Agents panel" button has its own tooltip.
851+
const tooltip = Array.from(
852+
container.querySelectorAll('[role="tooltip"]'),
853+
(node) => node.textContent,
854+
).find((content) => content?.includes("Supervisor"));
855+
expect.soft(tooltip).toContain(STATUS_VISUALS[status].label);
822856
expect.soft(tooltip).toContain("Waiting for the worker to finish");
823857
expect.soft(tooltip).toContain("5m 15s");
824858
}
@@ -931,27 +965,24 @@ it("shows readable models and only differing workspace details in agent tooltips
931965
expect(text()).not.toContain("Worktree");
932966
expect(text()).not.toContain("Workspace");
933967

934-
for (const [model, expected] of [
935-
[null, "Not reported"],
936-
["", "Not reported"],
937-
[" ", "Not reported"],
938-
["model-alias", "My GPT"],
939-
["gpt-5.5", "GPT-5.5"],
940-
["custom/model-v1", "custom/model-v1"],
968+
// An agent that reports no model is named by its own thread's model, which carries its effort.
969+
for (const [model, expected, effort] of [
970+
[null, "My GPT", true],
971+
["", "My GPT", true],
972+
[" ", "My GPT", true],
973+
["model-alias", "My GPT", true],
974+
["gpt-5.5", "GPT-5.5", false],
975+
["custom/model-v1", "custom/model-v1", false],
941976
] as const) {
942977
state.projection = {
943978
...projection,
944979
subagents: [{ ...projection.subagents[0], model }],
945980
};
946981
await update();
947-
expect(text()).toContain(expected);
948-
if (!model?.trim() || model === "gpt-5.5" || model === "custom/model-v1") {
949-
expect(text()).not.toContain(" · high");
950-
} else {
951-
expect(text()).toContain(`${expected} · high`);
952-
}
982+
expect(text()).toContain(effort ? `${expected} · high` : expected);
983+
if (!effort) expect(text()).not.toContain(" · high");
953984
expect(text()).not.toContain("Unknown");
954-
if (!model?.trim()) expect(text()).not.toContain("My GPT");
985+
expect(text()).not.toContain("Not reported");
955986
}
956987

957988
for (const driver of [
@@ -969,8 +1000,8 @@ it("shows readable models and only differing workspace details in agent tooltips
9691000
subagents: [{ ...projection.subagents[0], driver, model: null }],
9701001
};
9711002
await update();
972-
expect(text()).toContain("Not reported");
973-
expect(text()).not.toContain("My GPT");
1003+
expect(text()).toContain("My GPT");
1004+
expect(text()).not.toContain("Not reported");
9741005
}
9751006

9761007
state.projection = projection;
@@ -1093,8 +1124,8 @@ it("shows readable models and only differing workspace details in agent tooltips
10931124
{ id: "serviceTier", value: "priority" },
10941125
];
10951126
await rerender();
1096-
expect(text(true)).toContain("My GPT · Work account · high");
1097-
expect(text()).toContain("My GPT · Work account · Fast mode onhigh");
1127+
expect(text(true)).toContain("Work account · My GPT · high");
1128+
expect(text()).toContain("Work account · My GPT · Fast mode onhigh");
10981129
expect(text()).not.toContain("Personal account");
10991130
state.projection = nativeProjection;
11001131
await update();
@@ -1131,7 +1162,7 @@ it("shows readable models and only differing workspace details in agent tooltips
11311162
if (status === "completed") {
11321163
await click(sectionToggle(false));
11331164
}
1134-
expect(text()).toContain("My GPT · Work account · Ultrafast mode onlow");
1165+
expect(text()).toContain("Work account · My GPT · Ultrafast mode onlow");
11351166
expect(text()).not.toContain(" · high");
11361167
}
11371168
await click(sectionToggle(true));
@@ -1184,8 +1215,11 @@ it("shows readable models and only differing workspace details in agent tooltips
11841215
await click(sectionToggle(false));
11851216
expect(text()).toContain("Final checks passed.");
11861217
expect(text()).not.toContain("Stale progress");
1187-
expect(text()).not.toContain("Hidden tail");
1188-
expect(text()).not.toContain(result);
1218+
// The preview clamps a long outcome to a few lines rather than cutting its text.
1219+
const outcome = [...container.querySelectorAll("p")].find((node) =>
1220+
node.textContent?.startsWith("Final checks passed."),
1221+
);
1222+
expect(outcome?.classList.contains("line-clamp-3")).toBe(true);
11891223
state.projection = projection;
11901224

11911225
child.worktreePath = "/main/worktrees/checker";
Collapse file

‎packages/client-runtime/src/state/agentFleet.ts‎

Copy file name to clipboardExpand all lines: packages/client-runtime/src/state/agentFleet.ts
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ export function subagentFromRecord(
111111
if (!childThread) return recorded;
112112
const withThread: RuntimeSubagent = {
113113
...recorded,
114-
model: recorded.model ?? childThread.modelSelection.model,
114+
// A blank reported model is no report; the thread knows what it runs.
115+
model: recorded.model?.trim() || childThread.modelSelection.model,
115116
effort: modelSelectionEffort(childThread.modelSelection),
116117
};
117118
return liveSubagent(withThread, childThread) ?? withThread;

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.