NOJIRA-Insight-ai-multi-config - #1143
Merged
Merged
Conversation
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
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.
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.
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.