Key pre-run model rows by environment id, not label

Environment labels can collide (e.g. identical hostnames); keying the
rows by label would make React mis-reconcile them. Key by the unique
environment id instead.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
Theo BrowneandClaude Fable 5 committed 2026-07-23 19:42:58 -07:00
1 parent f8b9d79934
commit f8e63b222d
1 file changed
+6 -2
@@ -171,7 +171,10 @@ function SweepPreRunSummary() {
// here, in the same most-recently-active order startReviewSweep uses,
// so the environment/model rows never overstate the calls.
const reviewed = candidates.slice(0, SWEEP_MAX_THREADS);
const models = new Map<string, { label: string; model: string; threads: number }>();
const models = new Map<
string,
{ environmentId: string; label: string; model: string; threads: number }
>();
for (const shell of reviewed) {
const config = serverConfigs.get(shell.environmentId);
const entry = models.get(shell.environmentId);
@@ -180,6 +183,7 @@ function SweepPreRunSummary() {
} else {
const selection = config?.settings.textGenerationModelSelection;
models.set(shell.environmentId, {
environmentId: shell.environmentId,
label: config?.environment.label ?? shell.environmentId,
model: selection ? `${selection.model}` : "server default",
threads: 1,
@@ -222,7 +226,7 @@ function SweepPreRunSummary() {
: ""}
</div>
{modelsByEnvironment.map((entry) => (
<div key={entry.label} className="truncate">
<div key={entry.environmentId} className="truncate">
{entry.label}: <span className="text-foreground">{entry.model}</span> · {entry.threads}{" "}
{entry.threads === 1 ? "thread" : "threads"}
</div>