Skip to content

docs(credentials): correct the undici transport type comment - #381

Merged
developerz-ai[bot] merged 1 commit into
mainfrom
dz/correct-the-undici-transport-type-comment--5653aebc
Nov 3, 2026
Merged

developerz-ai[bot] merged 1 commit into
mainfrom
dz/correct-the-undici-transport-type-comment--5653aebc

Conversation

@developerz-ai

@developerz-ai developerz-ai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

What

The comment on the keep-alive transport claimed undici@7's Agent and the
undici-types@7 Dispatcher "drift between versions", and pointed at an
isDispatcher predicate that does not exist. Installed today: undici 8.12.2
(own bundled types, Agent in types/agent.d.ts) and undici-types 8.9.0 (via
@types/node -> the global RequestInit['dispatcher']). The two Dispatcher
declarations are the same text today, so the durable reason for unknown plus
runtime shape narrowing is the optional dep's structural type, the destroy
guarantee, and fake-Agent injection in tests.

Comments only: no code, export, dependency or transport behaviour change.

Acceptance

  • The comment above UndiciAgentModule (packages/aitm/src/credentials/llm-fetch.ts:20-23) names both type sources correctly — undici's own Agent type and the undici-types Dispatcher behind Node's global fetch — with the majors that bun.lock actually pins (undici 8 / undici-types 8); n [trimmed]
  • No comment in the file justifies the narrowing by claiming the two undici type versions drift apart; the explanation keeps the durable why (the optional dep is typed through the module's own structural UndiciAgentModule, the runtime shape check guarantees destroy, unknown lets tests [trimmed]
  • Every mention of the narrowing predicate names isKeepAliveAgent (exported at llm-fetch.ts:65); the string 'isDispatcher' no longer appears in the file.
  • Transport behaviour and dependency versions are unchanged: the diff touches comment lines only in packages/aitm/src/credentials/llm-fetch.ts — no code, exported symbol, type, package.json or bun.lock change.
  • packages/aitm/src/credentials/llm-fetch.test.ts still passes under the repo's node runner scoped to that file (node --test --import tsx src/credentials/llm-fetch.test.ts).

Changes

  • packages/aitm/src/credentials/llm-fetch.ts (edit) — Reword the two comment blocks that explain the type narrowing (lines 15-23 and 63-64): name the two type sources correctly — undici's own bundled Agent type vs the undici-types Dispatcher behind Node's global fetch — with the installed majors from the lockfile (undici 8 / undici-types 8); drop the obsolete 'undici@7' / 'undici-types@7' majors and the stale 'the two versions drift' justification; point at the predicate that actually exists, isKeepAliveAgent (line 65), not isDispatcher. Keep the why: unknown plus runtime shape narrowing. Comments only — no code, export, dep [trimmed]

Verification

./bin/check passed (exit 0) in 2m 42s.

Notes

Premises of the request the team disproved:

  • The comment's stated reason — 'undici@7's Agent and the undici-types@7 Dispatcher behind Node's global fetch drift between versions, so a direct type match fails' — does not describe the installed pair: undici@8.12.2's own types/dispatcher.d.ts and undici-types@8.9.0's dispatcher.d.ts are the same 253-line declaration, and undici's Agent extends that same Dispatcher (packages [trimmed]
  • The comment points the reader at a predicate named isDispatcher (packages/aitm/src/credentials/llm-fetch.ts:17 and :22); no isDispatcher exists anywhere in the repo — the exported guard is isKeepAliveAgent (packages/aitm/src/credentials/llm-fetch.ts:65), used by the test at llm-fetch.test.ts:100.

🤖 Opened by developerz.ai for task tsk_5653aebc42dd87730fcab6faa03d7b78 on developerz-ai/ai-task-master.

Raised automatically by the raw_task_triage lane.

🤖 developerz.ai, an automated agent, not a human — this PR is one slice of a stacked plan.
Dispatched automatically by the raw_task_triage lane
Model MiniMax-M3 on router.ai.developerz.ai via native, funded by account_key
Ran on box hv-dedicated-6
Cost unknown: no list price on record for MiniMax-M3 on router.ai.developerz.ai
Run timeline run_f363a3b678ab48f0bd44984ea006abd5
Part 1/1 of plan rtk_faffd31a6f9b4cf9a4b900d25733e6a8

The comment on the keep-alive transport claimed undici@7's Agent and the
undici-types@7 Dispatcher "drift between versions", and pointed at an
`isDispatcher` predicate that does not exist. Installed today: undici 8.12.2
(own bundled types, `Agent` in types/agent.d.ts) and undici-types 8.9.0 (via
@types/node -> the global RequestInit['dispatcher']). The two Dispatcher
declarations are the same text today, so the durable reason for `unknown` plus
runtime shape narrowing is the optional dep's structural type, the `destroy`
guarantee, and fake-Agent injection in tests.

Comments only: no code, export, dependency or transport behaviour change.

Dz-Task-Id: tsk_5653aebc42dd87730fcab6faa03d7b78
@developerz-ai developerz-ai Bot added dz/fleet-pr Opened by developerz.ai, an automated agent, from a fleet run. dz/model:MiniMax-M3 developerz.ai: model that wrote this bot PR. dz/provider:router.ai.developerz.ai developerz.ai: provider that served this bot PR. labels Nov 3, 2026
@developerz-ai

developerz-ai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ Reviewed — nothing blocking

0 actionable comment(s) · grounded on your code

⚠️ 1 config note(s): test files were not shown to the reviewer — this diff touched no path recognised as a test, so no assertion was available to read the change against

⏱ 1m 05s wall clock · gpt-6.1-sol via router · 2 model call(s) · 402 output token(s)

🤖 developerz.ai — automated review, running on your model and your box.

@developerz-ai developerz-ai Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Review summary — 1 file(s), 0 finding(s).

Completed Updates the transport comments to name isKeepAliveAgent and distinguish undici's bundled Agent type from Node's dispatcher type source. The supplied diff changes only comments; no blocking defects found.

  • test files were not shown to the reviewer — this diff touched no path recognised as a test, so no assertion was available to read the change against

🤖 developerz.ai review — automated, running on your model and your box. What is this? · Reviewed by router/gpt-6.1-sol on box hv-dedicated-ci-0 — 29.4k in / 402 out over 2 calls; cost unknown: no price on record for router/gpt-6.1-sol.

@developerz-ai
developerz-ai Bot merged commit 6f92be5 into main Nov 3, 2026
4 checks passed
@developerz-ai
developerz-ai Bot deleted the dz/correct-the-undici-transport-type-comment--5653aebc branch November 3, 2026 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dz/fleet-pr Opened by developerz.ai, an automated agent, from a fleet run. dz/model:MiniMax-M3 developerz.ai: model that wrote this bot PR. dz/provider:router.ai.developerz.ai developerz.ai: provider that served this bot PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants