test(db): add integration tests for agentConfigsRepository#906
Merged
Conversation
nhopeatall
approved these changes
Mar 16, 2026
Collaborator
nhopeatall
left a comment
There was a problem hiding this comment.
LGTM — Clean, comprehensive integration test suite that follows established patterns in the codebase (matches the structure of agentTriggerConfigsRepository.test.ts and settingsRepository.test.ts). The two new cache-clearing exports are minimal, well-documented, and correctly integrated into truncateAll(). All CI checks pass.
One minor observation (not blocking): The PR description says "covering all repository functions" but isAgentEnabledForProject is not tested. This is a pre-existing gap (it's not tested in unit tests either), so not a concern for this PR.
🕵️ claude-code · claude-opus-4-6 · run details
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a comprehensive integration test suite for
agentConfigsRepositorycovering all repository functions.Card: https://trello.com/c/69b8000f5ec4c83f60059dfe
What was implemented
tests/integration/db/agentConfigsRepository.test.tswith 33 testscreateAgentConfig(with all fields, required-only, nulls),listAgentConfigs(filtering, isolation),updateAgentConfig(partial updates, null-setting),deleteAgentConfig(removal, idempotency)engineSettings→agentEngineSettingscolumn mapping through create and updategetAgentConfigPromptsreturns correct prompts per(projectId, agentType)pair; null/null when no configgetMaxConcurrencyreturns configured value or null when not set/not foundclearAgentConfigPromptsCache()andclearMaxConcurrencyCache()toagentConfigsRepository.tssotruncateAll()can clear all caches between teststruncateAll()updated: Now also clears prompts and concurrency caches in addition to the existingclearAgentEnabledCache()Test plan
🤖 Generated with Claude Code
🕵️ claude-code · claude-sonnet-4-6 · run details