Skip to content

Add agent metadata column and store update API - #540

Open
bhaveshpatel640 wants to merge 2 commits into
mainfrom
AGE-2063
Open

Add agent metadata column and store update API#540
bhaveshpatel640 wants to merge 2 commits into
mainfrom
AGE-2063

Conversation

@bhaveshpatel640

@bhaveshpatel640 bhaveshpatel640 commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds the AGE-2063 foundation for agent metadata: persist an agent.metadata jsonb column on agent registry rows and expose store-level updateAgentMetadata.

Linear: AGE-2063

Changes

  • PG + SQLite migrations: agent.metadata jsonb / JSONB blob, default {}
  • AgentMetadataSchema (strict empty whitelist for now) + IAgentStore.updateAgentMetadata
  • PG/SQLite stores read/write metadata on agent records
  • Patch changeset for @truefoundry/trueforge

How was this tested?

  • Store contract: SQLite agent-store suite (metadata on create/update round-trip)
  • pnpm exec tsc --noEmit (package) as needed while iterating

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
Adds a required DB migration on agent (SQLite table rebuild with FK handling); behavior is additive with defaults, but deploy order and migration failure would block upgrades.

Overview
Introduces persisted agent.metadata on agent registry rows (AGE-2063 foundation): a separate JSON document from the manifest, intended for registry-level metadata that can be updated without replacing the full AgentSpec.

Schema & contract: New strict AgentMetadataSchema (empty whitelist for now) and metadata on AgentRecord. IAgentStore gains updateAgentMetadata; manifest updates via updateAgent leave metadata unchanged.

Migrations: Postgres adds metadata jsonb NOT NULL DEFAULT '{}'. SQLite rebuilds the agent table (STRICT/jsonb constraints) with the same column and backfills {} for existing rows.

Stores: Postgres and SQLite agent stores read/write metadata on list/get/create, seed new agents with EMPTY_AGENT_METADATA, and implement updateAgentMetadata with updated_at bumps. SQLite JSON parsing includes the new column.

Contract tests assert default {} on create, metadata preserved on manifest update, and undefined for missing ids on metadata update. Patch changeset for @truefoundry/trueforge.

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

@changeset-bot

changeset-bot Bot commented Sep 1, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: c241f87

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 ready for review September 1, 2026 17:31
@bhaveshpatel640 bhaveshpatel640 changed the title Persist agent identity id in metadata and add TrueFoundry client Add agent metadata column and store update API Sep 1, 2026
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.

1 participant