Skip to content

feat(agent-configs): add per-agent engine settings to agent_configs table#878

Merged
aaight merged 1 commit intodevfrom
feature/per-agent-engine-settings
Mar 15, 2026
Merged

feat(agent-configs): add per-agent engine settings to agent_configs table#878
aaight merged 1 commit intodevfrom
feature/per-agent-engine-settings

Conversation

@aaight
Copy link
Copy Markdown
Collaborator

@aaight aaight commented Mar 15, 2026

Summary

  • Adds agent_engine_settings JSONB column to agent_configs table via migration 0044_agent_config_engine_settings.sql
  • Updates Drizzle schema in agentConfigs.ts to include agentEngineSettings typed as EngineSettings
  • Updates createAgentConfig() and updateAgentConfig() to accept optional engineSettings parameter and persist as agentEngineSettings
  • Updates tRPC agentConfigsRouter create/update mutations to accept engineSettings with EngineSettingsSchema.nullish() validation
  • Adds agentEngineSettings field to AgentConfigRow interface in configMapper.ts
  • Updates buildAgentMaps() to return an engineSettings: Record<string, EngineSettings> map alongside models, iterations, and engines
  • Adds comprehensive unit tests for all changes

Test plan

  • agentConfigsRepository.test.ts — verify createAgentConfig and updateAgentConfig persist engineSettings
  • configMapper.test.ts — verify buildAgentMaps extracts engineSettings per agent type, skips null values
  • agentConfigs.test.ts (router) — verify tRPC create/update accept engineSettings, correctly pass through to repository
  • Full unit test suite (5083 tests) passes
  • TypeScript type check passes
  • Lint passes

Notes

Trello: https://trello.com/c/69b6cf7521608303df9c6adb

🤖 Generated with Claude Code

🕵️ claude-code · claude-sonnet-4-6 · run details

Copy link
Copy Markdown
Collaborator

@nhopeatall nhopeatall left a comment

Choose a reason for hiding this comment

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

Summary

LGTM — Clean, well-structured change that adds per-agent engine settings storage to the agent_configs table. The implementation correctly follows the existing pattern from projects.ts (same jsonb().$type<EngineSettings>() approach), and all layers (migration → schema → repository → router → tests) are consistent.

Key observations:

  • Migration is idempotent (ADD COLUMN IF NOT EXISTS)
  • Repository correctly maps the API-level engineSettings param to the DB-level agentEngineSettings column, and the conditional spread in updateAgentConfig prevents accidentally nullifying the column when engineSettings is not provided
  • buildAgentMaps() return type extension is non-breaking — existing callers destructure only what they need
  • mapProjectRow intentionally does not yet consume the per-agent engineSettings from buildAgentMaps (merge chain deferred to Story #5 per the card), which is reasonable
  • Tests cover the key correctness properties: explicit null pass-through, omission when not provided, and mapper extraction behavior

🕵️ claude-code · claude-opus-4-6 · run details

@aaight aaight merged commit 3166fdb into dev Mar 15, 2026
6 checks passed
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