Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions .agents/configs/simplification-state.json
Original file line number Diff line number Diff line change
Expand Up @@ -1754,9 +1754,9 @@
"pr": 13021
},
".agents/scripts/headless-runtime-helper.sh": {
"hash": "e296d8b5991af304b86dddc9088cee43b64b6848",
"at": "2026-04-08T02:39:29Z",
"passes": 26,
"hash": "9ad7ad779192ec16d43021b71ca1da104a0684fa",
"at": "2026-04-08T05:28:52Z",
"passes": 27,
"pr": 15086
},
".agents/scripts/issue-sync-lib.sh": {
Expand Down Expand Up @@ -1790,9 +1790,9 @@
"pr": 15455
},
".agents/scripts/pulse-wrapper.sh": {
"hash": "6acacb9eab7aa51d0d259ce5889bb133cb118ff4",
"at": "2026-04-08T04:51:04Z",
"passes": 56,
"hash": "1f97cd9546bc3887803876f60b43b60c3644840d",
"at": "2026-04-08T05:28:52Z",
"passes": 57,
"pr": 15086
},
".agents/scripts/schema-validator-helper.sh": {
Expand Down Expand Up @@ -5267,9 +5267,9 @@
"pr": 15490
},
"aidevops.sh": {
"hash": "b87d73e24891209a6993c57bd2938b2bc36e24e6",
"at": "2026-04-08T04:51:27Z",
"passes": 80,
"hash": "e2cc493eb82dcc50422d004716aa9e6c8a5be3c0",
"at": "2026-04-08T05:29:06Z",
"passes": 81,
"pr": 15470
},
"setup.sh": {
Expand Down
11 changes: 11 additions & 0 deletions .agents/scripts/gh-failure-miner-helper.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,17 @@ extract_failure_signature() {
local run_id="$2"
local logs
logs=$(gh run view "$run_id" --repo "$repo_slug" --log-failed 2>/dev/null || true)
if [[ -z "$logs" ]]; then
# Fallback: --log-failed returned empty (logs expired, rate-limited, or run still
# in progress). Try the jobs API to get the first failed job's logs directly.
# This avoids the "no_failed_log_output" signature which produces unhelpful clusters.
local failed_job_id
failed_job_id=$(gh api "repos/${repo_slug}/actions/runs/${run_id}/jobs" \
--jq '[.jobs[] | select(.conclusion == "failure")] | first | .id // empty' 2>/dev/null || true)
Comment on lines +174 to +175
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current jq query can result in an error if no failed jobs are found. When [.jobs[] | select(.conclusion == "failure")] produces an empty array, first returns null. The subsequent pipe to .id (null | .id) causes jq to error. Additionally, avoid suppressing stderr with 2>/dev/null as it can hide syntax or system errors. Use the fallback operator // to provide a default value and || true to prevent script exit if the command fails, ensuring diagnostic information remains visible.

Suggested change
failed_job_id=$(gh api "repos/${repo_slug}/actions/runs/${run_id}/jobs" \
--jq '[.jobs[] | select(.conclusion == "failure")] | first | .id // empty' 2>/dev/null || true)
failed_job_id=$(gh api "repos/${repo_slug}/actions/runs/${run_id}/jobs" \
--jq '[.jobs[] | select(.conclusion == "failure") | .id] | first // empty' || true)
References
  1. In jq, use the fallback operator // to provide a default value for expressions that might result in null.
  2. Avoid suppressing stderr with 2>/dev/null on commands like jq to ensure diagnostic information remains visible.

if [[ -n "$failed_job_id" ]]; then
logs=$(gh api "repos/${repo_slug}/actions/jobs/${failed_job_id}/logs" 2>/dev/null || true)
fi
fi
if [[ -z "$logs" ]]; then
printf '%s' "no_failed_log_output"
return 0
Expand Down
Loading