Skip to content

Fix per-step precondition warning propagation (empty ArrayList collapsed to null by pipeline)#243

Merged
blindzero merged 2 commits intocodex/create-task-branch-for-codex-merge-conflictfrom
copilot/sub-pr-242
Feb 26, 2026
Merged

Fix per-step precondition warning propagation (empty ArrayList collapsed to null by pipeline)#243
blindzero merged 2 commits intocodex/create-task-branch-for-codex-merge-conflictfrom
copilot/sub-pr-242

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Feb 26, 2026

$plan.Steps[n].Warnings was always empty despite warnings being correctly appended to $plan.Warnings. Per-step warning tracking in ConvertTo-IdleWorkflowSteps silently no-oped because PowerShell's output pipeline collapses an empty ArrayList to $null when returned from a function — so Get-IdlePropertyValue(..., 'Warnings') returned $null before any warnings existed, making $planWarningsCanTrackCount false.

Changes

  • ConvertTo-IdleWorkflowSteps.ps1 — replace Get-IdlePropertyValue call for the plan Warnings sink with direct PSObject.Properties access (same pattern already used in ConvertTo-IdleWorkflowStepPreconditionSettings), which preserves the live ArrayList reference regardless of whether it is empty. Also tightened the guard to $planWarnings -is [System.Collections.IList].
# Before — collapses empty ArrayList to $null via pipeline unrolling
$planWarnings = Get-IdlePropertyValue -Object $PlanningContext.Plan -Name 'Warnings'
$planWarningsCanTrackCount = $null -ne $planWarnings -and $null -ne $planWarnings.PSObject.Properties['Count']

# After — direct property access preserves live reference
$planWarnings = $null
$planObj = $PlanningContext.Plan
if ($null -ne $planObj) {
    if ($planObj -is [System.Collections.IDictionary]) {
        if ($planObj.Contains('Warnings')) { $planWarnings = $planObj['Warnings'] }
    } else {
        $wProp = $planObj.PSObject.Properties['Warnings']
        if ($null -ne $wProp) { $planWarnings = $wProp.Value }
    }
}
$planWarningsCanTrackCount = $planWarnings -is [System.Collections.IList]

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@blindzero blindzero marked this pull request as draft February 26, 2026 16:58
…step

Co-authored-by: blindzero <13959569+blindzero@users.noreply.github.com>
Copilot AI changed the title [WIP] Reintegrate preconditions DSL and restore warning propagation Fix per-step precondition warning propagation (empty ArrayList collapsed to null by pipeline) Feb 26, 2026
@github-actions
Copy link
Copy Markdown

Code Coverage Report

Overall Project 73.91% 🍏

There is no coverage information present for the Files changed

@blindzero blindzero marked this pull request as ready for review February 26, 2026 17:19
@chatgpt-codex-connector
Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

Copy link
Copy Markdown
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

Fixes per-step precondition warning propagation during planning so that $plan.Steps[n].Warnings correctly reflects warnings appended to $plan.Warnings, even when the warnings list starts empty.

Changes:

  • Replaces Get-IdlePropertyValue usage for accessing the plan Warnings sink with direct property access to preserve the live ArrayList reference.
  • Tightens the tracking guard from “has Count property” to “is an IList”, matching the intent of list-based warning tracking.
Comments suppressed due to low confidence (1)

src/IdLE.Core/Private/ConvertTo-IdleWorkflowSteps.ps1:139

  • This block duplicates (and can drift from) both Get-IdlePropertyValue and the similar Warnings-sink extraction logic in ConvertTo-IdleWorkflowStepPreconditionSettings. Consider centralizing this into a small private helper (or adjusting Get-IdlePropertyValue to return empty collections without pipeline enumeration) so future fixes don’t need to be applied in multiple places.
        $planWarnings = $null
        $planObj = $PlanningContext.Plan
        if ($null -ne $planObj) {
            if ($planObj -is [System.Collections.IDictionary]) {
                if ($planObj.Contains('Warnings')) { $planWarnings = $planObj['Warnings'] }
            } else {
                $wProp = $planObj.PSObject.Properties['Warnings']
                if ($null -ne $wProp) { $planWarnings = $wProp.Value }
            }

@blindzero blindzero merged commit 01f518d into codex/create-task-branch-for-codex-merge-conflict Feb 26, 2026
9 checks passed
@blindzero blindzero deleted the copilot/sub-pr-242 branch February 27, 2026 20:04
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