Skip to content

Correlate per-child subagent progress and preserve pipeline accounting #125

Description

@rochecompaan

Parent: #116

Depends on #123 and #124.

Outcome

Patchmill correlates authoritative parent-session entries to the requested subagent children, preserves one observation opportunity per child, and leaves existing parent-level accounting and pipeline progression intact.

Scope

  • Parse and validate patchmill-subagent-progress custom entries from the exact parent session.
  • Inventory child requests using the adopted pi-subagents execution-shape contract:
    • simultaneous nonempty chain and tasks is invalid;
    • exactly one aggregate mode ignores top-level agent;
    • otherwise use direct mode.
  • Correlate by parent tool-call ID and child index.
  • Suppress exact duplicate metadata tuples while emitting an additional observation for every changed authoritative tuple without replacing earlier output.
  • Emit exactly one unresolved fallback for every child that receives no authoritative tuple.
  • Preserve independent visibility for failed and unresolved children.
  • Count one parent toolCalls accounting unit per parent toolCallId, regardless of child update count.
  • Preserve implementation todo refresh from subagent progress.
  • Preserve async and terminal fallback cardinality.

Fallback data boundary

Synthetic unresolved-child fallbacks are task-free, agent-only progress observations. They remain outside LLM context and contain no task text, child output, prompts, credentials, full result objects, or unrestricted result metadata.

Out of scope

  • Pi lifecycle hook implementation.
  • Session-file ownership and command cancellation.
  • Console line formatting.
  • Enriching triage output.

Acceptance criteria

  • Direct, counted, parallel, and chain requests produce the expected child inventory.
  • Conflicting aggregate modes do not produce a guessed inventory.
  • Exact duplicate tuples are suppressed per parent call and child while each changed authoritative tuple emits an additional observation.
  • Every child without an authoritative tuple receives exactly one task-free, agent-only fallback outside LLM context.
  • Parent toolCalls accounting remains one unit per parent tool call.
  • Implementation todos can advance from child progress before the parent tool finishes.
  • Production runPiPrompt() wiring is covered, not only helper-level fixtures.

Planning constraints

This issue owns one focused correlation/accounting PR. Its spec and plan supersede only the child-inventory, session-entry parsing, gating, fallback, accounting, and pipeline-progression portions of the deprecated monolithic plan referenced by #116.

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