Skip to content
This repository was archived by the owner on Sep 23, 2025. It is now read-only.
This repository was archived by the owner on Sep 23, 2025. It is now read-only.

Use review shell context for action button routing #26

@nikomatsakis

Description

@nikomatsakis

Enhancement Request

When a review is active (presented via present_review or present_walkthrough), action buttons should send messages back to the same AI assistant that created the review, rather than requiring terminal disambiguation.

Current Behavior

Action buttons use generic terminal detection:

  1. Find all terminals with active MCP servers
  2. If multiple found, show picker to user
  3. Send message to selected terminal

Proposed Behavior

Action buttons should be context-aware:

  1. If review is active, send to the originating shell that presented the review
  2. Only fall back to disambiguation if no active review context

Implementation Notes

Review Context Tracking:

  • Track shellPid when present_review or present_walkthrough is called
  • Store in review provider state: currentReviewShellPid?: number
  • Clear when review is closed/replaced

Action Button Routing:

// In sendToActiveShell()
if (this.currentReviewShellPid) {
    // Find terminal matching the review's shell PID
    const reviewTerminal = terminals.find(t => t.processId === this.currentReviewShellPid);
    if (reviewTerminal) {
        reviewTerminal.sendText(message, false);
        return; // Skip disambiguation
    }
}
// Fall back to current disambiguation logic

Secondary Enhancement

Ask Socratic Shell Integration:

  • Also use review shell context for Ask Socratic Shell disambiguation
  • When user selects code and clicks "Ask Socratic Shell", prefer the terminal that presented the current review
  • Provides more intuitive workflow when working with active reviews

Benefits

  1. Better UX: No disambiguation needed when context is clear
  2. Consistent conversation: Messages go to the same AI that created the review
  3. Workflow continuity: Natural back-and-forth with the reviewing AI assistant

Priority

Medium - enhances UX but current implementation works functionally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions