Skip to content

fix(plugin-profiles): answer /plugin-profile at once and draw the picker as rows - #16827

Merged
kyle-sexton merged 2 commits into
mainfrom
fix/16818-plugin-profile-picker
Nov 17, 2026
Merged

kyle-sexton merged 2 commits into
mainfrom
fix/16818-plugin-profile-picker

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Refs: #16818

Summary

Fixes the five /plugin-profile picker defects the owner saw in a live session after #16759 merged (#16818). This PR does not close the issue because the owner's live try is still open (see Not delivered).

Fix

Done-when line in #16818 Delivered by
/plugin-profile never overruns the hook budget, and every outcome line prints command.run opens the pane and answers at once. The row press runs the preview, confirm and write, then $.ui.logs the outcome line the command used to return. Basis: mods types 2.1.326, HookBudget.ms: 10_000 "from its call to its return"; "A $ call's time never counts against the calling hook's budget". The old hook awaited a plain promise, which is not a $ call. Where no pane can be placed, the paged $.ui.ask path stays inside the command, because that wait is a $ call.
Every profile and No profile visible when the pane opens The pane draws one row per profile and No profile on every surface, each row a Button plus its description cut to one line, with Cancel last. The Select is gone.
Full description by pointer hover and keyboard focus Each row's Box is keyed and holds a display: "none" Box with hover: { display: "flex" } that carries the whole description (types BoxProps.hover). A ui.focus hook stores the focused row in $.state (focused), and the pane draws that row's whole description under the list. The pane is still a $.ui.open pane, so it can still be dragged.
The preview and in-force line name a list once; a repeat is a count profiles.mjs previewLines prints "Left on until the next apply (N): every plugin it switches off" (or "K of the plugins it switches off, plus …") in place of the repeated ids. The mod's closing and in-force lines say "The N plugins it switches off stay loaded …".
Item 5 fixed or its limit stated Fixed. status, clear, apply and launch defaults read a settings file's record from this copy's data folder first, then from any other plugin-profiles* data folder, so an installed copy finds the record a --plugin-dir copy wrote under plugin-profiles-inline and clears it. Basis: profiles.mjs locate places an inline copy's data in plugins/data/plugin-profiles-inline and an installed copy's in plugins/data/<plugin id>, so each copy saw only its own records.

Verification

  • claude plugin test plugins/plugin-profiles: 33 of 33 pass. Run against the merged register.tsx and types/index.d.ts, all 8 new Fix the /plugin-profile picker pane as seen in a live session #16818 cases fail (the answer-at-once case reads "still waiting", the pane cases time out at 5000 ms). The cases changed for the new flow fail there too.
  • node --test --test-concurrency=4 plugins/plugin-profiles/scripts/profiles.test.mjs: 87 of 87 pass. Against the merged profiles.mjs, the new clear-across-copies case and the reworded Left-on case fail.
  • claude plugin validate plugins/plugin-profiles passes. Its 4 TS2532 lines are the w.asks[0] warnings in the test file that existed before Make the /plugin-profile picker and preview readable in a live session #16747.
  • claude plugin test cannot press keys or move the pointer. The hover case checks the drawn tree (the hidden Box and its hover), and the focus case raises ui.focus in the shape the engine sends.

Not delivered

Related

🤖 Generated with Claude Code

https://claude.ai/code/session_015XWwmdFGUAZ9XpJTmCmKhN

kyle-sexton and others added 2 commits November 17, 2026 11:31
…ker as rows

The command.run hook awaited the person's pick, a plain promise, so it
overran the hook's 10s budget (mods types HookBudget.ms 10_000; only a
$ call's time is free) and its outcome text never printed. The command
now opens the pane and answers; the pane's row press runs the preview,
confirm and write and logs the outcome. Where no pane can be placed it
still pages through $.ui.ask, whose time is free.

The pane draws a row per profile and No profile on every surface, with
the whole description revealed on hover (BoxProps.hover) and the
focused row's under the list, tracked from ui.focus.

profiles.mjs counts the plugins left on until the next apply instead of
naming the switched-off list again; the mod's closing and in-force lines
count them too.

status and clear read a record from another copy's data folder (a
--plugin-dir copy writes plugin-profiles-inline), so clear no longer
says nothing is recorded while the settings file holds its entries.

Refs: #16818

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015XWwmdFGUAZ9XpJTmCmKhN
@kyle-sexton

Copy link
Copy Markdown
Member Author

Owner: the control-hub session "Plugin Presets" watches and merges this PR. It does not merge before the owner has tried the picker in a live session (see Not delivered).

@kyle-sexton
kyle-sexton marked this pull request as ready for review November 17, 2026 16:33
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T16:36:44.711930Z 3d71295 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

claude-review: 1 inline finding(s) on 3d71295fbc8cee63d8a7311a2f3ffc7d5fdb646f; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed 3d71295fbc8cee63d8a7311a2f3ffc7d5fdb646f: read 7 of 7 changed file(s); 1 finding(s), 1 as inline comments.

Code review: PR #16827, plugin-profiles picker fixes (refs #16818)

I read all 7 changed files in full. The PR does four things:

  • /plugin-profile now answers as soon as the pane opens. The pick runs from the pane's onPress, and the outcome goes out through $.ui.log.
  • The Select is gone. The picker draws one Button row per profile on every surface.
  • The "Left on until the next apply" line and the in-force line give a count instead of naming the plugins again.
  • status, clear and apply also look for a record in another copy's plugin-profiles* data folder.

The picking flag covers the paths I checked. picked() clears the flag before it calls $.ui.close, so the ui.close hook does not log a second "No profile chosen" after a pick. Escape and Cancel each log it once. The outcome() wrapper catches failures from the pane path too. In recordOf, a record found in another copy's folder keeps its own recPath, so saveRecord and deleteRecord work on the file they read from and no second record is created.

Finding (1, inline): the hover reveal at register.tsx:229-233 puts hover={{ display: 'flex' }} on a Box that starts as display="none". A hidden element takes no space, so the pointer can never be over it, and the full description would never appear on hover. The one other hover use in this repo (plugins/display-redaction/hooks/register.tsx:105) puts it on the visible Text. The new test only inspects the drawn tree. The PR says claude plugin test cannot move the pointer, so nothing checks this behaviour (the PR's verification is the author's claim; I did not run it).

Closing issue: the PR context has no closing-issue section. The PR says "Refs: #16818" and leaves the issue open on purpose. So no acceptance criteria were checked, and I did not read #16818's done-when lines from the issue itself.

Loosened checks: the prompt has no loosened_check_verdict or loosened_check_patterns line, so I used the default fail with no consumer entries. Several expected strings in the tests changed. Each change follows a behaviour the PR intends (a count instead of repeated ids, an answer before the pick). Each still asserts an exact value, and some replace a single check with stricter ones, for example profiles.test.mjs:737-738. The settle() loop going from 500 to 2000 microtask turns is a wait inside the test, not the test's timeout. I found no loosening.
Loosened-check verdict: fail (default, nothing resolved); patterns: 0

Spend: none. The PR changes no workflow, model or lane settings.

Verifier dropped 0 of 1 candidates.

@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 3d71295fbc8cee63d8a7311a2f3ffc7d5fdb646f: read 7 of 7 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #16827 (plugin-profiles picker fix)

No security issues found.

The PR changes 7 files and I read every hunk of each. It touches no trusted path, no plugin manifest (plugin.json / marketplace.json), no workflow and no trust control.

What I checked:

  • register.tsx, the picker flow. /plugin-profile now returns as soon as the pane opens. The row press runs switchTo, which shows a preview and asks before it writes. Profile names come from the plugin's own list --json output and reach the CLI as separate argv elements through $.process.run([...]). No shell string is built, so the names cannot inject a command. Each write still needs a yes at the confirm. The module-level picking flag stops a second press, or a later ui.close, from running the switch twice. The new ui.focus handler stores only a string taken from the focused element's key, and that string is only shown as text.
  • profiles.mjs, recordOf / otherDataDirs. status, clear, apply, launch defaults and initialMembers now also read a record from any plugin-profiles* folder under <configDir>/plugins/data. That folder belongs to the user's own Claude config. Only a plugin installed in that same config could plant a record there, and an installed plugin already runs code as the user, so this lookup gives an attacker nothing new. The worst a planted record does is change the "before" values that clear puts back. clear prints what it changes and writes only on --yes or a yes at the prompt. The folder search is a fixed directory read with a name filter, and no outside input reaches the path.
  • previewLines and the closing lines. These are text-only changes that count the plugins instead of naming them again.
  • Tests, types, README and changelog fragment. No security surface.

Settled thread: the one on register.tsx L229-233 (whether the hover reveal works) is about behaviour, not security, and it is not raised here.

critical-findings: 0

@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit a3435c3 Nov 17, 2026
180 of 187 checks passed
@kyle-sexton
kyle-sexton deleted the fix/16818-plugin-profile-picker branch November 17, 2026 17:23
@github-actions github-actions Bot added the merge-path: owner-agent Post-merge accounting record (README.md, Merge paths) label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant