Skip to content

Print "all requested tasks are running" message only once per ready transition#115

Merged
alexec merged 2 commits intomainfrom
copilot/print-ready-message-once
Mar 20, 2026
Merged

Print "all requested tasks are running" message only once per ready transition#115
alexec merged 2 commits intomainfrom
copilot/print-ready-message-once

Conversation

Copy link
Contributor

Copilot AI commented Mar 20, 2026

The ready message (🔵 all requested tasks are running:) was printed on every poison pill event while tasks remained running, producing duplicate output. It should print once when the app flips to ready, and again only if it goes unready and recovers.

Changes

  • internal/run.go: Introduce an allRunning bool flag scoped to the event loop. The message prints only when allRunning transitions false → true. The flag resets to false in two places:

    • When a poison pill is processed and remainingTasks is non-empty (a task is no longer complete)
    • When a task string event is processed (restart triggered) — handles the race where a goroutine cycles through cancelled → waiting → running faster than the main loop drains the event channel, meaning intermediate non-running phases are never observed via poison pills alone
  • internal/run_test.go: Two new test cases:

    • Stable service: message appears exactly once
    • Watched-file restart: message appears twice (initial ready + post-restart ready)

📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.

Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
Copilot AI changed the title [WIP] Update app to print ready message only once Print "all requested tasks are running" message only once per ready transition Mar 20, 2026
Copilot AI requested a review from alexec March 20, 2026 04:03
@alexec alexec marked this pull request as ready for review March 20, 2026 16:54
Copilot AI review requested due to automatic review settings March 20, 2026 16:54
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refines RunSubgraph logging so the “🔵 all requested tasks are running:” message is emitted only on a not-ready → ready transition, avoiding repeated output while tasks remain running.

Changes:

  • Add an allRunning state flag in the RunSubgraph event loop to gate ready-message printing to a single transition.
  • Reset allRunning on certain events (poison pill with remaining tasks, and task-run events) so the message can print again after recovery.
  • Add tests asserting the ready message is printed once for a stable service and twice across a watched-file restart.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
internal/run.go Adds allRunning gating and reset logic for the ready message in the main event loop.
internal/run_test.go Adds regression tests asserting ready-message print counts for stable and restart scenarios.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alexec alexec merged commit 4b85992 into main Mar 20, 2026
6 checks passed
@alexec alexec deleted the copilot/print-ready-message-once branch March 20, 2026 17:27
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.

3 participants