Skip to content

Epic: Web UI (4/4) - Task Introspection View (Live & Historical) #56

Closed

Description

@integry

Epic: GitFix Web Management UI

This is the fourth and final issue for the initial web UI build.

Previous Issue: #55

This Issue (4/4): Task Introspection View

This task focuses on building the most complex and powerful feature of the dashboard: the ability to drill down into individual tasks to see their execution details, both live and historically.

High-Level Goal

  • Create a new page/view for displaying the details of a single task.
  • Implement a WebSocket-based system to stream live logs and diffs for active tasks.
  • Implement a mechanism for workers to persist logs and final diffs for completed/failed tasks.
  • The UI should seamlessly handle both live and historical data.

Implementation Steps

  1. Backend WebSocket Server:
    • Add a WebSocket library (like ws) to the dashboard-api service.
    • Set up a WebSocket server that listens for connections. When a client connects for a specific task (e.g., /ws/tasks/:taskId), the server will subscribe to that task's Redis Pub/Sub channels.
  2. Worker Modifications:
    • Live Streaming: When a worker runs executeClaudeCode, it must capture the stdout stream and publish it to a Redis Pub/Sub channel (e.g., task-log:${taskId}). It should also periodically run git diff and publish the result to another channel (e.g., task-diff:${taskId}).
    • Data Persistence: Upon task completion, the worker must save the full rawOutput and the final git diff to a persistent location (e.g., dedicated Redis keys) and update the task's state in the WorkerStateManager with a reference to this data.
  3. Frontend Introspection Page:
    • Create a TaskDetailsPage.js component that takes a taskId from the URL.
    • First, fetch the task's static data from the WorkerStateManager.
    • If the task is active: Establish a WebSocket connection to the backend and listen for incoming log and diff messages, updating the UI in real-time.
    • If the task is completed/failed: Fetch the persisted historical data from /api/task/:taskId/history and display it statically.

