Skip to content

[3616 by Claude Opus 5.5] Package MCP servers: "Check" and save fail for every npm package against the public registry (502) - #3627

Merged
integry merged 1 commit into
3616-epic-0-9-d8bfrom
3616/claude-opus-5-5-package-mcp-servers-check-20261117-0149-05p
Nov 17, 2026
Merged

integry merged 1 commit into
3616-epic-0-9-d8bfrom
3616/claude-opus-5-5-package-mcp-servers-check-20261117-0149-05p

Conversation

@propr-dev

@propr-dev propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI Implementation Summary

Closes #3616

Branch: 3616/claude-opus-5-5-package-mcp-servers-check-20261117-0149-05p
Commits: ✅ Changes committed (3eda7cb)


AI Processing Completed

Execution Details:

Summary:
I fixed the 502 when checking or saving npm package servers against the public registry. All three extension call sites now use one shared lookup helper, pinnedLookup, which answers correctly whether Node asks for a list of addresses or a single one. I tested this against a local test server, not the live npm registry.

Cause. On Node 22, Node asks the custom lookup for a list of addresses (all: true). The old callback returned a single address, so every request failed with ERR_INVALID_IP_ADDRESS and was reported as 502.

Changes

  • endpointPolicy.ts: new exported pinnedLookup(address, family). It returns [{ address, family }] when Node asks for a list and the single address otherwise. It still only ever answers with the vetted address, so the public-address check is unchanged and redirects are still not followed. MCP tool discovery in requestExtensionMcp now uses it.
  • extensionOAuthHttp.ts (OAuth discovery and token requests): now uses pinnedLookup. This path, like MCP tool discovery, dials the vetted IP directly, so Node probably never calls the lookup there. I changed both anyway, as the issue asked.
  • packageRegistry.ts: registryGet now uses pinnedLookup. It is also exported and takes an optional vet argument, which defaults to the real public-address check; this is only so the test can point the pinned connection at a local server. A missing package or version now returns the existing 404 "was not found in the npm registry" instead of 502.
  • packages/api/mcp/clients.ts: outside the extensions code, but it had the same single-address callback when fetching OAuth client metadata by hostname. I fixed it inline the same way.

Tests. The new packages/core/test/extensionPinnedLookup.test.ts sends real HTTP requests through registryGet to a local server. The hostname used doesn't resolve, so a request can only arrive through the custom lookup. It runs once with all: true and once with all: false, and checks both a found package (200) and a missing one (404). A third test checks the helper's return value in both cases.

  • With the old callback put back, the all: true case fails, so the test catches the bug on Node 22.23.
  • With the fix, the new tests and the existing extension package-server, OAuth and profile suites pass (48 tests across the final runs). The profile suite needs PROPR_DEMO_MODE=true, or it exits early on the GitHub-auth check.
  • ESLint (zero warnings) and tsc pass for core, and API tsc passes. The new test file is ignored by core's ESLint config, so lint covers only src/extensions.

No visual previews, since nothing in the UI changed.

Review digest

Risk-tiered paths

  • High risk (1 file)
    • packages/core/src/extensions/extensionOAuthHttp.ts (+2/−2): auth-looking path
  • Normal risk (3 files)
    • packages/api/mcp/clients.ts (+2/−1)
    • packages/core/src/extensions/endpointPolicy.ts (+15/−2)
    • packages/core/src/extensions/packageRegistry.ts (+12/−5)
  • Low risk (1 file)
    • packages/core/test/extensionPinnedLookup.test.ts (added, +60/−0)

Validation evidence

  • No repository validation commands ran.

Diff size: 5 files changed, +91/−10 lines

Detailed Logs:

  • Conversation: 49 messages
  • Session: 9a7f840b-002f-48d7-a637-092eedaff30b

Log files stored at:

  • conversation: /usr/src/app/logs/executions/issue-3616-2026-11-17T01-58-18-964Z-conversation.json
  • output: /usr/src/app/logs/executions/issue-3616-2026-11-17T01-58-18-964Z-output.txt
Latest Conversation Messages
ASSISTANT: [content unavailable]

ASSISTANT: I fixed the 502 when checking or saving npm package servers against the public registry. All three extension call sites now use one shared `lookup` helper, `pinnedLookup`, which answers correctly whet...


This PR was created automatically by ProPR after processing issue #3616.


💡 Need changes?

Comment on this PR to request refinements — the AI agent monitors comments and will update the implementation based on your feedback. Keep iterating until you're satisfied!

…he public registry. All three extension call sites now use one shared `lookup` helper, `pinnedLookup`, which answers correctly whether Node asks for a list of addresses or a single one. I tested this against a local test server, not the live npm registry.

Cause. On Node 22, Node asks the custom `lookup` for a list of addresses (`all: true`). The old callback returned a single address, so every request failed with `ERR_INVALID_IP_ADDRESS` and was reported as 502.

