Trim Pax's folder trust prompt to one question and one detail line
- Part of #16101
This is an agy PR.
Why we make these changes
The Pax folder trust prompt previously rendered a 5+ line QuestionMenu (Trust this folder?, multi-line describe() output duplicated into scrollback, verbose choices, and a key-hint footer) plus a Trusted. /trust changes it. confirmation line after answering Yes, making startup noisy. This PR trims the interactive trust prompt to one question line and one dim detail line (Trust ~/src/foo? Yes / No), clears the prompt with no follow-up banner on Yes or when no prompt is needed, prints a single concise notice only on No / Esc, and shortens undecided_notice to one line.
Dependency & design choices
- Built cleanly on
origin/main(rather than merging open PRs #15542 and #15566): Both #15542 (.envafter trust) and #15566 (untrustedread-onlyfloor) are still open with compatibility impacts and active CI/review work. Implementing the prompt trim directly onmainkeeps this PR small, immediately mergeable, and factually accurate today (without falsely claimingNoenforcesread-onlyor skips.envbefore those PRs land). Once #15542 and #15566 land, a small follow-up can addread-onlyand.env (N vars: A, B, C, ...)(capped at 3 names inline + count) toprompt_detail, gate their notices strictly behind answering No in_decide_trust, and fold them into the single headless stderr line to close #16101. - Compact two-line
TrustPrompt(ui/menus/trust_prompt.py): RendersTrust <path>? Yes / No(defaulting toNo, supportingy/n/1/2/arrows/Tab/Enter/Esc/Ctrl+C, tail-truncating long paths soYes / Nostays visible) plus one dim detail line (theme.MUTED). UnwrapsTranscriptOutputso ephemeral prompt frames never leak intoTranscriptBufferor scrollback on erase. KeepsTRUST,DISTRUST, andask_trust(details, *, console, target='this folder')backward-compatible withv2.78.0. - Separate
prompt_detail()vsdescribe()(runtime/workspace_trust.py): Addsdisplay_path()(~abbreviation + terminal sanitization) andprompt_detail()for the one-line startup prompt while keepingdescribe()for explicit/trustinspection. - No banner unless No/Esc:
_decide_trustprints nothing when a folder is already decided (trusted or untrusted) or when the user answersYes, and prints one concise line (Untrusted. /trust changes it./Untrusted for this session. /trust changes it.) only afterNoorEsc/Ctrl+C.
New public surface
pydantic_ai_pax.runtime.workspace_trust:display_path,prompt_detailpydantic_ai_pax.ui.menus.trust_prompt:TrustPrompt, optionaltargetkwarg onask_trust
Screenshots


Verification
- Added and updated regression tests in
tests/pax/test_workspace_trust.pyandtests/pax/test_acp.py(100% branch coverage ontrust_prompt.py,workspace_trust.py, and_decide_trust). - Verified live in a fresh
tmuxsession (Yes,No, arrow toggle, and relaunch in already-decided folders).
What changes for existing users
First-run interactive launches show a two-line Trust <folder>? Yes / No prompt instead of the multi-line picker, print no trust banner after answering Yes (or in already-decided folders), and print a shorter one-line untrusted notice in headless/web/ACP runs.
Checklist
- No breaking changes in accordance with the version policy.
- Any permitted compatibility impact has a label, warning, migration and release note, and an exact API-check waiver if the gate reports it.
- PR title is fit for the release changelog.
Summary by cubic
Trims Pax's folder trust prompt so first-run startup is quieter: the multi-line QuestionMenu is now a two-line inline prompt (Trust <folder>? Yes / No plus one dim detail line) that erases cleanly, prints no banner after Yes or in already-decided folders, and shows a single concise notice only on No or Esc/Ctrl+C.
- Long paths tail-truncate so
Yes / Nostays visible, and the prompt never leaks into the transcript or scrollback. - The detail line names what answering No leaves untrusted (instruction files, skills, and files needing separate approval like
.clai/settings.jsonand MCP servers) and notes when the answer is session-only. undecided_noticeis shortened to one line.- Adds
display_pathandprompt_detailwhiledescribestill serves/trust;ask_trustkeeps its optionaltargetkwarg and stays compatible withv2.78.0. - Built on
mainrather than open PRs#15542and#15566soread-onlyand.envdetails can layer on later.