Repository navigation
docs(credentials): correct the undici transport type comment - #381
developerz-ai[bot] merged 1 commit into
Conversation
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
✅ Reviewed — nothing blocking0 actionable comment(s) · grounded on your code ⏱ 1m 05s wall clock · 🤖 developerz.ai — automated review, running on your model and your box. |
There was a problem hiding this comment.
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.
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
isDispatcherpredicate that does not exist. Installed today: undici 8.12.2(own bundled types,
Agentin 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
unknownplusruntime shape narrowing is the optional dep's structural type, the
destroyguarantee, and fake-Agent injection in tests.
Comments only: no code, export, dependency or transport behaviour change.
Acceptance
UndiciAgentModule(packages/aitm/src/credentials/llm-fetch.ts:20-23) names both type sources correctly — undici's ownAgenttype and theundici-typesDispatcherbehind Node's global fetch — with the majors that bun.lock actually pins (undici 8 / undici-types 8); n [trimmed]UndiciAgentModule, the runtime shape check guaranteesdestroy,unknownlets tests [trimmed]isKeepAliveAgent(exported at llm-fetch.ts:65); the string 'isDispatcher' no longer appears in the file.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 bundledAgenttype vs theundici-typesDispatcherbehind 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), notisDispatcher. Keep the why:unknownplus runtime shape narrowing. Comments only — no code, export, dep [trimmed]Verification
./bin/checkpassed (exit 0) in 2m 42s.Notes
Premises of the request the team disproved:
Agentand the undici-types@7Dispatcherbehind Node's global fetch drift between versions, so a direct type match fails' — does not describe the installed pair: undici@8.12.2's owntypes/dispatcher.d.tsand undici-types@8.9.0'sdispatcher.d.tsare the same 253-line declaration, and undici'sAgentextends that sameDispatcher(packages [trimmed]isDispatcher(packages/aitm/src/credentials/llm-fetch.ts:17 and :22); noisDispatcherexists anywhere in the repo — the exported guard isisKeepAliveAgent(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_5653aebc42dd87730fcab6faa03d7b78on developerz-ai/ai-task-master.Raised automatically by the
raw_task_triagelane.