Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/sim/tools/arxiv/get_author_papers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const getAuthorPapersTool: ToolConfig<

request: {
url: (params: ArxivGetAuthorPapersParams) => {
const baseUrl = 'http://export.arxiv.org/api/query'
const baseUrl = 'https://export.arxiv.org/api/query'
const searchParams = new URLSearchParams()

searchParams.append('search_query', `au:"${params.authorName}"`)
Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/arxiv/get_paper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const getPaperTool: ToolConfig<ArxivGetPaperParams, ArxivGetPaperResponse
paperId = paperId.split('arxiv.org/abs/')[1]
}

const baseUrl = 'http://export.arxiv.org/api/query'
const baseUrl = 'https://export.arxiv.org/api/query'
const searchParams = new URLSearchParams()
searchParams.append('id_list', paperId)

Expand Down
2 changes: 1 addition & 1 deletion apps/sim/tools/arxiv/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const searchTool: ToolConfig<ArxivSearchParams, ArxivSearchResponse> = {

request: {
url: (params: ArxivSearchParams) => {
const baseUrl = 'http://export.arxiv.org/api/query'
const baseUrl = 'https://export.arxiv.org/api/query'
const searchParams = new URLSearchParams()

// Build search query
Expand Down
6 changes: 2 additions & 4 deletions apps/sim/tools/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -554,11 +554,9 @@ async function handleInternalRequest(
status: response.status,
statusText: response.statusText,
headers: response.headers,
// Provide the resolved URL so tool transforms can safely read response.url
url: fullUrl,
json: async () => responseData,
text: async () =>
typeof responseData === 'string' ? responseData : JSON.stringify(responseData),
json: () => response.json(),
text: () => response.text(),
} as Response
Comment on lines +558 to 560
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.


const data = await tool.transformResponse(mockResponse, params)
Expand Down