Skip to content

fix(#73): resolve a traversed ancestor's call in its shared workflow - #139

Merged
jctanner merged 1 commit into
mainfrom
agent/73-cross-call-status-ancestors
Dec 4, 2026
Merged

jctanner merged 1 commit into
mainfrom
agent/73-cross-call-status-ancestors

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Summary

success() and failure() check every ancestor of a job. When one of those ancestors is a job from a reusable-workflow call, _ancestors in src/app/services/workflow_scheduler.py counts the call itself (with the call's result) instead of the individual called job. It finds the call by looking up the job key with a prefix. That prefix was always the decided job's own (B / for B / leaf). So when the dependency path went into a different call (A -> middle -> B), A / optional wasn't counted as A. B / leaf saw a job that was skipped by its own if:, treated it as unsuccessful, and was skipped. On GitHub it runs.

Changes

  • src/app/services/workflow_scheduler.py: the new helper _scopes lists the workflow prefixes that enclose a job key, innermost first. _ancestors now looks up each ancestor's call using the longest of those prefixes that the ancestor's key starts with, which is the innermost workflow the ancestor shares with the decided job. Lookups that stay inside the decided job's own called workflow, or go into calls nested in it, give the same result as before.
  • tests/actions/test_reusable_caller_needs.py: new test for A -> middle -> B. A has one successful job and one skipped by its own if:, and B / leaf uses if: success(). It failed before the fix (B / leaf was skipped) and passes after.
  • docs/bugs/fixed/job-needing-a-reusable-workflow-caller-waits-forever.md: added this case to the ledger entry.

Testing

  • uv run pytest tests/actions/test_reusable_caller_needs.py tests/actions/test_skipped_reusable_caller.py tests/actions/test_workflow_call_fidelity.py: 55 passed.
  • uv run pytest tests/actions: 733 passed, 1 failed. The failure is test_runner_shutdown.py::test_a_shutdown_signal_fails_the_running_step_and_stops_its_processes, which also fails on unmodified main and has nothing to do with this change.
  • pre-commit couldn't fetch its hook repositories in the sandbox (HTTP 403). I ran ruff check (0.17.3), the trailing-whitespace and end-of-file checks, and the secret scan directly, and they passed.

🤖 Generated with Claude Code


Closes #73

Post-script verification

  • Branch is not main/master (agent/73-cross-call-status-ancestors)
  • Secret scan passed (gitleaks — fdad287855ddb6f1e85a045e407b1f09948ade1c..HEAD)
  • PR body secret scan passed (gitleaks — no-git)
  • Final PR description secret scan passed (gitleaks — no-git)

success() and failure() read every ancestor, and _ancestors counts a
called job reached through another job as its caller. The caller was
looked up only with the prefix of the job being decided, so for
A -> middle -> B (A and B reusable calls) B / leaf looked up
A / optional with the prefix "B / ", did not count it as A, and saw
the job skipped by its own if: as an unsuccessful ancestor. B / leaf
on if: success() was skipped; on GitHub it runs.

Each ancestor is now resolved in the innermost workflow it shares with
the decided job: the longest of the job's enclosing prefixes (new
helper _scopes) that the ancestor key starts with. Jobs in the decided
job's own called workflow and nested calls inside it resolve as before.

Adds a test for A -> middle -> B with an optional skipped job in A and
a success() job in B, and records the case in the bug ledger.

Note: pre-commit could not fetch hook repositories in the sandbox
(HTTP 403). ruff 0.17.3 check, whitespace/end-of-file checks and the
secret scan were run directly and passed. In tests/actions,
test_runner_shutdown.py fails on main too and is unrelated.

Closes #73

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Triggers review agent dispatch label Dec 3, 2026
@fullsend-ai-review

fullsend-ai-review Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 10:48 PM UTC · Completed 10:54 PM UTC

Commit: 31180c3 · View workflow run →

Runtime: pi · Model: sonnet → claude-sonnet-5-5 · Effort: high · Cost: $0.96

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Dec 3, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Small 3-file bug fix aligning directly with issue #73 and backed by new tests, but scored moderate due to moderate churn in the workflow scheduler and unflagged behavioral modification.

@fullsend-ai-review

fullsend-ai-review Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Looks good to me


Labels: PR is a bug fix in the workflow scheduler.

@fullsend-ai-review fullsend-ai-review Bot added ready-for-merge All reviewers approved — ready to merge bug Something isn't working labels Dec 3, 2026
@jctanner
jctanner merged commit 55571e8 into main Dec 4, 2026
85 of 86 checks passed
@jctanner
jctanner deleted the agent/73-cross-call-status-ancestors branch December 4, 2026 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready-for-merge All reviewers approved — ready to merge ready-for-review Triggers review agent dispatch risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Status functions across two reusable-workflow calls read a skipped called job instead of the call's result

1 participant