Skip to content

Decouple Checkpointing from Manual Approval to Allow Safe Auto-Approval Workflows #8436

@Enlight432

Description

@Enlight432

1. The Goal: The Ideal Workflow

As a user, I want to configure a workflow that achieves three simultaneous objectives to balance convenience and safety:

  1. Automatic Approval for File Tools: Tools that modify files within the project workspace (write_file, replace, save_memory) should be executed automatically without requiring a manual confirmation prompt.
  2. Manual Approval for Shell Tools: The run_shell_command tool, due to its potential for high-impact changes, should always require explicit manual approval from the user.
  3. Reliable Automatic Checkpointing: A recovery checkpoint should be automatically and reliably created before any file system modification occurs, regardless of whether the tool was approved manually or automatically.

Currently, it is not possible to achieve all three objectives simultaneously.

2. The Core Problem: A Conflict in Design

The core issue is a design conflict between the auto-approval mechanisms and the checkpointing trigger. The checkpointing feature appears to be tightly coupled to the manual user approval event, rather than the impending file modification event itself.

As a result, any feature that bypasses the manual approval prompt (like tools.allowed or approval-mode=auto_edit) also bypasses the trigger for creating a checkpoint. This forces users into an undesirable trade-off: choose convenience and sacrifice the safety of checkpoints, or choose safety and sacrifice the convenience of auto-approval.

3. What We've Tried: A Log of Unsuccessful Attempts

To solve this, we have systematically tested every available mechanism, all of which have failed to meet the three core objectives.

Attempt # 1: Using tools.allowed

  • Configuration: We added write_file, replace, and save_memory to the tools.allowed array in settings.json.
  • Result:
    • ✅ File tools were auto-approved.
    • ✅ Shell tools still required manual approval.
    • Failure: No checkpoints were created for the auto-approved actions. The /restore command remained empty.
  • Reference: This aligns with the checkpointing.md documentation, which states checkpoints are created "When you approve a tool...". Bypassing the prompt means no approval event occurs.

Attempt # 2: Using --approval-mode=auto_edit

  • Configuration: We removed the tools.allowed setting and launched the CLI with the --approval-mode=auto_edit flag.
  • Result:

Attempt # 3: Manually Triggering Checkpoints with run_shell_command

  • Idea: Can we manually create a checkpoint by forcing a manually-approved, safe shell command (e.g., run_shell_command(command='true')) before running the main prompt?
  • Result:
    • Failure: Even when run_shell_command is manually approved, it does not trigger the checkpointing mechanism. It seems the trigger is specific to tools explicitly classified as file-modifying.

Attempt # 4: The Only "Working" (but flawed) Workaround

  • Idea: Manually trigger a checkpoint using a file-modifying tool that is not in the tools.allowed list.
  • Workflow:
    1. Remove all file-modifying tools from tools.allowed.
    2. Before the main task, issue a prompt to create a temporary file (e.g., /checkpoint custom command).
    3. Manually approve this action, which successfully creates a checkpoint.
    4. Issue the main prompt.
    5. Manually approve the actual file modification again.
  • Result:
    • ✅ Checkpoints are created reliably.
    • Failure: This defeats the primary goal of auto-approving file tools and makes the workflow extremely cumbersome.

4. Proposed Solution: Decouple the Checkpointing Trigger

To resolve this conflict, we propose that the checkpointing mechanism be decoupled from the manual approval UI event.

Instead, the trigger for creating a checkpoint should be moved deeper into the execution pipeline. It should be activated whenever the system is about to execute any tool that has been tagged or classified internally as "file-system-modifying," regardless of how that tool's execution was authorized (manually, tools.allowed, or auto_edit).

This change would make the features orthogonal and allow for the ideal, safe, and convenient workflow that users expect. Thank you for considering this improvement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stalearea/coreIssues related to User Interface, OS Support, Core Functionalitypriority/p2Important but can be addressed in a future release.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions