Skip to content

Drop agent.metadata column - #561

Merged
bhaveshpatel640 merged 1 commit into
mainfrom
AGE-2084
Sep 3, 2026
Merged

Drop agent.metadata column#561
bhaveshpatel640 merged 1 commit into
mainfrom
AGE-2084

Conversation

@bhaveshpatel640

@bhaveshpatel640 bhaveshpatel640 commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Drop unused agent.metadata - remote identity lives in external_id.

Linear: AGE-2084

Changes

  • Add PG/SQLite migrations to drop agent.metadata
  • Remove metadata from agent store types, schemas, and implementations
  • Update contract/unit tests + changeset

How was this tested?

  • pnpm --filter @truefoundry/trueforge exec jest --config jest.unit.config.cjs tests/unit/truefoundry/TrueFoundryAgentStore.test.ts tests/unit/apis/agents.test.ts --no-coverage
  • pnpm test:store:local -- tests/db/sqlite/agent-store/contract.test.ts tests/db/postgres/agent-store/contract.test.ts

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
Schema migrations alter the agent table on Postgres and SQLite (SQLite table rebuild with FK handling); behavior change is limited because metadata was unused and not on the public API, but deploy order must run migrations before upgraded code.

Overview
Removes the internal agent.metadata jsonb column and all store/API plumbing around it. Remote identity stays on external_id; the public Agent API never exposed metadata.

Postgres adds a migration that drops the column with a short lock timeout. SQLite rebuilds the agent table (STRICT/jsonb constraints) while preserving (tenant_id, name) uniqueness and the partial unique index on (tenant_id, external_id).

AgentRecord / UpdateAgentInput and both agent stores no longer read or write metadata; the empty agentMetadata schema module is deleted. Contract and agents API tests drop metadata patch expectations but still assert PUT rejects metadata in the request body.

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

@changeset-bot

changeset-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: be8895b

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 2, 2026 19:37
@bhaveshpatel640
bhaveshpatel640 marked this pull request as ready for review September 2, 2026 19:39
@bhaveshpatel640
bhaveshpatel640 marked this pull request as draft September 2, 2026 19:39
@bhaveshpatel640
bhaveshpatel640 force-pushed the AGE-2064 branch 2 times, most recently from 45b8a9e to 72c6a3f Compare September 3, 2026 06:05
@bhaveshpatel640
bhaveshpatel640 changed the base branch from AGE-2064 to main September 3, 2026 06:43
@bhaveshpatel640
bhaveshpatel640 marked this pull request as ready for review September 3, 2026 06:45
@bhaveshpatel640 bhaveshpatel640 changed the title Drop unused agent.metadata column Drop agent.metadata column Sep 3, 2026
@bhaveshpatel640
bhaveshpatel640 merged commit 49360bc into main Sep 3, 2026
8 checks passed
@bhaveshpatel640
bhaveshpatel640 deleted the AGE-2084 branch September 3, 2026 07:30
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