Skip to content

Stage D part 5: AI Models and Agents & Actions - #1314

Merged
Paul Lizer (paullizer) merged 1 commit into
feature/admin-settings-iafrom
admin-ia-stage-d5
Aug 19, 2026
Merged

Stage D part 5: AI Models and Agents & Actions#1314
Paul Lizer (paullizer) merged 1 commit into
feature/admin-settings-iafrom
admin-ia-stage-d5

Conversation

@paullizer

Copy link
Copy Markdown
Contributor

Fifth batch of Stage D. The last two catch-all tabs: AI Models and Agents & Actions. Both needed modal surgery rather than plain card moves, which is why they were held back from #1313.

Base: feature/admin-settings-ia.

AI Models

Tab Contents
Model Endpoints endpoint and fallback configuration, plus the legacy model settings dialog that holds the Chat Model card and is opened from it
Embeddings embeddings configuration
Image Generation image generation configuration

Agents & Actions

Tab Contents
Agents agents configuration, agent template approvals
Actions document action capabilities, actions configuration
Inbound MCP inbound MCP configuration and its three dialogs

Navigation is now 14 groups / 40 tabs / 88 sections.

Three splitting problems, and how each was solved

1. gpt-configuration is not a top-level card. It lives inside legacyModelSettingsModal. Naively splitting would have torn the card out of the dialog.

Solved by relocating the modal to sit directly after multi-endpoint-configuration — the card holding its trigger — then assigning both to the same tab. The modal's opening lines, the nested card and the closing lines all landed in model-endpoints.html in order, and it reassembled intact. Verified div-balanced with the nested card still inside.

2. A dialog shared across three tabs. legacyModelDiscoveryIdentityGuideModal (the Azure OpenAI Model Setup Guide) is opened from the endpoints, embeddings and image generation cards. Once those became three tabs, the dialog could only have opened from whichever tab it landed in — an inactive pane is hidden.

It moved to the shell, outside every pane. Checked first that it carries no name= attribute, since moving a form field outside the <form> would silently change the save payload. It carries none.

3. A Jinja conditional spanning a card and its modals. The inbound MCP block is {% if mcp_ui_enabled %}{% endif %} wrapping the card and three dialogs. It was lifted out whole into its own pane rather than split.

Tab-level conditions

The nav map now supports condition on a tab, not just a section, so a tab whose entire pane sits behind a feature flag disappears instead of rendering an empty tab. Both the sidebar and the tab strip honour it.

Verified by rendering: 40 tabs with mcp_ui_enabled, 39 without.

Housekeeping

Removed seven dangling section comments left at the tail of panes, each labelling a card that had moved to another tab (for example embeddings.html ended with <!-- Image Generation Configuration Section -->).

Two tests corrected

Both asserted document order that only meant something while everything shared one tab:

  • test_ai_models_tab_embedding_image_location compared string indexes against the legacy modal. It now balances the modal's markup and asserts the cards are not inside it — which is what the test was actually for.
  • test_admin_document_action_capabilities_location asserted the card sits before agents-configuration. That card is now in a different tab, so it asserts against the Actions tab it actually leads.

No settings changed

Not one name= attribute was touched.

Check Result
Field contract 462 names / 110 card ids, byte-identical
Regression set (75 files) 32 failures, identical set to baseline
Jinja compile 42/42 admin templates
XSS sinks pass
Modal placement all modals reachable from their triggers, all ids unique

Next

Only Backup & Recovery is left in Stage D, and it is the hardest — complication I4, a ~985-line migration workflow that must split across Backup / Migrate / Restore / Jobs as one unit. Then Stage E splits system-settings-section and mirrors the role toggles.

The last two catch-all tabs. Both needed modal surgery rather than
plain card moves, which is why they were held back.

AI Models
  Model Endpoints    multi-endpoint-configuration, and the legacy
                     model settings modal that holds the Chat Model
                     card and is opened from it
  Embeddings         embeddings-configuration
  Image Generation   image-generation-configuration

Agents & Actions
  Agents        agents-configuration, agent-template-approvals-section
  Actions       document-action-capabilities-card, actions-configuration
  Inbound MCP   inbound-mcp-configuration and its three dialogs

Navigation is now 14 groups / 40 tabs / 88 sections.

Three splitting problems, and how each was solved

  gpt-configuration is not a top-level card. It lives inside
  legacyModelSettingsModal. The modal was relocated to sit directly
  after multi-endpoint-configuration, the card holding its trigger,
  and both were then assigned to the same tab so the modal's opening
  lines, the nested card and the closing lines landed together and it
  reassembled intact.

  legacyModelDiscoveryIdentityGuideModal is opened from endpoints,
  embeddings and image generation, which now sit in three different
  tabs, so it could only ever have opened from one of them. It moved
  to the shell, outside every pane. Checked first that it carries no
  name= attribute, since moving a field outside the form would change
  the save payload. It carries none.

  The inbound MCP block is a {% if mcp_ui_enabled %} conditional
  spanning a card and three modals. It was lifted out whole into its
  own pane rather than split.

Tab-level conditions

  The nav map now supports condition on a tab, not just a section, so
  a tab whose entire pane is behind a feature flag disappears instead
  of rendering empty. Both renderers honour it.
  Verified: 40 tabs with mcp_ui_enabled, 39 without.

Also removed seven dangling section comments left at the tail of panes,
each labelling a card that had moved to another tab.

Two location tests asserted document order that only meant something
while everything shared one tab. They now assert the real invariant:
the embeddings and image cards are not inside the legacy modal, and
the document action card leads the tab it actually lives in.

Verified
  field contract   462 names / 110 card ids, unchanged
  regression set   32 failures, identical to baseline
  jinja compile    42/42 admin templates
  xss sinks        pass
  modal placement  all modals reachable, all ids unique

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@paullizer
Paul Lizer (paullizer) merged commit 434f574 into feature/admin-settings-ia Aug 19, 2026
11 checks passed
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