Skip to content

Conversation

@yusufaytas
Copy link
Contributor

  • Added Copilot-suggested runbooks with one-sentence justifications.
  • Updated PlanBrowser and filters to support URL-based filtering (query, scope) for deep-linking.
  • Mapped orchestration tool calls (query plans/runs) to their corresponding frontend routes in referenceBuilder.
  • Updated core types and ResponseDetails to render the new actions array in Copilot answers.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Overview

Greptile Summary

This PR adds Copilot-suggested orchestration actions and deep-linking support for orchestration plans. The implementation allows Copilot to recommend specific runbooks with justifications, and enables URL-based filtering for direct navigation to filtered plan views.

Key Changes:

  • Added CopilotAction type with id, name, reason, and type fields for recommended actions
  • Created ActionLinks component to display action recommendations as clickable cards
  • Updated PlanBrowser and PlanFilters to support URL query parameters (query, scope) for deep-linking
  • Extended referenceBuilder to map 6 orchestration tool calls to frontend routes
  • Added orchestrationPlans to reference types for Copilot-generated plan links
  • Comprehensive test coverage for all new orchestration tool mappings

Issue Found:

  • The loadChat function doesn't preserve actions from historical chat turns, so previously recommended actions won't display when viewing chat history

Confidence Score: 4/5

  • This PR is safe to merge with one minor fix needed for chat history
  • The implementation is well-structured with comprehensive test coverage. However, the loadChat function has a bug where it doesn't preserve actions from historical chat turns, which will cause action recommendations to disappear when viewing chat history. This is a minor functional issue that should be fixed but doesn't affect new chat sessions.
  • Pay attention to app/components/(enterprise)/CopilotPanel.tsx - the loadChat function needs to preserve actions from historical turns

Important Files Changed

File Analysis

Filename Score Overview
app/lib/types.ts 5/5 Added CopilotAction type and orchestrationPlans to CopilotReferences, well-typed
app/components/(enterprise)/copilot/ActionLinks.tsx 5/5 New component to render recommended orchestration actions with proper styling
app/components/(enterprise)/CopilotPanel.tsx 4/5 Added actions extraction in normalizeAnswer, but loadChat doesn't preserve actions from history
app/components/PlanBrowser.tsx 5/5 Added URL param parsing for deep-linking with query and scope filters
app/lib/referenceBuilder.ts 5/5 Added comprehensive orchestration tool mappings to frontend routes

Sequence Diagram

sequenceDiagram
    participant User
    participant CopilotPanel
    participant API as /api/copilot
    participant ResponseDetails
    participant ActionLinks
    participant PlanBrowser
    participant referenceBuilder

    User->>CopilotPanel: Ask question
    CopilotPanel->>API: POST message
    API-->>CopilotPanel: CopilotAnswer with actions[]
    CopilotPanel->>CopilotPanel: normalizeAnswer() extracts actions
    CopilotPanel->>ResponseDetails: Render answer with actions
    ResponseDetails->>ActionLinks: Pass actions array
    ActionLinks->>ActionLinks: Build href for each action
    ActionLinks-->>User: Display action cards with links
    
    User->>ActionLinks: Click action link
    ActionLinks->>PlanBrowser: Navigate to /orchestration/plans/{id} or /orchestration/plans?query=...
    PlanBrowser->>PlanBrowser: Parse URL params (query, scope)
    PlanBrowser->>PlanBrowser: Set initialFilters from params
    PlanBrowser->>PlanBrowser: Load plans with filters
    PlanBrowser-->>User: Display filtered plans
    
    Note over referenceBuilder: Tool execution hrefs
    API->>referenceBuilder: buildToolExecutionHref(toolName, args)
    referenceBuilder->>referenceBuilder: Map orchestration tools to routes
    referenceBuilder-->>API: Return href with query params
Loading

@greptile-apps
Copy link

greptile-apps bot commented Jan 8, 2026

Additional Comments (1)

app/components/(enterprise)/CopilotPanel.tsx
loadChat doesn't preserve actions from historical chat turns. When loading chat history, actions won't be displayed even if they were in the original response.

        if (t.assistantResponse) {
          mappedTurns.push({
            id: makeId("copilot"),
            role: "copilot",
            text: t.assistantResponse,
            answer: {
              conclusion: t.assistantResponse,
              chatId: conversation.chatId,
              actions: t.actions as CopilotAction[] | undefined,
              // Include executionTrace from stored turn for historical display
              executionTrace: t.executionTrace as TurnExecutionTrace | undefined,
            },
          });
        }

- Added Copilot-suggested runbooks with one-sentence justifications.
- Updated PlanBrowser and filters to support URL-based filtering (query, scope) for deep-linking.
- Mapped orchestration tool calls (query plans/runs) to their corresponding frontend routes in referenceBuilder.
- Updated core types and ResponseDetails to render the new actions array in Copilot answers.
@yusufaytas yusufaytas force-pushed the add-copilot-actions branch from f307597 to 980d325 Compare January 8, 2026 22:17
@yusufaytas yusufaytas merged commit 24e28ce into main Jan 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants