Skip to content

fix(tools): await VoltAgent conversation persistence - #1507

Closed
abhinav7x94 wants to merge 1 commit into
supermemoryai:mainfrom
abhinav7x94:fix/tools-await-voltagent-persistence
Closed

fix(tools): await VoltAgent conversation persistence#1507
abhinav7x94 wants to merge 1 commit into
supermemoryai:mainfrom
abhinav7x94:fix/tools-await-voltagent-persistence

Conversation

@abhinav7x94

Copy link
Copy Markdown
Contributor

Summary

  • await VoltAgent conversation persistence before the onEnd lifecycle hook resolves
  • preserve fail-open behavior because save failures are still caught and logged
  • add deferred-fetch regressions for delayed success and delayed HTTP failure

Why

The hook previously detached saveConversation(). In serverless or short-lived runtimes, the request could terminate after onEnd resolved but before /v4/conversations completed, silently dropping conversation memory.

Validation

  • bunx vitest run src/voltagent/hooks.test.ts (2/2)
  • runnable tools suite: 92 passed, 30 skipped
  • package build
  • changed-file TypeScript check
  • Biome and git diff --check

The two full-suite load failures are unchanged from main (missing SUPERMEMORY_API_KEY and the existing ./claude-memory import).

@MaheshtheDev

Copy link
Copy Markdown
Member

Included in #1594 with your commit and authorship intact, plus a Co-Authored-By trailer in the description so the credit survives the squash merge.

We dropped hooks.test.ts. Awaiting the save in onEnd is unchanged, and it was the most valuable of the batch since a torn-down serverless runtime was silently losing conversations.

Thanks @abhinav7x94.

graphite-app Bot pushed a commit that referenced this pull request Aug 24, 2026
#1594)

Cherry-picks four contributor PRs for `@supermemory/tools` onto one branch, and bumps the package to 2.2.0.

- #1244 (@rajarshidattapy): `withSupermemory` accepts `options.apiKey` instead of only reading `SUPERMEMORY_API_KEY`, matching the Vercel, Mastra and Voltagent integrations. Unblocks secrets managers, edge runtimes and per-request keys.
- #1574 (@Agnik47): re-exports `PromptTemplate`, `MemoryPromptData` and `WithSupermemoryOptions` from `ai-sdk`. `./vercel` is not a published subpath, so the documented custom-template example did not compile.
- #1488 (@abhinav7x94): malformed tool-call JSON returns an error result instead of throwing out of the request.
- #1507 (@abhinav7x94): VoltAgent `onEnd` awaits the conversation save, which was fire-and-forget and could be dropped when a serverless runtime tore down.

Dropped the `middleware.test.ts` added by #1244. Note that editing `packages/tools/package.json` triggers the npm publish workflow on merge.

Co-Authored-By: rajarshidattapy <138959719+rajarshidattapy@users.noreply.github.com>
Co-Authored-By: Agnik47 <140933190+Agnik47@users.noreply.github.com>
Co-Authored-By: abhinav7x94 <204053250+abhinav7x94@users.noreply.github.com>
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