Skip to content

Inject db into TrueFoundryAgentStore for advisory locks - #588

Merged
bhaveshpatel640 merged 5 commits into
mainfrom
AGE-2064-followup
Sep 4, 2026
Merged

bhaveshpatel640 merged 5 commits into
mainfrom
AGE-2064-followup

Conversation

@bhaveshpatel640

@bhaveshpatel640 bhaveshpatel640 commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Inject db into TrueFoundryAgentStore for advisory locks

Closes AGE-2064

Changes

How was this tested?

Checklist

  • I have read the contributing guidelines
  • pnpm build, pnpm test, pnpm typecheck, pnpm lint:ci, and pnpm format:check pass locally
  • Tests added/updated where it makes sense
  • No hand-edits to generated code (packages/trueforge-sdk, .github/fern/openapi/openapi.json, docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge
  • Docs / .env.example updated if configuration or behavior changed

Note

Medium Risk
Touches agent create/update/delete locking and ServiceFoundry sync paths; behavior should be equivalent but wrong transaction scope could reintroduce concurrent update races.

Overview
TrueFoundryAgentStore now takes an injected Kysely<Database> so update/delete advisory locks run via #db.transaction() when the caller does not pass a transaction, instead of calling PostgresAgentStore.withTransaction.

PostgresAgentStore.withTransaction is removed. Server wiring passes db into buildResolveAgentStore / TrueFoundryAgentStore. The decorator is typed against PostgresAgentStore (no generic inner + withTransaction on the inner). Class docs for create/update/delete failure behavior are expanded.

Unit tests use mockDb / tfStore and add coverage that manifest updates open a DB transaction when none is supplied.

Reviewed by Cursor Bugbot for commit 63a846b. Bugbot is set up for automated code reviews on this repo. Configure here.

@changeset-bot

changeset-bot Bot commented Sep 4, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 63a846b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@truefoundry/trueforge Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@bhaveshpatel640
bhaveshpatel640 marked this pull request as draft September 4, 2026 05:42

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c31b629. Configure here.

@bhaveshpatel640
bhaveshpatel640 marked this pull request as ready for review September 4, 2026 05:52
@bhaveshpatel640
bhaveshpatel640 marked this pull request as draft September 4, 2026 05:53
@bhaveshpatel640
bhaveshpatel640 marked this pull request as ready for review September 4, 2026 06:09
@bhaveshpatel640
bhaveshpatel640 enabled auto-merge (squash) September 4, 2026 09:44
@bhaveshpatel640
bhaveshpatel640 merged commit 7968f59 into main Sep 4, 2026
9 checks passed
@bhaveshpatel640
bhaveshpatel640 deleted the AGE-2064-followup branch September 4, 2026 09:49
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