Skip to content

Simplify tool configuration to boolean unattended with runtime interaction choices #199

@JeanMertz

Description

@JeanMertz

The current tool calling configuration system requires users to pre-configure whether tools run in always, ask, or edit mode. This creates inflexibility when users can't predict beforehand whether they'll want to review, edit, or run a tool directly during an interactive session.

Context

Currently, tool configuration uses a RunMode enum with three values:

  • Always: Run without confirmation (should probably be renamed to "unattended")
  • Ask: Prompt for confirmation before running
  • Edit: Open editor to modify tool call arguments before running

Users must decide the interaction mode at configuration time, but in practice, the choice between asking for confirmation vs. editing often depends on the specific context of the tool call, which isn't known until runtime.

According to the current implementation in crates/jp_config/src/mcp/server/tool.rs, tools default to RunMode::Ask, and the interaction flow in crates/jp_cli/src/cmd/query/event.rs shows that when in Edit mode, if users empty the arguments, the system falls back to Ask mode anyway.

Alternatives

Users could work around this limitation by:

  1. Setting all tools to Edit mode and simply saving without changes when they don't want to edit
  2. Dynamically reconfiguring tools before each session
  3. Using different configuration profiles for different scenarios

However, these alternatives add unnecessary complexity and cognitive overhead.

Proposed Implementation

Replace the current three-state RunMode enum with:

  1. A simple boolean unattended field in tool configuration
  2. For attended tools (unattended = false), show a four-choice runtime prompt:
    • run - Execute the tool call as-is
    • reject - Skip the tool call entirely
    • reject with message - Skip with custom rejection message
    • edit - Open editor to modify arguments before running

This approach separates the configuration concern (attended vs. unattended) from the runtime interaction choice (run/reject/edit), providing better user experience and more appropriate defaults.

Tasks

  • Update RunMode enum in crates/jp_config/src/mcp/server/tool.rs to a boolean unattended field
  • Modify the tool calling interaction logic in crates/jp_cli/src/cmd/query/event.rs to show four-choice prompt for attended tools
  • Add "reject with message" functionality that returns a custom user-provided message instead of tool results
  • Update configuration parsing and validation to handle the new boolean field
  • Update documentation to reflect the new configuration approach
  • Consider backward compatibility or migration path for existing configurations

Resources

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions