AI Agents SDE Task Viewer
      • Context
      • Plan
      • Prd
  1. Home
  2. AgentSDE
  3. agent-core
  4. gh-499
  5. plan
  6. plan.md
plan.md(2.4 KB)· Apr 14, 2026· 2 min read
  • Summary
  • Files
  • Steps
  • Verification
  • Risks

Plan: E2E Targeted Workflow — Wait for Result#

Summary#

Modify .github/workflows/e2e-targeted.yml so the dispatch-e2e job polls the dispatched agent-core-e2e run to completion and fails the PR check if E2E tests fail. Currently the workflow fires-and-forgets, making the PR check cosmetic.

Files#

FileActionDescription
.github/workflows/e2e-targeted.ymlmodifyAdd poll-and-wait logic after dispatch; report E2E conclusion as job exit code

Steps#

  1. Add statuses: write permission to the workflow's permissions block — needed to create commit statuses reporting E2E results back to the PR.
  2. Capture the dispatched run ID — after gh workflow run, use gh run list --repo AgentSDE/agent-core-e2e --workflow=e2e.yml filtered by created timestamp to identify the specific run triggered by this dispatch. Use a short retry loop (up to ~60s) to handle the delay between dispatch and run creation.
  3. Poll the run to completion — use gh run watch <run-id> --repo AgentSDE/agent-core-e2e --exit-status to block until the run finishes. Set a timeout-minutes on the job (30 min) as a safety cap.
  4. Fail on non-success conclusion — gh run watch --exit-status exits non-zero if the run fails or is cancelled, which will fail the job automatically. Capture the conclusion for the status message.
  5. Post commit status to the PR — use gh api repos/AgentSDE/agent-core/statuses/${{ github.event.pull_request.head.sha }} to create a commit status with the E2E conclusion (success/failure), linking to the dispatched run URL.
  6. Handle concurrent dispatches — each dispatch captures its own run ID by filtering on a unique identifier (timestamp window + module list). Each job instance tracks only its own run.

Verification#

  • Open a PR touching src/invoke/** → workflow dispatches E2E, waits, and reports pass/fail as a commit status on the PR.
  • If E2E fails, the dispatch-e2e job shows red — not green.
  • Two concurrent PRs each track their own dispatched run independently.

Risks#

  • Run identification race: Between dispatch and gh run list, another dispatch could create a run. Mitigated by filtering on a narrow timestamp window and the specific workflow.
  • E2E concurrency queue: agent-core-e2e has cancel-in-progress: false, so queued runs may take longer. The 30-min timeout handles this.
ContextPrd