Repository navigation
Preserve harness retry telemetry in spans and usage artifacts - #71934
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
✅ Ponytail Reviewer completed successfully! Ponytail ReviewerOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. Design Decision Gate 🏗️Outcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality SentinelOutcome: The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible. Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
There was a problem hiding this comment.
Review summary
No actionable blocking issues found in the changed lines. The specialist pass was unavailable because its tool access was rejected; I completed the review from the pre-fetched diff and inspected the retry loop, span ownership, and artifact transport changes directly. No inline comments were warranted.
🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K
Comment /review to run again
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd and /grill-with-docs (per pr-triage classification: new_feature). Two inline findings posted; otherwise this is a solid, well-tested change.
📋 Key Themes & Highlights
Key Themes
- Architecture consistency: The ARC/DinD consolidation step for
harness_retry.jsonbypasses the existinggenerateArcDindArtifactConsolidationStephelper instead of extending it (see inline comment oncompiler_yaml_post_agent.go). - Edge-case coverage:
send_otlp_span.cjs's harness-retry telemetry guard doesn't explicitly reject records with anullexit_codemid-write, though this may be unreachable in practice given the conclusion-job-only read timing (see inline comment, flagged at moderate confidence).
Positive Highlights
- ✅
harness_retry_runner.cjsuses solid try/finally checkpointing with atomic write-then-rename telemetry persistence. - ✅ Test coverage across
harness_retry_runner.test.cjs,claude_harness.test.cjs, andsend_otlp_span.test.cjsis thorough — path resolution, cancellation, soft-deadline, write-failure non-fatal handling, and label filtering are all exercised. - ✅ Attribute label validation (
/^[a-z][a-z0-9_]{0,63}$/) guards against malformed telemetry propagating into OTEL spans. - ✅ Docs (
open-telemetry-attributes.mdx) were updated consistently with the new attributes.
Investigation Note
The diff (882 lines) and pr-triage output were used as primary evidence; cross-engine failure-classification differences (Claude/Codex use multi-class arrays, Copilot uses a single-element array) were investigated and judged to be pre-existing architecture rather than a new inconsistency introduced by this PR, so no inline comment was raised for it.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · ~152 AIC · ⌖ ~16 AIC · ⊞ 10.2K
Comment /matt to run again
There was a problem hiding this comment.
🟡 Changes recommended
Retry records are lost on supported sandbox configurations, and compiler changes leave golden fixtures out of sync.
3 open issues
What changed in this PR
This PR extends gh-aw’s execution telemetry to preserve harness retry history across Claude, Codex, and Copilot, addressing #71824.
Changes:
- Persist attempt counts, exit codes, and failure classes without making telemetry write failures fatal.
- Attach retry attributes to token-owning spans, including failures without token accounting.
- Carry retry records through artifacts and ARC/DinD collection, with tests and reference documentation.
| File | Description |
|---|---|
pkg/workflow/threat_detection_steps.go |
Collects and uploads detection retry records. |
pkg/workflow/threat_detection_steps_test.go |
Checks detection artifact inclusion. |
pkg/workflow/notify_comment.go |
Adds retry records to compact usage uploads. |
pkg/workflow/notify_comment_test.go |
Checks agent and detection usage paths. |
pkg/workflow/compiler_yaml_post_agent.go |
Adds agent artifact paths and ARC/DinD collection. |
pkg/workflow/compiler_yaml_artifacts.go |
Includes retry telemetry in fallback artifacts. |
pkg/workflow/compiler_artifacts_test.go |
Covers artifact paths and ARC/DinD copies. |
pkg/workflow/awf_arc_dind.go |
Exports a shared telemetry directory. |
pkg/workflow/awf_arc_dind_test.go |
Checks the shared-directory export. |
pkg/workflow/arc_dind_artifacts_test.go |
Checks shared-path detection collection. |
docs/src/content/docs/reference/open-telemetry-attributes.mdx |
Documents retry attributes and span ownership. |
actions/setup/sh/collect_usage_artifact_files.sh |
Copies retry records into compact usage artifacts. |
actions/setup/sh/collect_usage_artifact_files_test.sh |
Checks collection with and without retry records. |
actions/setup/js/send_otlp_span.test.cjs |
Covers ownership, phase isolation, and malformed records. |
actions/setup/js/send_otlp_span.cjs |
Emits retry counts and failure-class attributes. |
actions/setup/js/harness_retry_runner.test.cjs |
Covers persistence, cancellation, deadlines, and write failures. |
actions/setup/js/harness_retry_runner.cjs |
Resolves telemetry paths and checkpoints attempts. |
actions/setup/js/copilot_harness.cjs |
Enables persistence and records Copilot failure classes. |
actions/setup/js/codex_harness.cjs |
Enables persistence and records Codex failure classes. |
actions/setup/js/claude_harness.test.cjs |
Covers initial success, retried success, and exhaustion. |
actions/setup/js/claude_harness.cjs |
Enables persistence and records Claude failure classes. |
Review effort: Max
|
@copilot address the following outstanding work in one pass:
Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI. Sous-chef head: 99f1941
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
…es-telemetry Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
|
@copilot address the following outstanding work in one pass:
Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI. Sous-chef state: 6c91bfc9ff259c9d674c442d8f766022e30adfe08afaf87e9b0be7bf8392ece6
|
…es-telemetry Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Merged latest |
|
@copilot resolve the merge conflicts in this pull request |
…es-telemetry # Conflicts: # actions/setup/js/nvx_assets.test.cjs # pkg/workflow/wasm_golden_test.go Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Merged latest |
Resolve NVX loader and runtime-version test conflicts with the deterministic fixes from main while retaining harness retry telemetry coverage. Regenerate workflow locks from the merged sources. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Preserve the concurrent parser embed fix alongside the validated merge of main 99a4039. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Resolve compact-session projection assertions for both harness.retry and memory.push, and regenerate conflicted workflow locks from the merged compiler and workflow sources. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
🎉 This pull request is included in a new release. Release: |


Harness retries were visible only in job logs, leaving single-attempt and retried runs indistinguishable in telemetry—including failures with no token accounting.
gh-aw.harness.attemptsandgh-aw.harness.retry_reasonsonly on the span owning the job’s token usage, including exhausted runs without token data.Example attributes for success after two rate-limit failures:
{ "gh-aw.harness.attempts": 3, "gh-aw.harness.retry_reasons": [ "rate_limit_error", "rate_limit_error" ] }claude_harness.cjsdiscards the attempt count #71824