Skip to content

Conversation

@stephanj
Copy link
Collaborator

Summary

  • Task Dependency Sorter: Topological sort (Kahn's algorithm) orders tasks by dependencies before execution, with circular dependency detection, ordinal-based ordering within layers, and external dependency status checking
  • Spec Task Runner Service: Sequential batch execution engine that monitors task completion via SpecService change listener and a grace timer fallback, supports cancellation, and tracks completed/skipped counts
  • Browser Panel Integration: Checkbox selection of To Do tasks, Run Selected / Run All / Cancel toolbar actions, inline progress panel with determinate progress bar
  • Prompt Execution Fixes: Defers task advancement until prompt execution completes — fixes premature grace timer firing on wrong task (Bug 1) and chat memory cleared mid-agent-loop (Bug 2). Adds execution ID for stale callback detection, cancel-then-proceed for task transitions, and agent/MCP timeout bypass
  • Agent Instructions: Improved prompts emphasizing backlog_task_edit for status updates and requiring notes/summary before marking Done
  • Settings: Task runner timeout configuration (minutes per task)
  • Docs: Agent Loop batch execution page, updated SDD docs

Test plan

  • TaskDependencySorterTest — 10 tests covering empty lists, single tasks, chain/diamond/circular dependencies, ordinal sorting, external deps
  • Manual: select To Do tasks via checkboxes, run batch, verify sequential execution with correct dependency order
  • Manual: verify tasks with circular dependencies show error notification
  • Manual: verify cancellation stops after current task
  • Manual: verify task marked Done mid-execution defers advancement until prompt completes (no premature skip)

🤖 Generated with Claude Code

stephanj and others added 9 commits February 11, 2026 13:41
Document how to add references and documentation to tasks (from prompt,
markdown, and how the agent uses them). Add section on viewing the backlog
outside the IDE using backlog board and backlog browser CLI commands.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
New Docusaurus page documenting the SDD Agent Loop feature: running
multiple tasks sequentially with dependency ordering, progress tracking,
and automatic task advancement. Adds cross-reference from the main SDD
page and sidebar entry.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Recommend creating a CLAUDE.md or AGENTS.md file and enabling
the prompt setting before running the agent loop.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Replace JEditorPane (HTML) with word-wrapping JTextArea for help texts,
use addFullWidthRow/addHelpText helpers matching AgentSettingsComponent
pattern, and nest content in BorderLayout.NORTH to prevent overflow.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
…activeTaskSpec code

Kotlin 2.3.10 generated Duration bytecode incompatible with IntelliJ 2024.3's
bundled kotlin-stdlib, causing NoSuchMethodError in inline completion provider.
Also removed unused activeTaskSpec field from ChatMessageContext and its consumer
in MessageCreationService — SDD task context is already assembled by
SpecContextBuilder before prompt submission.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Implements Kahn's algorithm (BFS) to sort tasks by dependencies before
batch execution. Handles internal dependencies between selected tasks,
external dependencies checked against allSpecs status, ordinal-based
ordering within layers, and circular dependency detection.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Introduces SpecTaskRunnerService that executes spec tasks sequentially
in dependency order, monitoring completion via SpecService change
listener and a grace timer fallback.

UI changes:
- SpecBrowserPanel: checkbox selection of To Do tasks, run/cancel
  toolbar actions, progress panel, runner listener notifications
- SpecTreeCellRenderer: checkbox icons for To Do tasks
- NotificationUtil: add warning and error notification methods
- SpecSettingsComponent: task runner timeout setting

Supporting changes:
- BacklogConfigService.ensureInitialized() for auto-init on first run
- SpecService.removeChangeListener() for proper cleanup
- SpecContextBuilder: improved agent instructions emphasizing
  backlog_task_edit over backlog_task_complete for traceability

Co-Authored-By: Claude Opus 4.6 <[email protected]>
Fixes two bugs in batch task execution:

1. Premature grace timer: when onSpecsChanged() detected a task as Done
   mid-execution, it advanced immediately, causing the grace timer to
   start for the wrong task and skip it. Now it sets a flag and defers
   advancement until notifyPromptExecutionCompleted().

2. Memory cleared mid-execution: submitNextTask() called
   startFreshConversation() which cleared ChatMemoryService while the
   previous agent loop was still running. Now memory is only cleared
   after the prompt execution truly finishes.

Supporting fixes:
- PromptExecutionController: execution ID to detect stale callbacks
  from previous runs that complete after a new execution starts
- PromptExecutionService: proceed with new execution after cancelling
  old ones instead of aborting (enables runner task transitions)
- NonStreamingPromptExecutionService: skip blanket timeout for
  agent/MCP prompts (individual requests have SDK-level timeouts)
- PromptTaskTracker: clean up stale task entries after cancellation
- ActionButtonsPanel: queue pending spec prompts and notify runner
  on prompt completion

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@stephanj stephanj merged commit 241d778 into master Feb 11, 2026
6 of 7 checks passed
@stephanj stephanj deleted the feature/spec-driven-todo-execution branch February 11, 2026 17:51
stephanj added a commit that referenced this pull request Feb 11, 2026
Add Agent Loop batch execution (#872), Kotlin downgrade, prompts
settings overflow fix, and documentation updates to both CHANGELOG.md
and plugin.xml change-notes.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.

1 participant