Skip to content

Fix query parameters not being sent on API requests#22

Open
pchalacis wants to merge 1 commit into
configcat:mainfrom
pchalacis:fix/append-query-params-to-api-requests
Open

Fix query parameters not being sent on API requests#22
pchalacis wants to merge 1 commit into
configcat:mainfrom
pchalacis:fix/append-query-params-to-api-requests

Conversation

@pchalacis
Copy link
Copy Markdown

@pchalacis pchalacis commented May 28, 2026

AI-generated content — authored by an AI agent on behalf of the user.

Summary

  • Fix a bug where executeApiTool collected query parameters (e.g. reason) but never appended them to the request URL
  • Environments with reasonRequired: true returned 400 {"Reason":["Reason required."]} for write tools like update-setting-value-v2, even when reason was provided
  • Extract query-string building into src/helpers/query-params.ts with unit tests
  • Add npm test script and run tests in CI

Root cause

queryParams was populated from executionParameters with in: "query", but the map was never serialized onto urlPath before calling http.request().

Test plan

  • npm test — 7 unit tests for buildQueryString and appendQueryParams
  • npm run lint:check
  • Manual verification: update-setting-value-v2 with reason on Staging succeeds (HTTP 200)

Made with Cursor

Query params such as `reason` were collected in executeApiTool but never
appended to the request URL, causing 400 errors on environments that
require an audit reason. Extract URL building into helpers/query-params
and add unit tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
@pchalacis pchalacis requested a review from a team as a code owner May 28, 2026 12:51
@kp-cat
Copy link
Copy Markdown
Member

kp-cat commented Jun 2, 2026

Hey @pchalacis,
Thanks for the PR. Please allow us to review it with the dev team, and we’ll get back to you.

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.

2 participants