Skip to content

Conversation

@tianzhou
Copy link
Member

No description provided.

Copilot AI review requested due to automatic review settings December 26, 2025 11:58
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 PR adds request logging functionality to the search_objects tool handler, bringing it into parity with the execute_sql and custom tool handlers. The implementation tracks all search operations including their success status, duration, client identifier, and error messages.

Key Changes:

  • Added request tracking infrastructure by importing requestStore and getClientIdentifier
  • Modified error handling to capture error messages before returning error responses
  • Implemented request logging in a finally block to ensure all invocations are tracked

Comment on lines +552 to +564
} finally {
// Track the request
requestStore.add({
id: crypto.randomUUID(),
timestamp: new Date().toISOString(),
sourceId: effectiveSourceId,
toolName: effectiveSourceId === "default" ? "search_objects" : `search_objects_${effectiveSourceId}`,
sql: `search_objects(object_type=${object_type}, pattern=${pattern}, schema=${schema || "all"}, table=${table || "all"}, detail_level=${detail_level})`,
durationMs: Date.now() - startTime,
client: getClientIdentifier(extra),
success,
error: errorMessage,
});
Copy link

Copilot AI Dec 26, 2025

Choose a reason for hiding this comment

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

The new request logging functionality lacks test coverage. While the repository has comprehensive test coverage for the search_objects tool (835 lines of tests), there are no tests verifying that requests are correctly logged to the requestStore with the appropriate success/failure status, error messages, duration, client identifier, and other fields. Consider adding tests similar to those in the requests integration tests to verify this new logging behavior.

Copilot uses AI. Check for mistakes.
@tianzhou tianzhou merged commit 43abdc5 into main Dec 26, 2025
8 checks passed
@tianzhou tianzhou deleted the request_log branch December 26, 2025 15:21
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