fix(cmux-next): let sessions.promptSuggestions turn suggested tasks off

Merged
TE
15d ago
+90-67

Fix forward for #21897, whose merge-audit revert is #23173.

Takes back #23173: #21897 was reverted because its setting could not turn suggestions off (the Debug toggle, on by default, was ORed in). This PR makes the setting decide, so the reason for the revert is gone.

Takes back #22089: it made the Debug toggle agent.suggestedTasks on by default, and that toggle was ORed in, so the setting could not turn suggestions off. The default now lives in the setting sessions.promptSuggestions (still on), and the toggle only forces suggestions on, so default behaviour is unchanged.

#21897 added sessions.promptSuggestions, but ORed it with the agent.suggestedTasks Debug toggle in two places: AgentPaneSuggestedTasks.isOn and AcpmuxHost's default offersSessionTools. #22089 had made that toggle default to on, so turning the setting off did nothing. #21897's test compared isOn with the toggle's value, which hid the bug.

What changes:

  • sessions.promptSuggestions now defaults to true, so the default behavior is the same as today. I regenerated SettingsSchema+Sessions.generated.swift with scripts/cmux-next/gen-settings-sources.py.
  • agent.suggestedTasks now defaults to false and is renamed "Force suggested tasks on": the setting decides, and the toggle only forces suggestions on.
  • AcpmuxHost's default closure now reads AgentPaneSuggestedTasks.forNextDaemon alone. That flag already holds isOn, so the second OR is gone.
  • Until the App wires the setting, forNextDaemon and setting start at the setting's default instead of false.
  • Tests: a new test turns the setting off and expects suggestions off. It fails on the base branch and replaces the isOn == debugOn check. AcpmuxOfferToolsTests now builds its host the way the app does (setting OR toggle).

Exports and the defaults guard:

  • schemas/settings/settings-schema.json, schemas/defaults/cmux-next.json and the docs/mdm exports come from a Swift test. The last commit applies the PR autofix's patch artifact at the final base merge (run 39705775066), so they list promptSuggestions with default: true.
  • The effective default does not change. Suggestions were already on for everyone through the agent.suggestedTasks Debug tunable (on by default since #22089), which overrode the setting's old false. They stay on by default; the setting now just decides.
  • The defaults guard lists setting.sessions.promptSuggestions as a changed default; since #23761 a SHIP receipt at the head clears it.
  • The webview comments now say the setting decides and the Debug toggle forces suggestions on. The page still gets one suggestedTasks bool.

No capture: no layout or styling changes. The suggested-tasks card is the same card; the only visible changes are that turning Settings > Suggest Follow-Up Tasks off now hides it, and the Debug Settings row's label and help text.

Note: a nightly user who had explicitly turned the Debug toggle off will see suggestions come back on, because that override no longer forces anything off. To turn them off, use Settings > Suggest Follow-Up Tasks.

Note: turning the setting off hides the card at once, but a daemon that is already running keeps offering the session tools (ACPMUX_OFFER_TOOLS=1) until it restarts.

No local build or tests (Leo's Macs never build); CI and cmux-ci compile-check --app compile and run the suites.

Agent session: Air-Blue

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes the forward for the reverted #21897 so sessions.promptSuggestions can actually turn suggested tasks off. The setting was ORed with the agent.suggestedTasks Debug toggle, which #22089 had made default on, so turning the setting off did nothing.

  • sessions.promptSuggestions now defaults to true and decides alone; agent.suggestedTasks defaults to false and only forces suggestions on. Default behavior is unchanged, and AcpmuxHost reads AgentPaneSuggestedTasks.forNextDaemon alone. Until the App wires the setting, forNextDaemon and setting start at the setting's default.
  • The regenerated exports pick up base's stale agents.subsessions.answerQuestions row.
  • The old test compared isOn to the toggle's value, hiding the bug; the new test turns the setting off and expects suggestions off.

Note: a nightly user who had explicitly turned the Debug toggle off will see suggestions come back on, since that override no longer forces anything off. To turn them off, use Settings > Suggest Follow-Up Tasks.