cx-6uj1l: agent pages follow Labs and page settings from launch

Merged
TE
22d ago
+56-4

cx-6uj1l. With labs.previewFeatures on, agent pages never got preview, whether at launch or when it was turned on while the app ran. The setting read true and the sidebar showed Lanes, but the agent pane's Labs surfaces (the session coverage label, and the plan card in #20833 and recap card in #20867) never appeared. The same bug left the other page settings at their fallbacks on every agent page: agentPane.editedFiles.*, zoom, composer and diff.colors.

Cause. At launch, AppActions.bind runs before Settings start. Three bindings read services.agentTabs right away:

  • FilePageHandlers (openFiles)
  • AgentHandlers (moveToFloatingChat)
  • CloudHandlers+Move (uploader)

That creates the lazy store while services.settings is nil, and the store follows the page settings only when it gets them in its init. So it never followed them.

Fix. AppServices.settings now has a didSet that makes an already-created store follow the settings. A store made later still follows them through its init, so it works whatever touches the store first.

Testing

  • New AgentPageLabsFollowTests. It binds the actions, then sets Settings with Labs on, opens an agent view and expects preview on. Then it turns Labs off and expects preview off.
  • That green run had one unrelated failure, SidebarInsertWhileDisplayAsleepTests. It is likely display-host dependent, but that isn't confirmed. It also had the known same-tree skip guard.
  • Live: a DEV build of this fix merged with #20833, on a fleet capture slot.
    • With Labs on, the page shows the plan card and the coverage label.
    • Turning Labs off while running removes both, and turning it back on brings them back.
    • The same build without this fix showed neither.
Labs on (coverage label in the header, plan card)Labs turned off while running
labs on agent page darklabs toggled off dark

Changelog

  • Fixed: Labs features and agent pane settings (edited files, zoom, composer, diff colors) now reach agent chats from launch and update live.

šŸ¤– Generated with Claude Code