Repository navigation
Troubleshoot with the help of AI - #8428
Conversation
|
@Bot-MArley review |
Bot-MArley
left a comment
There was a problem hiding this comment.
Note
This comment was written by Claude and posted by Bot-MArley on behalf of the Music Assistant maintainers.
Thanks @marcelveldt! This adds a "describe it in your own words" path to the troubleshooter: with a default AI engine set up, the user describes the problem, sees the exact prompt and the engine it goes to, and can then apply validated setting suggestions or report the problem with the description and the AI analysis attached. The design holds up well: only switches, numbers and translated fixed choices go into the prompt, errors are sanitized, suggestions are checked against the settings that were sent, and the tests cover the flow end to end. One gap in the name redaction is left, below.
Requested changes
- [PROBLEM] The personal names to redact are collected with caller-filtered lookups, so for a non-admin user the names of players and music sources they may not see stay in the prompt when a logged error mentions them (ai.py#L503, ai.py#L510). Use
iter_playersand the unfiltered provider configs here.
7f12ced to
be7c4e6
Compare
|
@Bot-MArley review again |
Bot-MArley
left a comment
There was a problem hiding this comment.
Note
This comment was written by Claude and posted by Bot-MArley on behalf of the Music Assistant maintainers.
Thanks @marcelveldt! This adds "Troubleshoot with the help of AI" to the troubleshooter: with a default AI engine set up, the user describes the problem for a player, a provider or "Something else", and gets an answer, checked setting suggestions to apply, or a report with their description and the AI analysis. The earlier redaction gap is fixed: the names now come from iter_players and the stored provider configs, without the caller filter. Two points are left, both about what reaches the engine.
Requested changes
- [PROBLEM] Host names stay in the recent errors and the provider error:
sanitize_textredacts IPs, e-mails and URL credentials, but not hosts, so an error likeCannot connect to host jellyfin.example.net:8096or aClientResponseErrorURL goes to the engine as is, while the note on the describe step says no addresses are sent (ai.py#L468-L480). Add the hosts of the URL and host settings of the providers to the names_get_personal_namesreplaces, or change the note. - [PROBLEM] With an AI engine set up, "Something else" goes straight to the describe step, so the user can no longer report such a problem without sending the description to the engine, which can run in the cloud (init.py#L211). Offer the AI path next to a plain report there, as the player and provider steps do with
describeandnot_listed.
|
@Bot-MArley recheck |
|
Note This comment was written by Claude and posted by Bot-MArley on behalf of the Music Assistant maintainers. Thanks @marcelveldt! Checked the two requested changes against the current head:
Nothing from the earlier review is still open. |
|
Lab gate: |
|
@Bot-MArley approve |
|
Note This comment was posted by Bot-MArley on behalf of the Music Assistant maintainers. @marcelveldt Noted for 826f798: I'll approve it in a few minutes if my review of this commit is clean, and review it first if I haven't. Dependency changes and new providers still need a maintainer's approval. To have it merged, say |
Bot-MArley
left a comment
There was a problem hiding this comment.
Note
This comment was written by Claude and posted by Bot-MArley on behalf of the Music Assistant maintainers.
Thanks @marcelveldt, looks good to me 🙌 Approved at @marcelveldt's request: this covers the changes since the last review. Both requested changes are fixed (host names are masked in what goes to the AI engine, and "Something else" offers a plain report that sends nothing to the engine), and the review found no new issues.
…ic-assistant#8442) # What does this implement/fix? The AI troubleshooter only offers a setting the AI suggests when it can be changed there and is not set like that already. The answer could still tell you to set it, while the "Change the settings it suggests" choice was missing without saying why. - A short note below the answer when some suggested settings are left out: "Some settings it suggests are set like that already, or can not be changed here." - The prompt asks the AI for values that differ from the current ones. **Related issue (if applicable):** - follow-up of music-assistant#8428 ## Types of changes <!-- Tick exactly one box. CI (.github/workflows/pr-labels.yaml) derives the label from the ticked box and applies it automatically; the release-notes generator uses that same label to slot this change into the next release notes. --> - [ ] Bugfix (non-breaking change which fixes an issue) — `bugfix` - [ ] New feature (non-breaking change which adds functionality) — `new-feature` - [ ] Enhancement to an existing feature — `enhancement` - [ ] New music/player/metadata/plugin provider — `new-provider` - [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) — `breaking-change` - [ ] Refactor (no behaviour change) — `refactor` - [ ] Documentation only — `documentation` - [x] Maintenance / chore — `maintenance` - [ ] CI / workflow change — `ci` - [ ] Dependencies bump — `dependencies` ## Checklist - [x] The code change is tested and works locally. - [x] `pre-commit run --all-files` passes. - [x] `pytest` passes, and tests have been added/updated under `tests/` where applicable. - [ ] For changes to shared models, the companion PR in `music-assistant/models` is linked. - [ ] For changes affecting the UI, the companion PR in `music-assistant/frontend` is linked. - [x] I have read and complied with the project's [AI Policy](https://github.com/music-assistant/.github/blob/main/AI_POLICY.md) for any AI-assisted contributions. - [ ] I have [raised a PR against the documentation repository](https://github.com/music-assistant/music-assistant.io/blob/main/CONTRIBUTING.md) targeting the main or beta branch as appropriate.
## What does this change? Describes the troubleshooter: where to open it, what it offers for players and for music sources and plugins, and how it helps report a problem. With an AI engine it also offers Troubleshoot with the help of AI, so the page says when that is offered, what the AI engine gets and what ends up in the report. It is the first section of Troubleshooting, and the FAQ sections on players, music sources, missing media and reporting point to it, as do the player, music source and player support settings pages. Server: music-assistant/server#8410, music-assistant/server#8420, music-assistant/server#8428; frontend: music-assistant/frontend#3389, music-assistant/frontend#3394, music-assistant/frontend#3397; models: music-assistant/models#505 ## Checklist - [x] Correct branch: `main` if this fixes something already on the live site, `beta` if it adds anything new - [ ] Any new page has a sidebar entry in `astro.config.mjs`, except music sources and player providers (n/a, no new page) ### Only if you are adding a music source or a player provider - [ ] File named after the source or provider, since the menu is sorted by filename - [ ] Icon added to `public/assets/icons/`, and it is visible against a white background - [ ] Entry added to `src/data/music-sources.ts` or `src/data/players.ts`, with categories
What does this implement/fix?
When an AI engine is connected, the troubleshooter offers "Troubleshoot with the help of AI" for each player and music source, and on "Something else". You describe the problem in your own words, and the step tells you which AI engine it goes to. The answer explains what is likely going on and can suggest settings, which you check before anything is saved, or you report the problem with your description and the answer attached.
Changes
What happened?andAI analysisfields of the bug formget_recent_exceptionson the diagnostics controller, sanitizedTypes of changes
bugfixnew-featureenhancementnew-providerbreaking-changerefactordocumentationmaintenancecidependenciesChecklist
pre-commit run --all-filespasses.pytestpasses, and tests have been added/updated undertests/where applicable.music-assistant/modelsis linked. (Document the multiline format of a string config entry models#505)music-assistant/frontendis linked. (Describe a problem in your own words in the troubleshooter frontend#3397)