fix(agents): make SQL store signatures content-sensitive - #4709
Open
AoHanBei wants to merge 1 commit into
Open
Conversation
AoHanBei
marked this pull request as ready for review
August 6, 2026 09:40
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.
Fixes #4706
Why
SqlAgentStore.signature()usedmax(updated_at)plus the row count as its cache invalidation token.When an agent update reused the current maximum timestamp, neither part of that token changed even though the stored agent configuration had changed. The GitHub agent registry could therefore continue using stale webhook routing until another mutation or process restart invalidated the cache.
What changed
This requires no database migration and does not change the public API or the file-backed agent store.
Surface area
frontend/backend/applanggraph.json, or prompt changedocker/or sandboxed executionskills/backend/pyproject.tomlorfrontend/package.json(say what it buys us)Screenshots / Recording
Not applicable — this is a backend cache-invalidation fix with no UI changes.
Bug fix verification
backend/tests/test_agent_store_sql.py::test_signature_changes_when_update_reuses_timestampmainand green on this branch? YesValidation
uv run pytest tests/test_agent_store_sql.py tests/test_github_registry.py -q --tb=short -p no:cacheprovider— 32 passeduv run ruff check packages/harness/deerflow/persistence/agents/sql.py packages/harness/deerflow/persistence/agents/base.py app/gateway/github/registry.py tests/test_agent_store_sql.py— passeduv run ruff format --check packages/harness/deerflow/persistence/agents/sql.py packages/harness/deerflow/persistence/agents/base.py app/gateway/github/registry.py tests/test_agent_store_sql.py— 4 files already formattedAI assistance
Tool(s) used: Codex
How you used it: Codex helped investigate the cache-invalidation bug, implement the deterministic regression test and content-sensitive signature, update the relevant documentation, and review the final diff. I ran and verified the reported tests and checks locally.