Activity

  1. integry commented on Sep 12, 2025

    @integry
    OwnerAuthor

    Suggested Implementation: WebSocket Backend Logic

    This snippet outlines the core logic for the WebSocket server and how it would integrate with Redis Pub/Sub to stream live data.

    Reasoning:

    • Scalability: Using Redis Pub/Sub decouples the worker processes from the WebSocket server. Multiple workers can publish logs, and multiple API instances can subscribe and serve clients without direct connections.
    • Real-time: WebSockets provide a persistent, low-latency connection perfect for streaming terminal-like output.
    // packages/dashboard/webSocket.js
    import { WebSocketServer } from 'ws';
    import Redis from 'ioredis';
    
    export function setupWebSocket(server) {
      const wss = new WebSocketServer({ server });
      const subscriber = new Redis(); // Create a dedicated Redis client for subscribing
    
      subscriber.on('message', (channel, message) => {
        // Message received from Redis Pub/Sub
        const taskId = channel.split(':')[1];
        // Find all WebSocket clients watching this taskId and send them the message
        wss.clients.forEach((client) => {
          if (client.readyState === WebSocket.OPEN && client.taskId === taskId) {
            client.send(JSON.stringify({ channel, message }));
          }
        });
      });
    
      wss.on('connection', (ws, req) => {
        // Example: ws://localhost:4000/ws/tasks/task-123
        const urlParts = req.url.split('/');
        const taskId = urlParts[urlParts.length - 1];
    
        if (taskId) {
          ws.taskId = taskId;
          // Subscribe this connection to the relevant Redis channels
          subscriber.subscribe(`task-log:${taskId}`, `task-diff:${taskId}`);
          console.log(`Client connected for task ${taskId}`);
        }
    
        ws.on('close', () => {
          if (ws.taskId) {
            // Unsubscribe when the client disconnects to prevent memory leaks
            subscriber.unsubscribe(`task-log:${ws.taskId}`, `task-diff:${ws.taskId}`);
            console.log(`Client disconnected for task ${ws.taskId}`);
          }
        });
      });
    }
  2. propr-dev commented on Sep 13, 2025

    @propr-dev
    Contributor

    ❌ Failed to process this issue

    Error Category: git error
    Error Message: Error: spawn git ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:284:19)
    at onErrorNT (node:internal/child_process:477:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

    This appears to be a Git-related issue. The system may have encountered a corrupted repository or git operation failure. The issue will be automatically retried, and any corrupted repositories will be cleaned up.

    Processing Stage: Pre-processing (before AI analysis)

    Technical Details
    Error: Error: spawn git ENOENT
        at ChildProcess._handle.onexit (node:internal/child_process:284:19)
        at onErrorNT (node:internal/child_process:477:16)
        at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
        at Object.action (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:4462:25)
        at PluginStore.exec (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:4501:25)
        at file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:1369:43
        at new Promise (<anonymous>)
        at GitExecutorChain.handleTaskData (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:1367:16)
        at GitExecutorChain.<anonymous> (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:1351:44)
        at Generator.next (<anonymous>)
        at fulfilled (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:45:24)
    

    The system will automatically retry this task. If the issue persists, please contact support.

  3. propr-dev commented on Sep 13, 2025

    @propr-dev
    Contributor

    ❌ Failed to process this issue

    Error Category: git error
    Error Message: Error: spawn git ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:284:19)
    at onErrorNT (node:internal/child_process:477:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

    This appears to be a Git-related issue. The system may have encountered a corrupted repository or git operation failure. The issue will be automatically retried, and any corrupted repositories will be cleaned up.

    Processing Stage: Pre-processing (before AI analysis)

    Technical Details
    Error: Error: spawn git ENOENT
        at ChildProcess._handle.onexit (node:internal/child_process:284:19)
        at onErrorNT (node:internal/child_process:477:16)
        at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
        at Object.action (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:4462:25)
        at PluginStore.exec (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:4501:25)
        at file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:1369:43
        at new Promise (<anonymous>)
        at GitExecutorChain.handleTaskData (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:1367:16)
        at GitExecutorChain.<anonymous> (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:1351:44)
        at Generator.next (<anonymous>)
        at fulfilled (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:45:24)
    

    The system will automatically retry this task. If the issue persists, please contact support.

  4. propr-dev commented on Sep 13, 2025

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using claude-opus-4-20250514 model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Model: claude-opus-4-20250514
    • Branch: ai-fix/56-epic-web-ui-4-4-task-intr-20250913-1209-claude-opus-4-20250514-j6l
    • Base Branch: main
    • Worktree: issue-56-20250913-1209-claude-opus-4-20250514-j6l
  5. propr-dev commented on Sep 13, 2025

    @propr-dev
    Contributor

    ❌ Failed to process this issue

    Error Category: git error
    Error Message: Error: spawn git ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:284:19)
    at onErrorNT (node:internal/child_process:477:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

    This appears to be a Git-related issue. The system may have encountered a corrupted repository or git operation failure. The issue will be automatically retried, and any corrupted repositories will be cleaned up.

    Processing Stage: Pre-processing (before AI analysis)

    Technical Details
    Error: Error: spawn git ENOENT
        at ChildProcess._handle.onexit (node:internal/child_process:284:19)
        at onErrorNT (node:internal/child_process:477:16)
        at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
        at Object.action (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:4462:25)
        at PluginStore.exec (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:4501:25)
        at file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:1369:43
        at new Promise (<anonymous>)
        at GitExecutorChain.handleTaskData (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:1367:16)
        at GitExecutorChain.<anonymous> (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:1351:44)
        at Generator.next (<anonymous>)
        at fulfilled (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:45:24)
    

    The system will automatically retry this task. If the issue persists, please contact support.

  6. propr-dev commented on Sep 13, 2025

    @propr-dev
    Contributor

    ❌ Failed to process this issue

    Error Category: git error
    Error Message: Error: spawn git ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:284:19)
    at onErrorNT (node:internal/child_process:477:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

    This appears to be a Git-related issue. The system may have encountered a corrupted repository or git operation failure. The issue will be automatically retried, and any corrupted repositories will be cleaned up.

    Processing Stage: Pre-processing (before AI analysis)

    Technical Details
    Error: Error: spawn git ENOENT
        at ChildProcess._handle.onexit (node:internal/child_process:284:19)
        at onErrorNT (node:internal/child_process:477:16)
        at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
        at Object.action (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:4462:25)
        at PluginStore.exec (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:4501:25)
        at file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:1369:43
        at new Promise (<anonymous>)
        at GitExecutorChain.handleTaskData (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:1367:16)
        at GitExecutorChain.<anonymous> (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:1351:44)
        at Generator.next (<anonymous>)
        at fulfilled (file:///usr/src/app/node_modules/simple-git/dist/esm/index.js:45:24)
    

    The system will automatically retry this task. If the issue persists, please contact support.

  7. 112 remaining items

  8. added 4 commits that reference this issue on Sep 13, 2025
  9. propr-dev commented on Sep 15, 2025

    @propr-dev
    Contributor

    🤖 AI processing has started for this issue using claude-opus-4-20250514 model.

    I'll analyze the problem and work on a solution. This may take a few minutes.

    Processing Details:

    • Model: claude-opus-4-20250514
    • Branch: ai-fix/56-epic-web-ui-4-4-task-intr-20250915-1938-claude-opus-4-20250514-v2w
    • Base Branch: main
    • Worktree: issue-56-20250915-1938-claude-opus-4-20250514-v2w
  10. added a commit that references this issue on Sep 15, 2025
  11. added a commit that references this issue on Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions