GeezerVison is showing github.com — aggregator(provider-display): underscore strip breaks one-shot iterables and collapses renamed+plain providers to one display name · Issue #6891 · developing-today/code
aggregator(provider-display): underscore strip breaks one-shot iterables and collapses renamed+plain providers to one display name #6891Descriptionaggregator(provider-display): underscore strip breaks one-shot iterables and collapses renamed+plain providers to one display name
Summary
The leading-underscore display strip added to providerDisplayNames in PR #6889 (commit 8dc7e75af7, the #1823 provider rename) introduced two defects in pm-stack/aggregator/src/provider-display.ts:
- The function now spreads its
Iterable<string> parameter twice, so a one-shot iterable produces a garbage map. providerDisplayNames is declared over Iterable<string> (line 37), and the pre-rename implementation spread it exactly once. The new code spreads it at line 38 to build the stripped list and again at line 44 (const originals = [...names]) to recover the keys. For a one-shot iterable — a generator, a Map.keys() / Set.values() iterator — the second spread is empty, originals[i] is undefined, and the result is a single-entry map keyed by undefined. Every lookup misses, and providerDisplayName silently falls back to the unstripped canonical id.
- The underscore strip is not collision-aware, unlike the
-direct rule in the same function. The -direct strip keeps the suffix when a plain base provider exists in the same set, expressly "so the two stay distinguishable" (module header). The underscore strip has no such guard: a set containing both the renamed id and its plain base — e.g. _claude and claude, or the new pool series _commandcode and the pre-rename series commandcode that the rename deliberately kept in the store — renders both providers under the identical display string.
Evidence
pm-stack/aggregator/src/provider-display.ts:37-58 at 4cd2927643 (origin/main):
export function providerDisplayNames(names: Iterable<string>): Map<string, string> {
const list = [...names].map((name) => { ... }); // first spread (line 38)
...
const originals = [...names]; // second spread (line 44)
Verified this run on the laptop with the real file verbatim (md5 f16c0bdb00963613ca7b19399f667520, probe ~/git/fleet/probe-provider-display, bun 1.4.4):
| Input |
Result |
["_claude", "_antigravity.gemini", "meta"] (array, control) |
correct map, underscore stripped |
generator yielding "_claude", "meta", "_antigravity.gemini" |
Map { undefined: "claude" } — size 1, get("_claude") and get("meta") both undefined |
Map.keys() iterator over _claude/meta |
same single undefined-keyed entry |
providerDisplayName("_claude", generator) |
returns "_claude" (fallback, unstripped) |
["_claude", "claude"] |
both display "claude" |
["_commandcode", "commandcode"] |
both display "commandcode" |
["_antigravity.gemini", "antigravity.gemini"] |
both display "antigravity.gemini" |
["openai", "openai-direct"] (contrast) |
-direct correctly kept: the existing rule is collision-aware |
Control: the shipped suite pm-stack/aggregator/test/provider-display.test.ts passes 11/11 on the same tree (run via git archive origin/main) — it only ever passes arrays, and has no renamed+plain pair case.
All current call sites (render.ts:2167, render.ts:3364, render.ts:3714) pass arrays, so defect 1 is latent today — but the exported signature promises Iterable<string>, and the singular helper providerDisplayName(name, names) invites exactly the iterator inputs that break.
Why it matters
This module is the dashboard's one display-name rule, and its header states the contract: display strings change, ids/keys never do, and names that would collide stay distinguishable. Defect 1 breaks the type contract silently (no throw — wrong markup), and defect 2 makes two different providers/series indistinguishable on the quota board precisely in the migration window the rename created, where old and new ids coexist in the store by design.
Acceptance criteria
-
providerDisplayNames reads its input exactly once: a generator or Map.keys() iterator yields the same map as the equivalent array, keyed by the exact input strings.
- When stripping the leading underscore would make a name's display equal to another distinct input's display in the same set (renamed + plain base both present, plain or dotted), the renamed name keeps a distinguishable display (mirroring the
-direct rule's keep-on-collision behaviour); when there is no collision, the underscore is stripped as today.
- New regression tests in
pm-stack/aggregator/test/provider-display.test.ts cover: a one-shot iterable input, and a renamed+plain pair (_claude + claude and/or _commandcode + commandcode).
-
bun test test/provider-display.test.ts passes (existing 11 tests unchanged in behaviour).
Related: #1823 / PR #6889 (the rename that introduced the strip); #6125 (the original -direct display rule). Activitydeveloping-today commented on Nov 7, 2026 added kind/bugSomething isn't working (prefixed form of the classic bug label) task/small-fixQueue packet kind: bounded fix with reproduction and targeted tests effort/sSmall: expected under 2 hours of work on Nov 7, 2026dezren39 commented on Nov 7, 2026 🤖 Agent note · filed
- Agent: new-issue-creator job (new-issue-creator-code-b)
- Session / ID: cron new-issue-creator-code-b run 2026-11-07T14:20Z
- Found via: filed this run
- Task: Fix providerDisplayNames so it reads its Iterable input once and keeps renamed+plain providers distinguishable on display collision (evidence and probe in the issue body).
- Expectation: effort/s — done when one-shot iterables yield the array-equivalent map, collision pairs stay distinguishable, and new regression tests pin both cases.
- Links: probe ~/git/fleet/probe-provider-display (laptop); queue packet enqueued to repo-health-code-pilot this run
developing-today commented on Nov 8, 2026 🤖 Agent note · handed off
dezren39 commented on Nov 8, 2026 dezren39 commented on Nov 10, 2026 🤖 Agent note · handed off to opencode claimant
dezren39 commented on Nov 10, 2026
Lane code-l picked up task 11288 (issue #6891) — handed off to opencode claimant.
dezren39 commented on Nov 10, 2026 🤖 Agent note · handed off (task 11288, lane code-u)
dezren39 commented on Nov 10, 2026 🤖 Agent note · handed off
dezren39 commented on Nov 10, 2026 🤖 Agent note · handed off
dezren39 commented on Nov 11, 2026
Agent note — task 13338 DONE (lane code-d): PR #7054 merged under Drew's #7297 per-item ruling
The recorded blocker was the authorship hard stop, overturned 2026-11-11 (dezren39 = fleet identity; held is a label; PR #7054 has no labels at all, let alone hard-stop ones). Fresh verification on head c333f08: small TypeScript fix (+37/-4) in pm-stack/aggregator provider-display with its test file; no Codex threads or findings on the PR. Local run on the head in the existing clean worktree: bun test test/provider-display.test.ts — 14 pass, 0 fail. The scripts-test CI failures are stale Nov 8-9 stall runs in the Python suite, which this TypeScript change cannot affect. Merging per the per-item rule. dezren39 commented on Nov 11, 2026
state: done
task: 11288
lane: code-d
worker: repo-worker-code
outcome: already_done
Verified already fixed: PR #7054 merged (merge commit dcdf212; fix commit c333f08 "fix(aggregator): preserve distinct provider display names"). On current main, pm-stack/aggregator/src/provider-display.ts reads the iterable exactly once (const originals = [...names] at line 39, with the collision-aware handling built on that single read) — both acceptance defects (double-spread of one-shot iterables, underscore-strip collision) are addressed by the merged change. Issue #6891 closed COMPLETED 2026-11-11T08:04:18Z. Task 11288 completes as already_done.
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|