Skip to content

feat(#435): MCP progress notifications with timeout reset - #449

Merged
admarble merged 1 commit into
mainfrom
feature/435-mcp-add-progress-notifications-for-sequant-run
Mar 25, 2026
Merged

admarble merged 1 commit into
mainfrom
feature/435-mcp-add-progress-notifications-for-sequant-run

Conversation

@admarble

Copy link
Copy Markdown
Contributor

Summary

  • Extend ProgressEvent interface with event type (start/complete/failed), durationSeconds, and error fields
  • Batch executor now emits structured progress events at phase start, completion, and failure
  • spawnAsync detects SEQUANT_PROGRESS: lines from stderr and resets per-phase timeout (30min ceiling, 2hr absolute max)
  • Event-appropriate progress messages: #N: phase started, #N: phase ✓ (Ns), #N: phase ✗ — error
  • Only complete/failed events increment progress counter; start events are informational

AC Coverage

AC Status Evidence
AC-1 ✅ Already implemented run.ts progressToken + sendNotification
AC-2 ✅ Already implemented createLineBuffer streams stderr
AC-3 ✅ Implemented formatProgressMessage with event-appropriate messages
AC-4 ✅ Implemented spawnAsync resettable timeout via internal progress detection
AC-5 ✅ Already implemented No-op guard when no progressToken
AC-6 ✅ Already implemented RunToolResponse unchanged
AC-7 ✅ Already implemented ToolHandlerExtra typing
AC-8 ✅ Implemented emitProgressLine with start/complete/failed events + duration/error
AC-9 ✅ Already implemented SEQUANT_PROGRESS: prefix
AC-10 ✅ Implemented 29 new unit tests across parseProgressLine, createLineBuffer, formatProgressMessage, timeout reset, emitProgressLine

Test plan

  • npm run build passes
  • npm run lint passes
  • All 78 progress-related tests pass (unit + integration)
  • Full test suite passes (2 pre-existing known failures only)
  • Timeout reset verified: process with progress lines completes despite exceeding initial timeout
  • Backward compatibility verified: no-progressToken behavior identical to before

Closes #435

- Extend ProgressEvent with event type (start/complete/failed),
  durationSeconds, and error fields
- Batch executor emits structured events at phase start, completion,
  and failure with duration and error data
- spawnAsync detects SEQUANT_PROGRESS lines from stderr internally
  and resets per-phase timeout (30min), capped by absolute ceiling (2hr)
- Add injectable maxTotalTimeout for testing the ceiling path
- Only complete/failed events increment progress counter
- Event-appropriate messages: started, ✓ (Ns), ✗ — error
- Unit tests for parseProgressLine, createLineBuffer, formatProgressMessage,
  timeout reset, maxTotalTimeout ceiling, emitProgressLine roundtrip
- Update existing MCP integration tests for new event schema
- Update MCP server docs for enhanced progress notifications

Closes #435

Entire-Checkpoint: 46b569dad6e6
@admarble
admarble force-pushed the feature/435-mcp-add-progress-notifications-for-sequant-run branch from 19a2e63 to ee662b2 Compare March 25, 2026 23:04
@admarble
admarble merged commit 09d86fd into main Mar 25, 2026
5 checks passed
@admarble
admarble deleted the feature/435-mcp-add-progress-notifications-for-sequant-run branch March 25, 2026 23:05
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.

MCP: add progress notifications for sequant_run with graceful fallback

1 participant