feat(opencode): add LLM stream stall detection and check_task visibility (#398)#403
Merged
feat(opencode): add LLM stream stall detection and check_task visibility (#398)#403
Conversation
…ity (#398) - Add lastTokenTime tracking in processor.ts stream loop - Detect stalls when no tokens received for configurable timeout (default 3min, OPENCODE_STALL_TIMEOUT_MS) - Export stalledSessions Set for cross-module stall tracking - Extend TaskResult with stallDetected, lastToolCalls, lastActivity for running tasks - Show last 3 tool calls with name, status, and timestamp in check_task - Validate OPENCODE_STALL_TIMEOUT_MS for NaN and non-positive values - Update async-tasks fork-feature manifest with stall detection markers Fixes #398, Fixes #399, Fixes #400
…act getStallTimeout (#398) - Make stalledSessions private with isSessionStalled/markSessionStalled/clearSessionStalled accessors - Replace raw Set export with encapsulated functions for proper module boundary - Add hasStartTime type guard replacing unsafe cast in check_task.ts - Extract getStallTimeout() function from inline env var parsing - Add getStallTimeout to fork-features manifest criticalCode - Strengthen type guard to validate time.start is number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements EPIC #398 — Subagent LLM stall detection and visibility.
#399 — LLM Stream Stall Detector:
lastTokenTimein processor.ts stream loop, updated on every token-generating eventOPENCODE_STALL_TIMEOUT_MS)stalledSessionsSet for cross-module stall tracking with proper cleanup on all return paths#400 — Enhanced check_task Visibility:
TaskResultwithstallDetected,lastToolCalls,lastActivityfor running taskslastActivityreflects the most recent tool call timestampstallDetectedusesSessionProcessor.stalledSessions.has(id)for reliable detectionManifest Update:
async-tasksfeature withprocessor.tsinmodifiedFileslastTokenTime,OPENCODE_STALL_TIMEOUT_MS,LLM stream stalled,stalledSessionstocriticalCodestall.*detector,stream.*stall,lastTokenTime,export const stalledSessionstoabsorptionSignalsprocessor-stall.test.tstotestsFixes #398
Fixes #399
Fixes #400