Skip to content

Epic: Tool Confirmation Message Bus #7231

@allenhutchison

Description

@allenhutchison

This issue tracks the implementation of the Tool Confirmation Message Bus as described in the RFC.

Summary

This project will implement a new pub/sub message bus to decouple tool confirmation logic from the core tool implementation. This will allow the agent/tools in the @google-gemini/core package to request user confirmation for actions (e.g., executing a shell command) from the TUI in the @google-gemini/cli package without a direct dependency. This architecture will also introduce a centralized Policy Service to manage tool execution rules, incorporating existing features like 'Always Allow' and non-interactive mode tool permissions from the outset.

Implementation Plan

  • PR 1: Foundation & Scaffolding

    • Introduce packages/core/src/confirmation-bus/ and packages/core/src/policy/.
    • Create MessageBus, PolicyEngine, and all related types.
    • Integrate PolicyEngine into MessageBus.
    • Instantiate both in the Session object.
    • Add this updated RFC. No functional changes to tool behavior yet.
  • PR 2: Core Tool Integration

    • Modify the shell tool in packages/core/src/tools/shell.ts to use the new message bus flow.
    • Include tests mocking both policy decisions and UI responses to validate the logic.
  • PR 3: TUI Integration

    • Modify useReactToolScheduler to handle ToolConfirmationRequest and ToolPolicyRejection messages.
    • Wire logic to publish confirmation responses and policy updates (for 'Always Allow') back to the bus.

Metadata

Metadata

Assignees

Labels

1.0/ui-improvementsStalearea/coreIssues related to User Interface, OS Support, Core Functionalitypriority/p2Important but can be addressed in a future release.workstream-rollupLabel used to tag epics and features that are associated with one of the three primary workstreams🔒 maintainer only⛔ Do not contribute. Internal roadmap item.

Type

No fields configured for Epic.

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions