Skip to content

Conversation

@bokelley
Copy link
Contributor

Overview

This PR adds signals agent integration to enable tenant-managed signals discovery agents for enhanced product recommendations.

What's New

Database Schema

  • New signals_agents table for tenant-specific agent configurations
  • Agents have name, URL, auth settings, priority, and feature flags

Registry Pattern

  • SignalsAgentRegistry for centralized agent management (like creative agents)
  • Load-on-demand from database with caching
  • Priority-based agent selection

Admin UI

  • Add/edit/delete signals agents via admin interface
  • Test agent connectivity before saving
  • Configure per-agent settings (timeout, max products, fallback behavior)
  • New section in tenant settings: "Manage Signals Agents"

Provider Updates

  • SignalsDiscoveryProvider now uses registry instead of tenant config
  • Queries all enabled agents by priority
  • Combines results from multiple signals sources

Testing

  • Integration tests for signals agent workflow
  • Provider integration tests
  • Template validation fixes for agent UI routes

Migration

  • Adds signals_agents table
  • Merge migration resolves multiple heads

Use Case

Tenants can now:

  1. Register multiple signals agents (e.g., AXE signals, first-party data platforms)
  2. Configure priority and fallback behavior
  3. Get enhanced product recommendations with contextual signals
  4. Test agent connectivity before going live

Related

  • Part 1 of 2: Signals agent management (this PR)
  • Part 2 (separate PR): Signals-backed dynamic products

Testing

# Run integration tests
pytest tests/integration_v2/test_signals_agent_workflow.py
pytest tests/integration_v2/test_signals_discovery_integration.py

@bokelley bokelley force-pushed the bokelley/signals-agent-registry branch 2 times, most recently from dcf4b2c to 0d414a4 Compare October 29, 2025 11:23
Add comprehensive signals agent management system with registry pattern,
unified MCP client utility, and admin UI for managing tenant-specific
signals agents.

Key Features:
- SignalsAgent database model and registry for centralized agent management
- Unified MCP client utility (src/core/utils/mcp_client.py) for consistent
  agent communication across creative agents, signals agents, etc.
- Admin UI for adding/editing/deleting/testing signals agents
- Migrate product catalog provider to use agent registry
- Fix creative agent registry to use correct /mcp path suffix

Architecture:
- SignalsAgentRegistry pattern (mirrors CreativeAgentRegistry)
- Unified MCP client with retry logic, auth handling, error handling
- Database-backed agent configuration per tenant
- Admin UI templates for agent management

Database Changes:
- Add signals_agents table with proper indexes and foreign keys
- Merge migrations to resolve multiple heads
- Remove deprecated brand manifest policy fields

Testing:
- Add integration tests for signals agent workflow
- Add MCP client utility tests
- Update signals discovery provider integration tests
- Skip MCP server tests in CI (require local server)

Fixes:
- Fix creative agent default URL (add /mcp suffix)
- Fix migration script to use 'heads' instead of 'head'
- Update signals agent workflow tests to use unified MCP client
- Remove deprecated signals provider tests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@bokelley bokelley force-pushed the bokelley/signals-agent-registry branch from 0d414a4 to 167518f Compare October 29, 2025 11:25
@bokelley bokelley merged commit 9a15431 into main Oct 29, 2025
9 checks passed
@bokelley bokelley deleted the bokelley/signals-agent-registry branch October 29, 2025 11:55
bokelley added a commit that referenced this pull request Oct 29, 2025
…agent

Production database has brand manifest policy migrations (378299ad502f,
6f05f4179c33) in its alembic_version table. These were accidentally deleted
in PR #621, causing deployment failure:

  ❌ Error running migrations: Can't locate revision identified by '378299ad502f'

Solution:
1. Restored deleted migrations from before PR #621
2. Created merge migration (c34b078f4e8a) to combine:
   - Brand manifest branch (378299ad502f)
   - Signals agent branch (fa617dd8b051)

Why migrations can't be deleted:
Alembic requires ALL historical migrations to exist in the codebase to
determine the current database schema state, even if the feature was
removed or updated. The migration files are part of the schema history.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
bokelley added a commit that referenced this pull request Oct 29, 2025
Resolved merge conflicts and fixed mypy errors from incoming changes:
- pyproject.toml: Kept both types-pytz (mypy) and restored commitizen (changelog)
- product_catalog_providers/signals.py: Accepted main's registry pattern + fixed mypy errors
- src/core/creative_agent_registry.py: Accepted main's unified MCP client + fixed mypy errors
- src/core/signals_agent_registry.py: Fixed new mypy errors (dict type annotations)
- src/core/utils/mcp_client.py: Fixed mypy error (headers type annotation)
- uv.lock: Regenerated from merged dependencies

Merged changes from main:
- Added signals agent registry with unified MCP client (#621)
- Updated creative agent registry to use unified MCP client
- Added signals_agents table and admin UI
- Added MCP client utility for standardized connection handling
- Removed commitizen workflows/config files (kept dependency for changelog generation)

Mypy fixes for new code from main branch:
- Added type annotations for dict variables (params, headers, signals_by_category)
- Added missing optional fields to Product and PricingOption schemas
- All mypy errors fixed, maintaining 100% type safety
bokelley added a commit that referenced this pull request Oct 29, 2025
The signals agent PR (#621) accidentally deleted commitizen files when
the branch was squashed. These files are needed for automated version
management and changelog generation.

Restored files:
- .cz-config.md (commitizen configuration)
- .github/workflows/commitizen-check.yml (CI workflow)
- CHANGELOG.md (version history)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
danf-newton pushed a commit to Newton-Research-Inc/salesagent that referenced this pull request Nov 24, 2025
…otocol#621)

Add comprehensive signals agent management system with registry pattern,
unified MCP client utility, and admin UI for managing tenant-specific
signals agents.

Key Features:
- SignalsAgent database model and registry for centralized agent management
- Unified MCP client utility (src/core/utils/mcp_client.py) for consistent
  agent communication across creative agents, signals agents, etc.
- Admin UI for adding/editing/deleting/testing signals agents
- Migrate product catalog provider to use agent registry
- Fix creative agent registry to use correct /mcp path suffix

Architecture:
- SignalsAgentRegistry pattern (mirrors CreativeAgentRegistry)
- Unified MCP client with retry logic, auth handling, error handling
- Database-backed agent configuration per tenant
- Admin UI templates for agent management

Database Changes:
- Add signals_agents table with proper indexes and foreign keys
- Merge migrations to resolve multiple heads
- Remove deprecated brand manifest policy fields

Testing:
- Add integration tests for signals agent workflow
- Add MCP client utility tests
- Update signals discovery provider integration tests
- Skip MCP server tests in CI (require local server)

Fixes:
- Fix creative agent default URL (add /mcp suffix)
- Fix migration script to use 'heads' instead of 'head'
- Update signals agent workflow tests to use unified MCP client
- Remove deprecated signals provider tests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude <noreply@anthropic.com>
danf-newton pushed a commit to Newton-Research-Inc/salesagent that referenced this pull request Nov 24, 2025
…agent

Production database has brand manifest policy migrations (378299ad502f,
6f05f4179c33) in its alembic_version table. These were accidentally deleted
in PR adcontextprotocol#621, causing deployment failure:

  ❌ Error running migrations: Can't locate revision identified by '378299ad502f'

Solution:
1. Restored deleted migrations from before PR adcontextprotocol#621
2. Created merge migration (c34b078f4e8a) to combine:
   - Brand manifest branch (378299ad502f)
   - Signals agent branch (fa617dd8b051)

Why migrations can't be deleted:
Alembic requires ALL historical migrations to exist in the codebase to
determine the current database schema state, even if the feature was
removed or updated. The migration files are part of the schema history.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
danf-newton pushed a commit to Newton-Research-Inc/salesagent that referenced this pull request Nov 24, 2025
The signals agent PR (adcontextprotocol#621) accidentally deleted commitizen files when
the branch was squashed. These files are needed for automated version
management and changelog generation.

Restored files:
- .cz-config.md (commitizen configuration)
- .github/workflows/commitizen-check.yml (CI workflow)
- CHANGELOG.md (version history)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
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