Skip to content

Support selective undo for applied optimizer actions #28

@dreamwing

Description

@dreamwing

Problem

The Cost Control Center currently stores full config snapshots and restores them wholesale. That makes Undo safe only for the most recent optimization entry.

From the UI, this is confusing: older applied actions such as Reduced AI Thinking Allowance look like they should also be reversible, but exposing Undo for them today would roll back newer changes too.

Goal

Support per-action undo semantics in optimization history so each applied recommendation can clearly report one of these states:

  • undoable now
  • blocked by newer changes
  • permanently non-undoable

Proposed approach

Start with action-level undo metadata instead of full-history snapshot restores.

  1. Store affectedResources and undoMeta for each optimization history entry.
  2. Add conflict detection so an older action is undoable only when none of its affected resources were changed by newer actions.
  3. Update the UI timeline to show per-entry undo state instead of only enabling undo for the latest item.
  4. Implement selective undo first for pure config actions:
    • A01
    • A02
    • A05
    • A06
    • A07
  5. Handle file / skill actions separately in a follow-up phase:
    • A04
    • A09

Why issue first

This needs product and implementation decisions before coding:

  • whether older actions should be blocked or allowed to overwrite newer state
  • what counts as a conflicting resource change
  • how to represent undoability in history and UI

Acceptance criteria

  • History entries record enough metadata to attempt action-level undo safely.
  • Older entries show a clear blocked reason when newer changes touch the same resources.
  • Pure config actions can be undone individually when there is no conflict.
  • The UI no longer implies that every historical item is directly undoable when it is not.
  • A04 and A09 remain explicitly out of scope for the first implementation phase.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions