Move saved Agents into the agents domain and agentpg adapter - #315
Merged
Merged
Conversation
agents owns the saved Agent rules: configuration normalization and bounds, update merging over the locked Agent, metadata and the model provider bundle checks. agentpg persists them on pgunit, seals the bundle, records write audit in the same transaction and translates database outcomes into the domain errors. api reaches Agents through the Agents service and the AgentsReader, and cmd/server wires both. The store Agent code and its tests move to the new owners.
This was referenced Sep 30, 2026
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.
Part of #1 (store layering), PR 10. Moves saved Agents out of store into the
agentsdomain and itsagentpgadapter.internal/agents:Service(Create/Update/Delete) owns the rules:harness_configresetStorageupdates in the Load → Decide → Apply shape (WithAgentUpdate).Readerserves the reads. The domain imports no persistence.persistence/postgres/agentpg:pgunit.PathID.api:
AgentsandAgentsReaderdependencies,writeAgentsErrorand strict fakes./core/v1list and delete use the same operations as/v1.Deleted from store:
agents.go,agents_delete.go,agents_list.go,agents_update.go,agent_model_execution.goand their tests. The sqlc queryGetAgentForSessionis renamedGetAgentWithModelExecution.Pinned
/v1behaviour is unchanged:make openapishows no diff and the official-client tests pass. Internally:Checks
go build ./...,go vet,check-names.py,check-sqlc.py,make openapicmd/...Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.