Changes
- `endpointPolicy.ts`: new exported `pinnedLookup(address, family)`. It returns `[{ address, family }]` when Node asks for a list and the single address otherwise. It still only ever answers with the vetted address, so the public-address check is unchanged and redirects are still not followed. MCP tool discovery in `requestExtensionMcp` now uses it.
- `extensionOAuthHttp.ts` (OAuth discovery and token requests): now uses `pinnedLookup`. This path, like MCP tool discovery, dials the vetted IP directly, so Node probably never calls the lookup there. I changed both anyway, as the issue asked.
- `packageRegistry.ts`: `registryGet` now uses `pinnedLookup`. It is also exported and takes an optional `vet` argument, which defaults to the real public-address check; this is only so the test can point the pinned connection at a local server. A missing package or version now returns the existing 404 "was not found in the npm registry" instead of 502.
- `packages/api/mcp/clients.ts`: outside the extensions code, but it had the same single-address callback when fetching OAuth client metadata by hostname. I fixed it inline the same way.

Tests. The new `packages/core/test/extensionPinnedLookup.test.ts` sends real HTTP requests through `registryGet` to a local server. The hostname used doesn't resolve, so a request can only arrive through the custom lookup. It runs once with `all: true` and once with `all: false`, and checks both a found package (200) and a missing one (404). A third test checks the helper's return value in both cases.
- With the old callback put back, the `all: true` case fails, so the test catches the bug on Node 22.23.
- With the fix, the new tests and the existing extension package-server, OAuth and profile suites pass (48 tests across the final runs). The profile suite needs `PROPR_DEMO_MODE=true`, or it exits early on the GitHub-auth check.
- ESLint (zero warnings) and `tsc` pass for core, and API `tsc` passes. The new test file is ignored by core's ESLint config, so lint covers only `src/extensions`.

No visual previews, since nothing in the UI changed.
@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

/ultrafix goal=8 max=6
Triggered automatically by the requested execution settings.

@propr-dev propr-dev Bot added the ultrafix label Nov 17, 2026
@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

🔄 Ultrafix loop started (goal: 8/10, max cycles: 6)

First action: /review

💡 Tip: Remove the ultrafix label from this PR to stop further ultrafix cycles.

@propr-dev

propr-dev Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor Author

✅ AI Code Review Complete requested by @propr-dev[bot]

Posted 1 review:

View Task Details

@propr-dev

propr-dev Bot commented Nov 17, 2026

Copy link
Copy Markdown
Contributor Author

🔍 AI Code Review — codex:gpt-6-astra

Overall Evaluation

The PR correctly fixes the lookup callback shape while preserving address pinning. The change is focused and merge-ready within scope, conditional on the four pending test shards completing successfully.

✅ Correct callback shapes — pinnedLookup returns an address array for all: true and a single address plus family otherwise.

✅ Preserved security boundary — Production registry requests still vet the destination before connecting, and both callback shapes return only that vetted address.

✅ Focused regression coverage — The new tests exercise real sockets with both address-selection settings, checking successful and missing-package responses through an unresolvable hostname.

This assessment is based on static review of the supplied diff and complete file contents; no commands were run.

Merge blockers

No merge blockers.

Suggestions

These are optional follow-ups and are not sent to /fix.

S1: 🟢 Cover IPv6 callback results

Consider parameterizing the helper test in packages/core/test/extensionPinnedLookup.test.ts with an IPv6 address and family 6. This would explicitly protect family preservation in both callback shapes without requiring IPv6 networking on CI. It is optional because the implementation handles both families identically and no IPv6 defect is evident.

Score

The implementation directly addresses the failure with focused regression tests and no verified introduced defects. Current checks report no failures, with four test shards still pending.

Score: 9/10


🤖 Review Details

  • Model: GPT-6 Astra
  • Time: 2m 20s
  • Tokens: 31,446 (31,105 in / 341 out)
  • Cost: $0.20

View Task


💡 Next step: Comment /fix to address every F# merge blocker, /fix all for every pending blocker and suggestion, or name records explicitly, as in /fix F3 S5.
F# and S# IDs increment across review comments and remain permanent, so selectors such as /fix F3 F5 stay unambiguous across cycles. S# suggestions stay optional: they are implemented only when you name them or request /fix all, and they never relax a merge blocker.

Copy and edit to choose records from this review:

/fix S1

🤖 Review by ProPR

@propr-dev propr-dev Bot removed the ultrafix label Nov 17, 2026
@propr-dev propr-dev Bot changed the title 🔨 [3616 by Claude Opus 5.5] Package MCP servers: "Check" and save fail for every npm package against the public registry (502) ✅⑨ [3616 by Claude Opus 5.5] Package MCP servers: "Check" and save fail for every npm package against the public registry (502) Nov 17, 2026
@integry
integry merged commit 8e8295e into 3616-epic-0-9-d8b Nov 17, 2026
57 checks passed
@propr-dev propr-dev Bot changed the title ✅⑨ [3616 by Claude Opus 5.5] Package MCP servers: "Check" and save fail for every npm package against the public registry (502) [3616 by Claude Opus 5.5] Package MCP servers: "Check" and save fail for every npm package against the public registry (502) Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant