Skip to content

Troubleshoot with the help of AI - #8428

Merged
marcelveldt merged 3 commits into
devfrom
ai-troubleshooter
Dec 2, 2026
Merged

marcelveldt merged 3 commits into
devfrom
ai-troubleshooter

Conversation

@marcelveldt

@marcelveldt marcelveldt commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

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

  • New "Troubleshoot with the help of AI" card on the problem step of players and providers, and on "Something else", only when a default AI engine is set up
  • One step to describe the problem, which names the AI engine it goes to
  • The AI only gets the switches, numbers and fixed choices of that player or provider, its status and recent errors, never free text, passwords, or the names of players and accounts
  • Suggested settings are only offered when they are real settings with a value they take, and you confirm them in the usual change step
  • The report gets your own description and the AI analysis, for the What happened? and AI analysis fields of the bug form
  • New get_recent_exceptions on the diagnostics controller, sanitized

Types of changes

  • 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
  • Maintenance / chore — maintenance
  • CI / workflow change — ci
  • Dependencies bump — dependencies

Checklist

@marcelveldt
marcelveldt marked this pull request as draft December 2, 2026 13:19
@marcelveldt

Copy link
Copy Markdown
Member Author

@Bot-MArley review

@Bot-MArley Bot-MArley left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. [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_players and the unfiltered provider configs here.

@marcelveldt marcelveldt changed the title Ask your AI engine about a problem in the troubleshooter Troubleshoot with the help of AI Dec 2, 2026
@marcelveldt

Copy link
Copy Markdown
Member Author

@Bot-MArley review again

@Bot-MArley Bot-MArley left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  1. [PROBLEM] Host names stay in the recent errors and the provider error: sanitize_text redacts IPs, e-mails and URL credentials, but not hosts, so an error like Cannot connect to host jellyfin.example.net:8096 or a ClientResponseError URL 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_names replaces, or change the note.
  2. [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 describe and not_listed.

@marcelveldt

Copy link
Copy Markdown
Member Author

@Bot-MArley recheck

@Bot-MArley

Copy link
Copy Markdown
Collaborator

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:

  1. Fixed: host names in errors. _get_personal_names now adds the hosts of the providers' URL and host settings as <host> (ai.py#L523-L526), and the recent errors and provider details are redacted with it. The test covers it.
  2. Fixed: "Something else". With an AI engine set up, the user now picks between the AI path and a plain report (init.py#L211), and the plain report sends nothing to the engine. The test covers it too.

Nothing from the earlier review is still open.

@marcelveldt

Copy link
Copy Markdown
Member Author

Lab gate: lab run --ref pr/8428 --areas core (run 20261202-150240-4523) green, 1/1 passed. The diff only maps to core in pr-gate.md.

@marcelveldt
marcelveldt marked this pull request as ready for review December 2, 2026 15:32
@marcelveldt

Copy link
Copy Markdown
Member Author

@Bot-MArley approve

@Bot-MArley

Copy link
Copy Markdown
Collaborator

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 merge. After a new push, ask again.

@Bot-MArley Bot-MArley left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@marcelveldt
marcelveldt added this pull request to the merge queue Dec 2, 2026
Merged via the queue into dev with commit 286f410 Dec 2, 2026
24 checks passed
@marcelveldt
marcelveldt deleted the ai-troubleshooter branch December 2, 2026 16:01
gegere pushed a commit to gegere/server that referenced this pull request Dec 2, 2026
…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.
OzGav added a commit to music-assistant/music-assistant.io that referenced this pull request Dec 4, 2026
## 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants