Skip to content

Tasks prematurely marked NOT_NEEDED via 'overlay: tree did not exercise' before agent gets a chance to run them #321

Description

@pedapudi

Summary

In a v18 validation run (session 8df93041-5ab8-4c03-ba79-a8c155f74417, post-#319 fix landed at 1de1800), turn 1's draft_slides and review_presentation tasks were marked NOT_NEEDED at 22:28:35 and 22:30:36 — only ~2 minutes after research_panels completed, and before any agent attempted to run them. The slideshow was never produced for turn 1 as the user requested.

The reason text on the task_cancelled events is:

not_needed: overlay: tree did not exercise; no follow-up dispatched (goldfive#16…

Tasks that should run downstream of a completed task are getting reaped because the overlay sees no dispatch — but the dispatch was about to happen on the next turn or via the coordinator's normal flow.

Reproduction

Drive the v18 4-turn presentation matrix (solar panels → solar flares → save location → 2 slide constraint). In turn 1:

seq=18 22:27:16 task_transitioned    research_panels RUNNING->COMPLETED
seq=29 22:28:35 task_cancelled       reason='not_needed: overlay: tree did not exercise; no follow-up dispatched (goldfive#16…'
seq=30 22:28:35 task_transitioned    draft_slides PENDING->NOT_NEEDED
seq=40 22:30:36 task_cancelled       reason='not_needed: overlay: tree did not exercise...'
seq=41 22:30:36 task_transitioned    review_presentation PENDING->NOT_NEEDED

draft_slides and review_presentation go from PENDING to NOT_NEEDED without ever entering RUNNING.

The slideshow was eventually produced — but in turn 3 (~22:40:11), triggered by the user's factual question 'Where will the slides be saved?'. The system silently re-exercised draft + review tasks 9+ minutes into turn 3.

Why it matters

  • User asks for a slideshow → no slideshow produced for that turn.
  • Drift cascade fires GOAL_DRIFT sev=3 + HUMAN_INTERVENTION_REQUIRED sev=3 at the end of turn 1 (seq=21,22) — goldfive itself notices the situation but the run completes anyway.
  • Pattern repeats at the end of turn 3 (seq=115,116).

Proposed direction

The overlay's 'tree did not exercise' heuristic is too eager. Possible fixes:

  1. Don't mark downstream tasks NOT_NEEDED until the run is actually exiting (i.e., the coordinator has signaled completion or no-progress).
  2. Require multiple turns of inactivity before declaring a task NOT_NEEDED.
  3. Tie the heuristic to the structural plan: only reap tasks whose dependency chain has visibly stalled (no upstream RUNNING, no in-flight invocation).

Reference: the reason text mentions goldfive#16; that issue's old design may be load-bearing here.

Scope

This is the highest-priority functional regression from the v18 run. Pairs with #319 (judge cancellation, fixed) but is independent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions