Skip to content

Conversation

@roblourens
Copy link
Member

Remove postOptions, since we should log params from the real request, and duplicated 'tools'.

Remove postOptions, since we should log params from the real request, and duplicated 'tools'.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request refactors how request parameters are logged by consolidating tools and postOptions fields from ILoggedPendingRequest into the existing body field. This simplification reduces redundancy since tools and other request options were already present in the body (of type IEndpointBody).

Key changes:

  • Removed the tools field from ILoggedPendingRequest interface and its import dependencies
  • Removed the redundant postOptions parameter from logged chat requests
  • Updated all logging call sites to pass request options within the body field instead
  • Updated all consumers to read from body.tools, body.max_tokens, and body.prediction instead of separate top-level fields

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/platform/requestLogger/node/requestLogger.ts Removed tools field from ILoggedPendingRequest interface and cleaned up unused imports
src/platform/endpoint/vscode-node/extChatEndpoint.ts Changed to pass requestOptions within body object instead of separate postOptions and tools fields
src/extension/prompt/vscode-node/requestLoggerImpl.ts Removed unused ILoggedPendingRequest import and updated all references to access tools/prediction/max_tokens through body field
src/extension/prompt/node/chatMLFetcher.ts Removed redundant postOptions and tools parameters from logged request, keeping only body
src/extension/conversation/vscode-node/feedbackReporter.ts Updated to access tools through body.tools instead of top-level tools field
src/extension/byok/vscode-node/geminiNativeProvider.ts Wrapped tools array in body object when logging requests
src/extension/byok/vscode-node/anthropicProvider.ts Wrapped tools array in body object when logging requests

Comment on lines +164 to +173
body: {
tools: options.tools?.map((tool): OpenAiFunctionTool => ({
type: 'function',
function: {
name: tool.name,
description: tool.description,
parameters: tool.inputSchema
}
}))
},
Copy link

Copilot AI Nov 2, 2025

Choose a reason for hiding this comment

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

The body object only contains the tools field but could contain additional request parameters that may already be present in options. Consider whether other relevant fields from the request options should also be included in the body object for logging consistency (e.g., max_tokens, temperature, prediction). This would ensure comprehensive logging of the request parameters.

Copilot uses AI. Check for mistakes.
description: tool.description,
parameters: tool.inputSchema
}
}))
Copy link

Copilot AI Nov 2, 2025

Choose a reason for hiding this comment

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

Similar to the Anthropic provider, the body object only contains the tools field. Consider whether other relevant fields from the request options should also be included in the body object for logging consistency (e.g., max_tokens, temperature, prediction). This would ensure comprehensive logging of the request parameters across all providers.

Suggested change
}))
})),
max_tokens: options.maxTokens,
temperature: options.temperature,
prediction: options.prediction

Copilot uses AI. Check for mistakes.
@roblourens roblourens added this pull request to the merge queue Nov 2, 2025
Merged via the queue into main with commit 486df42 Nov 2, 2025
22 checks passed
@roblourens roblourens deleted the roblou/scary-parrot branch November 2, 2025 16:45
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