Skip to content

Add real-time session event monitoring to execution screen#12

Draft
Copilot wants to merge 5 commits intomainfrom
copilot/add-realtime-session-monitoring
Draft

Add real-time session event monitoring to execution screen#12
Copilot wants to merge 5 commits intomainfrom
copilot/add-realtime-session-monitoring

Conversation

Copy link
Contributor

Copilot AI commented Feb 13, 2026

Exposes Copilot SDK session events (tool executions, progress updates, token usage, errors) to users during task execution via a toggleable event log.

Implementation

Event capture & forwarding

  • copilot.ts: Subscribe to all session events via session.on(), added SessionEventData interface and optional callback to StreamCallbacks
  • executor.ts: Forward events with task context through onSessionEvent callback
  • Event flow: SDK → copilot → executor → UI, enriched with taskId at executor layer

UI & display

  • execute.tsx: Added event log panel (toggle with e key), displays last 8 of max 100 events with timestamps
  • formatSessionEvent() parses SDK event types into user-friendly messages
  • Error events highlighted in red

Event types handled

  • tool.execution_start / tool.execution_complete - tool lifecycle
  • tool.execution_progress - real-time progress messages
  • session.error - session-level failures
  • assistant.usage - token consumption metrics

Example

// copilot.ts - event subscription
session.on((event) => {
  callbacks.onSessionEvent?.({
    type: event.type,
    timestamp: event.timestamp,
    data: event.data,
  });
});

// executor.ts - enrich with task context
onSessionEvent: (event) => {
  callbacks.onSessionEvent!(taskId, event);
}

Bounded to 100 events to prevent unbounded memory growth during long-running executions.

Original prompt

This section details on the original issue you should resolve

<issue_title>[enhancement] Add Real-Time Session Event Monitoring for Task Execution Feedback</issue_title>
<issue_description>## Background

Recent changes in the Copilot SDK (v0.1.24-preview.0) include:

Commit reference: 439e0f0

Proposal

Implement real-time session event monitoring in src/services/executor.ts to provide users with granular feedback during task execution. The SDK's session event API allows subscriptions to events like:

  • tool.execution_complete (formerly tool.execution_end)
  • Progress updates from Copilot agents
  • Token usage and performance metrics

Implementation approach:

  1. Add event listeners in the Copilot SDK wrapper (src/services/copilot.ts)
  2. Stream events to the execution screen component (src/screens/execute.tsx)
  3. Display real-time progress indicators for each task (e.g., "Installing dependencies...", "Running tests...", "Generating code...")
  4. Show estimated completion percentages based on event data

Benefit

  • Better UX: Users see what Copilot is actively doing instead of staring at a blank "In Progress" spinner
  • Debugging: When tasks fail, users can see exactly where execution stopped
  • Transparency: Token usage and performance data help users understand costs
  • Trust: Real-time feedback builds confidence that the system is working

Acceptance Criteria

  • Session event subscription implemented in src/services/copilot.ts using SDK's event API
  • Event stream plumbed to src/screens/execute.tsx (via React state or context)
  • Execution screen displays at least 3 types of events: task start, progress updates, and tool.execution_complete
  • Event log is scrollable and shows timestamps
  • Error events are highlighted in red and include actionable messages
  • Unit tests verify event handlers properly parse SDK event payloads
  • Documentation updated to explain the event monitoring feature

AI generated by Weekly Enhancement Suggestions

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits February 13, 2026 01:10
Co-authored-by: colindembovsky <1932561+colindembovsky@users.noreply.github.com>
Co-authored-by: colindembovsky <1932561+colindembovsky@users.noreply.github.com>
Co-authored-by: colindembovsky <1932561+colindembovsky@users.noreply.github.com>
…ts, document event subscription

Co-authored-by: colindembovsky <1932561+colindembovsky@users.noreply.github.com>
Copilot AI changed the title [WIP] Add real-time session event monitoring for task execution feedback Add real-time session event monitoring to execution screen Feb 13, 2026
Copilot AI requested a review from colindembovsky February 13, 2026 01:14
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.

[enhancement] Add Real-Time Session Event Monitoring for Task Execution Feedback

2 participants