Skip to content

fix(tools): keep the forget-request timeout when a caller passes a signal - #1603

Closed
Cintu07 wants to merge 1 commit into
supermemoryai:mainfrom
Cintu07:fix/tools-forget-timeout-with-signal
Closed

fix(tools): keep the forget-request timeout when a caller passes a signal#1603
Cintu07 wants to merge 1 commit into
supermemoryai:mainfrom
Cintu07:fix/tools-forget-timeout-with-signal

Conversation

@Cintu07

@Cintu07 Cintu07 commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Fixes #1549

forgetMemoryRequest combined the caller's abort signal and the 30s fetch timeout with ??, so the two were mutually exclusive. Passing a cancellation signal dropped the timeout and made the DELETE /v4/memories request unbounded again, undoing the bound #1451 added. A caller that wanted both cancellation and a timeout had no way to ask for it.

It is latent today, since no production call site passes options (ai-sdk.ts:332 and openai/tools.ts:490 both omit it). It becomes a real hang the first time someone wires up cancellation.

Changes:

  • compose the caller signal and the timeout with AbortSignal.any instead of choosing between them, so the request aborts on whichever fires first
  • fall back to the plain timeout when no caller signal is passed
  • rewrite the existing signal test, which asserted the dropped-timeout behaviour, to assert the composed signal aborts on the caller and still carries the timeout

AbortSignal.any is available on the repo's Node 20 engines floor, Bun, and workerd.

Tested:
vitest run src/tool-operations.test.ts (14 passed)

…gnal

forgetMemoryRequest combined the caller signal and the 30s timeout with
`??`, so passing a cancellation signal dropped the timeout and made the
DELETE /v4/memories request unbounded again, undoing supermemoryai#1451. compose them
with AbortSignal.any so both still apply. updates the existing signal
test to assert the composed behavior.

closes supermemoryai#1549
Copilot AI lite review requested due to automatic review settings August 27, 2026 10:12

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@MaheshtheDev

Copy link
Copy Markdown
Member

duplicate of #1595

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.

forgetMemoryRequest drops its 30s timeout whenever a caller passes a signal

3 participants