Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

fixed arxiv tools

Type of Change

  • Bug fix

Testing

Tested ArXiv and custom tools

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Sep 21, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
sim Ready Ready Preview Comment Sep 21, 2025 7:05pm
1 Skipped Deployment
Project Deployment Preview Comments Updated (UTC)
docs Skipped Skipped Sep 21, 2025 7:05pm

@waleedlatif1 waleedlatif1 merged commit d83865c into staging Sep 21, 2025
5 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/index branch September 21, 2025 19:05
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Summary

This PR fixes critical issues with the ArXiv tools by making two key improvements: upgrading API endpoints from HTTP to HTTPS and resolving response handling in the tool execution system.

The most visible change is the security upgrade across three ArXiv tool files (get_paper.ts, get_author_papers.ts, and search.ts) where the API base URL is changed from http://export.arxiv.org/api/query to https://export.arxiv.org/api/query. This ensures encrypted communication with the ArXiv API and prevents potential security vulnerabilities and compatibility issues with modern browsers that block insecure HTTP requests.

The more complex fix addresses a fundamental issue in the tool execution system within apps/sim/tools/index.ts. The handleInternalRequest function was creating mock response objects with cached data that prevented transformResponse functions from accessing the actual response body. The previous implementation consumed the response stream when parsing responseData, then tried to provide cached versions through json() and text() methods. The fix changes these methods to call the original response methods directly (json: () => response.json() and text: () => response.text()), ensuring that tools with custom response transformation logic can properly read the response data.

These changes work together to fix the ArXiv tools comprehensively - the HTTPS upgrade ensures connectivity and security, while the response handling fix enables proper data processing for tools that use custom transformation logic.

Confidence score: 4/5

  • This PR addresses real issues but involves changes to core response handling logic that could affect other tools
  • Score reflects the combination of simple, safe HTTPS upgrades with more complex response stream management changes
  • Pay close attention to the response handling changes in apps/sim/tools/index.ts as they modify how all tools process responses

4 files reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

Comment on lines +558 to 560
json: () => response.json(),
text: () => response.text(),
} as Response
Copy link
Contributor

Choose a reason for hiding this comment

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

logic: Critical fix: calling original response methods directly allows transform functions to access response body. However, this may cause issues if the response stream was already consumed elsewhere in the function.

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