I3eka opened a new pull request, #44555:
URL: https://github.com/apache/superset/pull/44555

   ### SUMMARY
   
   Keep the selected AI profile with its conversation instead of silently 
replacing it with the browser's global preference or the default profile.
   
   This independently reproduces the [human review finding in 
#43133](https://github.com/apache/superset/pull/43133#discussion_r3995799995) 
and the [Copilot finding in 
#43237](https://github.com/apache/superset/pull/43237#discussion_r4002625715).
   
   - Resolve an omitted, null or empty key from the owned thread through the 
existing gated `ProfileRegistry`, before storing messages or dispatching work. 
Remember the resolved key on both the conversation and the run's assistant 
message.
   - Keep profile selections per tab. Reopening restores the server's profile, 
and the browser sends `agent_key` only for an explicit selection, including 
`default`. A later selection does not retarget an accepted run or get erased by 
its completion refresh.
   - Retain existing permitted-profile fallback behavior. If no profile is 
permitted/configured, reject before creating message rows.
   
   **Stack/dependencies:** this is a focused follow-up to the unmerged AI base 
#42805, not a standalone addition of Native AI. The shared 
`native-ai-base-compatibility` branch includes Apache master `9612437a9c` and 
the separately committed migration reconciliation. The profile-only delta is 
[these eleven files above the shared 
base](https://github.com/I3eka/superset/compare/dab76d93fc219d577aca4c316fd5b29588bd64ad...native-ai-thread-profile).
 The main GitHub diff still includes the unmerged prerequisite.
   
   This does **not** fix run idempotency, queue recovery, cancellation, 
page-context framing, model pinning, or authoring timeouts. It does not resolve 
the corresponding parent review threads or the SIP hold. @sadpandajoe, the 
regression covers both stored API profiles and reopened UI tabs from your 
finding.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   No visual redesign; the same selector keeps the correct state.
   
   | Action | Before | After |
   | --- | --- | --- |
   | Post without a key to an `analyst` conversation | Default profile | Stored 
permitted profile |
   | Explicitly select `default` | Browser omits the key | Explicit reset 
reaches the API |
   | Reopen or switch conversations | Global browser selection | Each 
conversation's stored profile |
   
   ### TESTING INSTRUCTIONS
   
   - **726 backend checks pass:** the entire AI unit suite plus the actual 
Alembic single-head test. Thirty profile cases cover creation through the HTTP 
API, ownership, omitted/null/empty/explicit keys, removed/denied profiles, no 
available profile, remembered selection, and immutable per-run snapshots in 
both inline and worker configurations.
   - **152 frontend tests / twelve suites pass:** all AI and shared-chat tests. 
Regressions cover reopening, switching tabs, unsent choices during a running 
turn, resolved fallback, new conversations, and omitted versus explicit keys on 
the wire.
   - All applicable pre-commit hooks over the complete PR delta pass, including 
mypy and frontend type checking.
   - Independent red controls: the unmodified backend fails the profile cases 
after isolating event logging; restoring only the old request-key omission 
fails the explicit-default wire test while omitted/analyst controls pass.
   - API tests use isolated SQLite and the real routes/DAO/registry, but stub 
route authentication/current-user identity, logging and execution delivery. 
Frontend transport is mocked. No claim of real broker delivery, an external LLM 
run or live-browser deployment validation.
   - The new master migration conflict was reproduced with the real single-head 
test before the shared no-op join. The resulting graph has one head. A complete 
database upgrade/downgrade cycle is **not** claimed.
   
   Manual checks with `AI_ASSISTANT` enabled:
   
   1. Create an `analyst` conversation, submit a message without `agent_key`, 
and verify the returned thread and stored assistant extra both identify 
`analyst`.
   2. Explicitly choose the default profile, send another message, reopen the 
conversation, and confirm the selector and stored profile remain default.
   3. Switch between two conversations with different profiles. While one runs, 
choose a profile for its next turn and switch away; completion must not change 
the other tab or discard that unsent choice.
   
   No deployment, live database migration, configuration change or warehouse 
query was performed. Remote CI is separate from the local results above.
   
   ### ADDITIONAL INFORMATION
   
   - [x] Has associated issue: the two inline review findings linked above
   - [x] Required feature flags: `AI_ASSISTANT` from #42805
   - [x] Changes UI: profile selection state only
   - [x] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351)): inherited AI schema 
plus shared no-op joins; no profile-specific migration
     - [x] Migration is atomic, supports rollback & is backwards-compatible: 
the new shared join has no schema/data operations and preserves published 
revisions
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [x] Runtime estimates and downtime expectations provided: the new join 
performs only Alembic revision bookkeeping, with no data scan or schema 
operation; no deployment performed
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to