sdk-python
sdk-python copied to clipboard
[BUG] TS http_request: a timeout reports "The operation was aborted due to timeout" instead of its own timeout message
Human Overview
To be filled in by a human (AI-drafted issue, see team/AI_USAGE_POLICY.md).
Checks
- [x] I have updated to the lastest minor and patch version of Strands
- [x] I have checked the documentation and this is not expected behavior
- [x] I have searched ./issues and there are no duplicates of my issue
SDK Language
TypeScript
Strands Version
main @ 794d37c6e (@strands-agents/sdk 0.0.1-development); also present at 7296caba7
Language Runtime Version
Node.js 24.15.0
Operating System
macOS 26.7.3
Installation Method
git clone
Steps to Reproduce
When the http_request timeout fires, the tool reports Node's generic abort text instead of its own Request timed out after <n> seconds: <method> <url> message.
import { createServer } from 'node:http'
import { Agent } from '@strands-agents/sdk'
import { httpRequest } from '@strands-agents/sdk/vended-tools/http-request'
// A server that accepts the request and never answers.
const server = createServer(() => {})
await new Promise<void>((r) => server.listen(0, '127.0.0.1', r))
const url = `http://127.0.0.1:${(server.address() as { port: number }).port}/slow`
const agent = new Agent({ tools: [httpRequest], printer: false })
const result = await agent.tool.http_request!.invoke({ method: 'GET', url, timeout: 0.2 }, { recordDirectToolCall: false })
console.log(JSON.stringify(result.content))
server.closeAllConnections()
server.close()
Expected Behavior
[{"text":"Error: Request timed out after 0.2 seconds: GET http://127.0.0.1:<port>/slow"}], which tells the model what happened and which request it was.
Actual Behavior
[{"text":"Error: The operation was aborted due to timeout"}]