Skip to content

fix(automation): harden AI issue assistant output#1921

Open
openai0229 wants to merge 1 commit into
mainfrom
fix/1920-ai-issue-assistant-output
Open

fix(automation): harden AI issue assistant output#1921
openai0229 wants to merge 1 commit into
mainfrom
fix/1920-ai-issue-assistant-output

Conversation

@openai0229

Copy link
Copy Markdown
Contributor

Related issue

Closes #1920

Summary

Routes Issue Assistant Safe Outputs through the generated CLI proxy so the internal awmg-mcpg endpoint is not exposed as a native HTTP MCP transport. This follows the source-level workaround validated in upstream github/gh-aw#45915 without disabling the firewall or adding an invalid internal host to network.allowed.

Requires comment bodies to use the official JSON-on-stdin safeoutputs add_comment . contract with a single-quoted heredoc. The prompt now checks both the Chat2DB marker and generated gh-aw run footer for idempotency, verifies the exact marker before emission, and forbids Markdown in a shell --body argument.

Affected surfaces

  • Frontend / Web
  • Backend / API / Storage
  • Database plugin / Driver
  • JCEF / Desktop packaging
  • CI / Build / Release
  • Documentation only

Verification

  • Commands and results:
    • gh aw compile ai-issue-assistant --strict --validate -> passed with 0 errors and 0 warnings.
    • gh aw validate ai-issue-assistant --strict -> passed with 0 errors and 0 warnings.
    • Focused jq -e parse of the documented stdin JSON with Markdown backticks, a dollar sign, newlines, and the exact idempotency marker -> true.
    • git diff --check -> passed.
    • Optional gh aw compile ... --actionlint reached the generated workflow and reported only compiler-owned SC2016 on the single-quoted AWF $schema JSON line; strict compile and schema validation are green.
  • Manual verification: Confirmed the generated lock exports GH_AW_MCP_CLI_SERVERS='["safeoutputs"]' and loads cli_proxy_with_safeoutputs_prompt.md; no domain, Secret, model, provider, event, or GitHub permission changed. Live public-comment verification requires the next opened or reopened Issue after merge.
  • UI evidence: N/A; this changes GitHub automation output.

Risk and compatibility

  • Public API or stored data: N/A; no application API or stored-data contract changes.
  • Database or driver compatibility: N/A.
  • Network, privacy, or security: Keeps the firewall enabled and adds no allowed domain. Safe Outputs use the generated CLI proxy while the existing read-only agent and bounded write policy remain unchanged.
  • Community / Local / Pro boundary: Community repository automation only; product editions are unchanged.
  • Backward compatibility: Existing Issue triggers and safe-output limits remain unchanged. The next live Issue event should be audited for a clean footer and exact marker.

Reviewer map

  • Start here: .github/workflows/ai-issue-assistant.md, especially tools.cli-proxy and the Output Format contract.
  • Failure condition: A live Issue response still contains the awmgmcpg firewall warning, loses Markdown/newlines, omits the exact run marker, or emits more than one comment.
  • Rollback or disable path: Revert commit db42c9366abd5a1792552e68fc30a6eb806d163a; the workflow can also be disabled from GitHub Actions without changing application code.

Contributor declaration

  • I linked the Issue that defines this change.
  • I tested the affected behavior and reported the actual results above.
  • I did not include credentials, private data, or generated build output.
  • I disclosed substantial AI assistance below, or this PR contains no substantial AI-generated code.

AI assistance: Codex was used to inspect the two production runs, trace the upstream gh-aw transport issue, edit the workflow prompt, regenerate the lock workflow, and run the reported verification.

@openai0229

Copy link
Copy Markdown
Contributor Author

CI baseline note: the Frontend job in this PR stopped at the existing yarn test:i18n failure for stale es-ES/setting.ts and ko-KR/setting.ts source hashes. Current main@4f536447 failed on the same two files in run 29833555102 before this branch existed. This PR changes only the Issue Assistant source and generated lock workflow, so no localization repair is included. Backend packaging, repository checks, dependency review, SBOM generation, frontend license reporting, and JavaScript CodeQL have passed; Java CodeQL is still running.

@openai0229

Copy link
Copy Markdown
Contributor Author

Additional production evidence: creating Feature Issue #1920 triggered the current main Issue Assistant in run 29838085184. The run succeeded and the response content plus edition/community label were appropriate, but the public comment again appended the awmgmcpg firewall warning and again omitted <!-- chat2db-ai-issue:29838085184 -->. This third reproduction confirms that CLI proxy routing and the strengthened idempotency contract address recurring behavior rather than a one-off run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(automation): keep AI Issue Assistant comments clean and idempotent

1 participant