Skip to content

fix: preserve complete numeric tool parameters - #1392

Merged
samanhappy merged 2 commits into
samanhappy:mainfrom
remote-controlled-man:codex/prflow-fdd889467f60
Oct 27, 2026
Merged

samanhappy merged 2 commits into
samanhappy:mainfrom
remote-controlled-man:codex/prflow-fdd889467f60

Conversation

@remote-controlled-man

Copy link
Copy Markdown
Contributor

MCPHub's HTTP tool endpoints parsed numeric strings by prefix. An integer argument of 1e3 reached the MCP tool as 1, 1.5 became 1, and a number argument of 12oops became 12.

Parse complete, finite decimal strings, including scientific notation, and require integer results for integer schemas. Leave invalid strings unchanged for schema validation. Existing numeric inputs are unchanged. The shared conversion also applies to primitive array items.

The regression exercises real Express HTTP requests for OpenAPI GET/POST and the dashboard tool-call controller, asserting the forwarded arguments. The external MCP catalog and dispatch are mocked; no live model or upstream MCP service is required. This fixes server-side string conversion; client-side pre-conversion is outside this change.

Validation on macOS, Node 24.21.0, pnpm 10.12.4:

  • Regression failed in all three HTTP paths before the fix; 38 related tests pass after it.
  • Full test:ci: 2,983 passed, 2 skipped, using the local DNS fixture described below.
  • lint, docs:validate, backend:build, frontend:typecheck, frontend:build, and node scripts/verify-dist.js pass.

The host resolves example.com and mcp.pcloud.com to blocked benchmarking addresses. The unmodified source reproduces the same 13 unrelated failures. For local validation, a temporary Jest setup supplies public-address DNS fixtures only for these two hosts in the five affected, HTTP-mocked suites, restores DNS afterward, and leaves other hosts and the SSRF guard unchanged. This setup is not committed. Backend/frontend builds were invoked explicitly with Corepack to select the declared pnpm version.

Related #1347 adds primitive-array conversion; its scalar numeric parsing is unchanged and this PR fixes that shared parsing.

Copilot AI balanced review requested due to automatic review settings October 27, 2026 06:34
@mintlify

mintlify Bot commented Oct 27, 2026

Copy link
Copy Markdown

Preview approval required

This pull request comes from a fork, so Mintlify won't build a preview until someone with write access approves commit c0583f7.

Approve preview

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@codecov

codecov Bot commented Oct 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@08740a1). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1392   +/-   ##
=======================================
  Coverage        ?   64.24%           
=======================================
  Files           ?      250           
  Lines           ?    20696           
  Branches        ?     5300           
=======================================
  Hits            ?    13297           
  Misses          ?     5746           
  Partials        ?     1653           
Flag Coverage Δ
unittests 64.24% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@samanhappy
samanhappy merged commit cadd686 into samanhappy:main Oct 27, 2026
5 checks passed
@samanhappy

Copy link
Copy Markdown
Owner

Thanks for the fix and the thorough regression coverage! I reviewed the shared conversion logic and both controller call paths, and all 38 related tests passed locally. I found no blocking issues. This neatly fixes numeric-prefix truncation across the OpenAPI and dashboard endpoints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants