Skip to content

NOJIRA-Insight-ai-multi-config - #1143

Merged
pchero merged 1 commit into
mainfrom
NOJIRA-Insight-ai-multi-config
Jul 29, 2026
Merged

NOJIRA-Insight-ai-multi-config#1143
pchero merged 1 commit into
mainfrom
NOJIRA-Insight-ai-multi-config

Conversation

@pchero

@pchero pchero commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Allow customers to have multiple Insight AI configurations while keeping exactly one active at a time, replacing the same-day-merged SQUARE-23 constraint that allowed only one insight AI per customer. AICall Test continues to work against any Insight AI regardless of activation status, since it already targets a specific assistant id directly.

  • bin-dbscheme-manager: Add is_insight_active column and redefine the SQUARE-23 generated-column unique index to key on active status instead of a hard one-per-customer cap
  • bin-ai-manager: Add IsInsightActive to the AI model, filters, and webhook; add transactional AIActivateInsight with dual-row cache refresh and ai_updated events for both the activated and deactivated rows; unconditionally clear the flag on delete and on type change away from insight; remove the now-unreachable AI_INSIGHT_ALREADY_EXISTS translation from Create/Update
  • bin-openapi-manager: Add POST /ais/{id}/activate_insight and the is_insight_active field to the AI schema
  • bin-common-handler: Add the AIV1AIActivateInsight RPC client method
  • bin-api-manager: Add the activation endpoint with a customer-ownership check, and switch the Case Insight Assistant panel's resolution to prefer the active Insight AI before falling back to most-recently created
  • bin-api-manager: Update RST docs for the new endpoint and field

Design and implementation plan: docs/plans/2026-07-29-insight-ai-multi-config-design.md, docs/plans/2026-07-29-insight-ai-multi-config-plan.md (5 rounds of design review, 3 rounds of plan review, 3 rounds of code review, all closing on 2 consecutive approvals).

Companion frontend PR: square-admin UI for the same feature, opened separately in monorepo-javascript.

Known accepted gap: AIActivateInsight's SELECT ... FOR UPDATE cannot run against the SQLite test driver, so the swap/idempotency/cross-customer-isolation dbhandler tests are skip-gated (same precedent as AIAcceptProposal's existing tests). Closing this requires MySQL-backed test infrastructure.

Allow customers to have multiple Insight AI configurations while keeping
exactly one active at a time, and let AICall Test target any of them
regardless of activation status.

- bin-dbscheme-manager: Add is_insight_active column and redefine the
  SQUARE-23 generated-column unique index to key on active status instead
  of a hard one-per-customer cap
- bin-ai-manager: Add IsInsightActive to the AI model, filters, and
  webhook; add transactional AIActivateInsight with dual-row cache
  refresh and ai_updated events for both the activated and deactivated
  rows; unconditionally clear the flag on delete and on type change away
  from insight; remove the now-unreachable AI_INSIGHT_ALREADY_EXISTS
  translation from Create/Update
- bin-openapi-manager: Add POST /ais/{id}/activate_insight and the
  is_insight_active field to the AI schema
- bin-common-handler: Add the AIV1AIActivateInsight RPC client method
- bin-api-manager: Add the activation endpoint with a customer-ownership
  check, and switch the Case Insight Assistant panel's resolution to
  prefer the active Insight AI before falling back to most-recently
  created
- bin-api-manager: Update RST docs for the new endpoint and field
@pchero
pchero merged commit 937746b into main Jul 29, 2026
3 of 4 checks passed
@pchero
pchero deleted the NOJIRA-Insight-ai-multi-config branch July 29, 2026 10:50
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.

1 participant