发布

  • feat(github): fix security/quality findings and ship PRs with auto-detected coding agents (#4597)

    frostbyte_neo 发布于 2026-08-03 19:56:43 +00:00

    • feat(github): fix security/quality findings and ship PRs with auto-detected coding agents

    Add the fix_github_security_alert action tool: resolve a Dependabot,
    code-scanning, or Code Quality finding, fix it in the local checkout
    (built-in ruff fixers first), and optionally commit/push a fresh
    opensre/github-security-fix-* branch and open a PR.

    Make the coding-agent seam multi-backend and zero-config: CODING_AGENT
    now defaults to auto, which picks the first ready backend among Pi,
    Claude Code (claude -p acceptEdits), and Codex (codex exec
    workspace-write). Shared machinery moves to leaf modules
    (integrations/llm_cli/agent_exec.py, integrations/git/worktree_capture.py)
    and the Pi client is refactored onto them; tests migrated in the same
    change. When no agent is ready the tool now returns one actionable line
    instead of a vague coding-agent-fallback message.

    Co-Authored-By: Claude Fable 5 noreply@anthropic.com

    • fix(ci): restore import-linter ignores and harden coding-agent cleanup

    Drop stale fix_sentry_issue.pr ignore_imports (module removed) and allow
    ship → pull_requests. Skip the F401 line-delete fallback after Ruff rewrites
    the file, and terminate coding-agent process groups on timeout.

    • fix(github): use public UI URLs for Code Quality findings

    The findings API returns only an authenticated api.github.com url
    (html_url is null). Synthesize github.com/security/quality/findings/{n}
    so tasks, PR bodies, and tool responses never link to a 401 API endpoint.

    • fix: repair CI for PR #4597 - ## Summary

    Summary

    Root cause: test_run_pi_coding_task_timeout drives the timeout path in poll_agent_process, which calls _signal_process_group (integrations/llm_cli/agent_exec.py:121). That function reads proc.pid, but the test's _FakePopen stand-in never defined a pid attribute → AttributeError.

    Change (1 file):

    • tests/integrations/test_pi.py — added self.pid: int | None = None to _FakePopen.__init__. With pid=None, _signal_process_group skips the os.killpg branch and uses its documented terminate()/kill() fallback, which the fake implements. This also guarantees tests never signal a real process group.

    No production code was touched — the pid is not None guard in agent_exec.py already handles this case correctly; the fake was just incomplete.

    Verification:

    • uv run python -m pytest tests/integrations/test_pi.py -q → 11 passed, 1 skipped (opt-in live test)
    • ruff check + ruff format --check on the edited file → clean

    Per instructions, I did not commit or push; the fix is in the working tree alongside your other uncommitted changes.

    Generated by OpenSRE from https://github.com/Tracer-Cloud/opensre/pull/4597.

    • feat(github): add PR CI fixer and harden agent commit subjects

    Add fix_github_pr_ci to inspect failing Actions checks, run an
    auto-detected coding agent, and push fixes to the existing PR branch.
    Skip cancelled sibling checks, sanitize markdown headings out of commit
    subjects, and make process-group cleanup tolerate test doubles without pid.

    • feat(git): stamp OpenSRE co-author trailer on agent commits

    Ensure local commits and CI formula/readme bump commits include the
    OpenSRE Agent trailer so agent-authored changes stay attributable.

    • fix(config): track OpenSRE commit co-author constants

    The git helpers import these trailers; keep the constants module in the
    repo so the branch stays importable after the co-author stamp landed.

    • fix(ci): unblock PR #4597 test failures

    Compress github_cli skill guidance under the registry char budget,
    classify fix_github_pr_ci for Sentry telemetry coverage, and refresh
    the action-system prompt characterization snapshot.


    Co-authored-by: Claude Fable 5 noreply@anthropic.com

    下载附件