fix(acp): dedupe duplicate Thinking selector (pi ACP modes + config) - #445
fix(acp): dedupe duplicate Thinking selector (pi ACP modes + config)#445julianromli wants to merge 3 commits into
Conversation
Agents that advertise multiple model/thought_level options were showing a promoted chip plus a generic duplicate. Keep first-wins for those categories in the composer and slash menu. Closes gnoviawan#444 Co-authored-by: Cursor <cursoragent@cursor.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
📝 WalkthroughWalkthroughAdds shared first-wins filtering for duplicate ChangesPromoted singleton config options
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
pi-acp publishes thinking both as a thought_level config option and as session.modes named "Thinking: …". Prefer the promoted Thinking chip and suppress the redundant ModeChip when every mode id is a thought_level value. Co-authored-by: Cursor <cursoragent@cursor.com>
Follow-up: real pi-acp root causeThe first commit only deduped multiple
Pushed a second commit that hides Please hard-refresh / let Vite HMR reload and re-check pi ACP. |
Keep Thinking chip and modes in sync after ModeChip hide so launcher xhigh does not snap back to off in the running ChatInputBar. Co-authored-by: Cursor <cursoragent@cursor.com>
Summary
thought_levelConfigChip (brain icon) and ModeChip, because pi dual-publishes thinking as both a config option andsession.modeswith the same value IDs/names.thought_leveloption value. Real Agent/Plan/Ask modes are unchanged.model/thought_levelconfig options in the composer chip row and/slash menu so a second generic chip cannot appear.Related Issue
Closes #444
Prior related work (not duplicates of this bug): #286 / #302 (initial thought_level promotion). Closed PR attempt earlier today was incomplete until the ModeChip root cause was identified; this reopens that branch with both commits.
Type of Change
What Changed
modesRedundantWithThoughtLevelinchat-input-bar-config.ts— detect whensession.modesis the same control asthought_levelChatInputBar+AgentLaunchergateModeChipbehindshowModeChipso pi ACP no longer renders a second Thinking pillshouldAdvertiseConfigOption+partitionConfigOptions— firstmodel/thought_levelwins; later same-category options discarded fromrestbuildSlashSectionsapplies the same first-wins filter so/does not expose a second Thinking/Model sectionmodesRedundantWithThoughtLevel, partition/slash dedupe, AgentLauncher pi-acp regression (getAllByRolelength 1 for "Thinking: off")How It Was Tested
bun run ci(Biome lint + format + imports, strict mode)bun run typecheckbun run test(2210 passed)cargo clippy --all-targets -- -D warnings(in src-tauri)cargo test(in src-tauri)Screenshots or Recordings
Before: two "Thinking: off" chips in the composer toolbar (one with brain icon, one without) when pi ACP is selected.
After: a single promoted Thinking chip; ModeChip suppressed only when modes are redundant with thought_level.
CI & Review Gate
Checklist
Test plan
modeloption is advertised/and confirm a single Thinking Level / Model section when duplicate config options are presentfilterDuplicateModeConfigOptions) is unchanged for true mode options