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

   ### SUMMARY
   
   Honor the configured concrete model selected for an AI turn, instead of 
recording that model while actually running the profile's tier.
   
   `TurnRequest.model` reached persistence and telemetry but not `RunRequest` 
or `CompletionRequest`. A profile's existing `model` pin was also ignored. Pass 
the pin through these existing request contracts and let the provider's 
existing `select_model` validation handle it. Selection is per-turn pin, then 
profile pin, then profile tier. With no pin, providers still receive the tier 
rather than a prematurely resolved model. Failed model-call traces also retain 
the requested pin when the provider cannot report a model.
   
   Depends on #42805 at `0e4a15cca1c5be2b7e68d609a9062f5e51193024`. This draft 
intentionally inherits that unmerged AI base: the full comparison with Apache 
master contains the base implementation. The focused fix is [one five-file 
commit](https://github.com/I3eka/superset/commit/0737d000a41508d507087b097b730178b3132338).
 No provider configuration, deployment settings, credentials, or unrelated 
lifecycle changes are included.
   
   @sadpandajoe, this isolates the model mismatch you identified in 
[#43134](https://github.com/apache/superset/pull/43134#discussion_r3995932002) 
and 
[#43135](https://github.com/apache/superset/pull/43135#discussion_r3996016684). 
It is a shared base fix rather than separate implementations in each follow-up. 
Their threads remain open until they inherit it; this does not bypass the 
SIP/base dependency hold.
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   
   No UI change. Before: selecting one configured model could invoke another 
model while the saved metadata named the selection. After: the selected pin 
reaches every provider round trip, including tool follow-ups; unknown pins fail 
instead of silently running the tier model.
   
   ### TESTING INSTRUCTIONS
   
   - `pytest -q tests/unit_tests/ai`: 714 passed, without network calls or 
model credentials.
   - Twenty orchestration regressions exercise the real runtime and 
deterministic provider across inline/worker entry points and 
streaming/non-streaming providers. They cover turn/profile precedence, tier 
fallback, two model round trips, saved metadata, telemetry, and rejection of 
unknown models.
   - Before the request-propagation fix, 16 cases failed and only the four 
no-pin cases passed. The additional failed-call trace assertion failed in all 
four unknown-model cases before its fallback fix.
   - All applicable changed-file pre-commit checks pass, including mypy, Ruff, 
pylint, and formatting.
   - Required `pre-commit run --all-files` completed in an isolated checkout. 
Both mypy hooks, pylint, custom rules, stylelint, metadata/feature-flag 
validation, and workflow security checks pass. The full check still fails 
inherited formatting/lint findings, docs lint without Yarn, Helm docs without 
its executable, and frontend typing against missing/out-of-date generated 
declarations. None of the five changed files was modified by this full run; 
unrelated auto-fixes remain outside this PR.
   
   Manual check: configure two distinct offered models and a profile using a 
different tier. Submit a turn selecting one concrete model and verify the 
outbound provider model and saved message metadata agree, including after a 
tool call. Repeat without a turn pin using a profile pin, then with no pins 
using the profile tier. An unconfigured model must fail rather than run a 
different model.
   
   ### ADDITIONAL INFORMATION
   
   - [ ] Has associated issue:
   - [x] Required feature flags: `AI_ASSISTANT`
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] 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