Skip to content

Show source chains in user warnings - #952

Closed
zaniebot wants to merge 3 commits into
mainfrom
zb/warn-user-with-chain
Closed

zaniebot wants to merge 3 commits into
mainfrom
zb/warn-user-with-chain

Conversation

@zaniebot

@zaniebot zaniebot commented Sep 1, 2026 •

Copy link
Copy Markdown
Collaborator

Several recoverable warnings print only the outer error, hiding TOML diagnostics, interpreter query failures, TLS identity errors, and native keyring failure details. The managed-Python download fallback also bypasses warning suppression and still prints with --quiet.

Add warn_user_with_chain! and warn_user_once_with_chain! around the existing chain renderer, with optional hints and lazy argument evaluation. Use them for Python discovery and pinning, client certificates, project and tool lock validation, and native keyring fallback. The once-only variant deduplicates the complete rendered chain and hints so distinct causes remain visible. The managed-Python fallback now respects warning suppression without changing fatal diagnostics.

Follow-up to the review discussion in astral-sh/uv#21416. The API supports attaching script-specific context without flattening the error; workspace-list adoption remains separate.

@astral-automations-bot astral-automations-bot Bot added the area:error-messages Messaging when something goes wrong label Sep 1, 2026
@zaniebot zaniebot changed the title Add warn_user_with_chain! for structured warnings Show source chains in user warnings Sep 1, 2026
warning: Ignoring invalid `SSL_CLIENT_CERT`
Caused by: builder error
Caused by: unexpected error: private key or certificate not found
× No solution found when resolving dependencies:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good reminder we should remove miette, this rendering is so confusing

@zaniebot
zaniebot force-pushed the zb/warn-user-with-chain branch from ed0c7e5 to 813d014 Compare September 9, 2026 18:13
@zaniebot
zaniebot force-pushed the zb/warn-user-with-chain branch from 813d014 to 1352781 Compare September 9, 2026 18:20
@zanieb
zanieb marked this pull request as ready for review September 9, 2026 18:32
@astral-automations-bot

Copy link
Copy Markdown

Promoted to #21565.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:error-messages Messaging when something goes wrong

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants