Skip to content

Bug: Duplicate completion headers when consumer workflow has sub-workflows #8

@sfreudenthaler

Description

@sfreudenthaler

User Story

As a workflow maintainer using the claude-orchestrator, I want the orchestrator to handle consumer workflows with sub-workflows properly so that I don't get duplicate completion headers in PR comments.

Problem Description

When a consumer workflow (like deutschebank-infrastructure) uses the claude-orchestrator.yml@v1.0.0 and that consumer workflow has its own sub-workflows (audit artifact generation), the orchestrator generates duplicate completion headers.

Example of the duplicate output:

**Claude finished @sfreudenthaler's task** —— [View job](https://github.com/dotCMS/deutschebank-infrastructure/actions/runs/16233902403)

---
**Claude finished @sfreudenthaler's task** —— [View job](https://github.com/dotCMS/deutschebank-infrastructure/actions/runs/16233902403)

---
### Deutsche Bank Infrastructure Security Review...

Timeline & Root Cause

  • Issue started appearing ~2 hours ago during PR development
  • NOT related to changes in ai-workflows repo
  • Root cause: Started when consumer workflow added sub-workflows for audit artifact generation
  • Consumer workflow structure:
    jobs:
      claude-interactive:
        uses: dotCMS/ai-workflows/.github/workflows/claude-orchestrator.yml@v1.0.0
      
      claude-automatic-review:  
        uses: dotCMS/ai-workflows/.github/workflows/claude-orchestrator.yml@v1.0.0
        
      # These audit sub-workflows seem to trigger the duplicate headers
      create-audit-artifact-interactive:
        if: always()
        needs: [claude-interactive]
        uses: ./.github/workflows/create-audit-artifact.yml
        
      create-audit-artifact-automatic:
        if: always() 
        needs: [claude-automatic-review]
        uses: ./.github/workflows/create-audit-artifact.yml

Current Impact

  • Duplicate headers create noise in PR comments
  • Makes it harder for developers to find the actual review content
  • Affects user experience for busy developers who just want the review summary

Technical Tasks

Investigation Tasks

  • SPIKE: Determine how the orchestrator detects "completion" of consumer workflows
  • SPIKE: Identify if orchestrator monitors overall workflow completion vs individual job completion
  • SPIKE: Check if consumer sub-workflows trigger additional completion detection logic

Fix Implementation

  • Update orchestrator completion detection to handle consumer workflows with sub-workflows
  • Ensure completion header is generated only once per consumer workflow run
  • Add logic to distinguish between main orchestrator jobs and consumer sub-workflows
  • Test with both simple consumer workflows (no sub-workflows) and complex ones (with sub-workflows)

Testing & Validation

  • Test with deutschebank-infrastructure repo (has sub-workflows)
  • Test with simpler consumer repos (no sub-workflows) to ensure no regression
  • Verify completion headers appear exactly once regardless of consumer workflow complexity

Expected Behavior

  • Single completion header per consumer workflow run, regardless of sub-workflows
  • Consumer sub-workflows should not trigger additional completion detection
  • Maintain existing functionality for simple consumer workflows

Reference Links

Priority

Medium - Affects UX but doesn't break functionality. Would be nice to fix soon since it's creating noise for developers during reviews.


P.S. - My circuits are pretty confident this is a sub-workflow detection issue, not a coffee shortage in the orchestrator! ☕️🤖

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions