Skip to content

[code-simplifier] simplify: remove redundant variables in query-discussions.py and add_workflow_run_comment.cjs #47696

Description

@github-actions

Caution

Protected files were modified in this change.
This pull request is in request_review mode and requires explicit human scrutiny before merge.

Protected files: .github/skills/github-discussion-query/query-discussions.py

Summary

Targeted simplifications from the code-simplifier agent run on 2026-07-24. Behavior is preserved exactly.

Files Simplified

.github/skills/github-discussion-query/query-discussions.py

  • Hoisted data_size = len(data) before the try/except block, eliminating the duplicate assignment in both branches
  • Inlined the single-use result variable in main() — removed two intermediate assignments

actions/setup/js/add_workflow_run_comment.cjs

  • Inlined the single-use normalizedWorkflowNameOverride variable in buildCommentBody() — the value was assigned and used only once on the next line

Source References

Candidate files sourced from deterministic pre-processing (recent-context.json, source-files.json). Recent related PRs: #47598 (dead-code removal), #47637 (conformance gaps).

Validation

  • make test-unit ✅ (no changed Go files, JS tests skipped — changes are Python/JS utility files)
  • make build
  • make lint ✅ (24 pre-existing warnings, 0 errors — no new issues introduced)

Token-Efficiency Notes

Used deterministic pre-computed files from /tmp/gh-aw/agent/code-simplifier/. Ran scope-filter and simplification-scout sub-agents (claude-haiku-4.5) to narrow candidates before editing. Only low-risk, in-file simplifications were applied.

Generated by 🔧 Code Simplifier · sonnet46 · 87 AIC · ⌖ 8.97 AIC · ⊞ 5.6K ·

  • expires on Jul 24, 2026, 8:26 PM UTC-08:00

Note

This was originally intended as a pull request, but the git push operation failed.

Original error: pushSignedCommits: refusing unsigned push for branch 'simplify/code-simplifier-2026-07-24-562e3f42965739f5': Signed-commit payload violates file-protection policy (request_review): .github/skills/github-discussion-query/query-discussions.py

Workflow Run: View run details and download bundle artifact

The bundle file is available in the agent artifact in the workflow run linked above.

To create a pull request with the changes:

# Download the artifact from the workflow run
gh run download 30066377718 -n agent -D /tmp/agent-30066377718

# Fetch the bundle into a temporary ref, then update the local branch
git fetch /tmp/agent-30066377718/aw-simplify-code-simplifier-2026-07-24.bundle refs/heads/simplify/code-simplifier-2026-07-24:refs/bundles/create-pr-simplify-code-simplifier-2026-07-24-562e3f42965739f5-704e43af
git update-ref refs/heads/simplify/code-simplifier-2026-07-24-562e3f42965739f5 refs/bundles/create-pr-simplify-code-simplifier-2026-07-24-562e3f42965739f5-704e43af
git checkout simplify/code-simplifier-2026-07-24-562e3f42965739f5
# Ensure the working tree matches the updated branch
git reset --hard
# Remove the temporary bundle ref
git update-ref -d refs/bundles/create-pr-simplify-code-simplifier-2026-07-24-562e3f42965739f5-704e43af

# Push the branch to origin
git push origin simplify/code-simplifier-2026-07-24-562e3f42965739f5

# Create the pull request
gh pr create --title '[code-simplifier] simplify: remove redundant variables in query-discussions.py and add_workflow_run_comment.cjs' --base main --head simplify/code-simplifier-2026-07-24-562e3f42965739f5 --repo github/gh-aw

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions