Repository navigation
Conversation
🦋 Changeset detectedLatest commit: 9f66e15 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 51f7330b19
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| if (!(error instanceof TypeError) || error.cause === undefined || !URL.canParse(sourceUrl)) { | ||
| return false; | ||
| } | ||
| const url = new URL(sourceUrl); | ||
| return url.username === '' && url.password === ''; |
There was a problem hiding this comment.
Reject unsupported schemes before labeling failures as network
When a configured registry uses a parseable but unsupported URL such as ftp://... or file://..., Node's fetch rejects with a TypeError whose cause is unknown scheme or not implemented, so this predicate classifies a request-construction/configuration error as kind: 'network'. That changes the existing base failure shape and can make desktop, web, or SDK clients present irrelevant connectivity diagnostics; restrict the classification to transport-capable protocols such as HTTP and HTTPS.
AGENTS.md reference: AGENTS.md:L111-L113
Useful? React with 👍 / 👎.
| const sensitiveValues = new Set([ | ||
| url.username, | ||
| url.password, | ||
| ...url.searchParams.values(), | ||
| ...rawRegistryQueryValues(sourceUrl), | ||
| url.hash.slice(1), | ||
| ]); |
There was a problem hiding this comment.
Redact empty-valued and short keyless query credentials
Registry URLs can carry an opaque credential as a key-only query, but ...?sensitive-token= is parsed as a key with an empty value and query keys are omitted from this sensitive-value set, while a short keyless value such as ...?123 is skipped by replaceStandaloneRegistryValue. If a proxy or custom fetch error echoes the query separately or uses a canonicalized URL that does not exactly match sourceUrl, the credential survives into reason and is then exposed through REST and WebSocket refresh results; explicitly treat raw keyless entries and empty-valued keys as sensitive query values.
Useful? React with 👍 / 👎.
| kind: failure.kind, | ||
| registry_group: failure.registryGroup, | ||
| registry_url: failure.registryUrl, |
There was a problem hiding this comment.
Publish failure-only catalog refresh events
When a scheduled or user-triggered refresh produces only registry failures (the normal result of a registry outage) and no provider changes, ProviderDiscoveryService.refreshProviderModels does not publish ModelCatalogChanged because publication is still gated on response.changed.length > 0. Consequently these newly mapped fields never reach WebSocket consumers in the primary failure scenario; they are emitted only when some unrelated provider also changes, so the publication condition must include failures.
Useful? React with 👍 / 👎.
Related Issue
N/A — 来自已确认的 desktop 自定义 registry 诊断案例,无单独 issue。
Problem
自定义 registry 的
api.json请求因网络或代理不可用时,刷新结果只保留笼统的fetch failed,丢失底层cause和 registry 分组信息。客户端因此无法给出准确的网络排查建议,也无法区分同一次故障影响多个 provider 的情况。与此同时,非法 URL、userinfo、主动取消和 Fetch bad-port 限制不应被归类为传输网络错误。What changed
cause与AggregateError.errors[]链,并对 registry URL 及原始/编码后的敏感组成部分脱敏;AbortError 原样保留,请求构造错误不标记为network。failed新增可选kind、registry_group、registry_url,同次响应内同组 provider 共享分组 ID,非网络失败保持原结构。server-api.md。Behavior Changes and Affected Users
fetch failedmessage is retainedproviderandreasonnetworkclassification{ provider, reason }shapeValidation
pnpm vitest run packages/oauth/test/custom-registry.test.ts packages/oauth/test/oauth.test.ts packages/agent-core-v2/test/app/kosongConfig/discovery.test.ts packages/kap-server/test/modelCatalog.test.ts packages/kap-server/test/sessionEventBroadcaster.test.ts packages/node-sdk/test/sdk-rpc-client-v2.test.tspnpm lintpnpm sherifpnpm typecheckpnpm testpnpm buildpnpm -C docs run buildorigin/maincheckout, and the two compaction tests pass in isolation. These tests were not changed to manufacture a pass.Checklist
gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.