Post-agent log steps still create false `##[error]` annotations (follow-up to #78997)

Đang mở
#83,030 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
github-actions, javascript
Lĩnh vực
ci-cd

Hướng nghiên cứu

Start with collect_ndjson_output.cjs, parse_copilot_log.cjs, log_parser_bootstrap.cjs, and setup_globals.cjs to find every core.info path that emits agent-controlled text. Use the existing ::stop-commands::<token> pattern or a shared escaping helper, and consult the linked ActionCommand.cs behavior for how ##[ is detected. Done means agent output, transcripts, reasoning, and safe-output bodies containing ##[ remain literal and produce no false error annotations.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

ai-inspected
Summary

#80032 (released in v1.4.0) fixed #78997 for the AWF agent step by wrapping it in ::stop-commands::<token>. Two later actions/github-script steps in the agent job still print untrusted agent text without that protection:

  • collect_ndjson_output.cjs

  • parse_copilot_log.cjs (the core.info calls that print the rendered transcript and safe-outputs preview are in log_parser_bootstrap.cjs, lines 567, 573 and 607 in v1.4.2)

If the agent's output or transcript has a line that contains ##[error], the runner reads it as a workflow command. The position does not matter: the runner looks for ##[ anywhere in the line (IndexOf in ActionCommand.cs). Only :: commands have to come first, after optional whitespace. collect_ndjson_output.cjs logs agent text mid-line, for example [INGESTION] First 500 chars of output: ..., so escaping only at the start of a line would not be enough. A successful job then shows false error annotations.

Version

gh-aw v1.4.2 (lock files compiled with v1.4.2, github/gh-aw-actions/setup pinned to v1.4.2).

Also unfixed in v1.4.4 and on main as of 2026-12-01, from reading the source (not run there): collect_ndjson_output.cjs, parse_copilot_log.cjs, log_parser_bootstrap.cjs and setup_globals.cjs are unchanged from v1.4.2.

Steps to reproduce
  1. Create an issue whose body contains ##[error]some text.

  2. Run an agentic workflow (Copilot engine) that reads the issue with issue_read and quotes or discusses that text in its reasoning and in a safe output, such as add_comment.

  3. Open the agent job of the run.

Expected

No error annotations on the agent job. Agent text that contains ##[ is printed literally.

Actual

The agent job succeeds but shows 4 failure annotations whose messages are fragments of agent text:

  • 1 from the collect_ndjson_output.cjs step, which echoes the safe-output add_comment body.

  • 3 from the parse_copilot_log.cjs step, which prints the rendered transcript (assistant messages and reasoning).

The AWF step is fine. It is wrapped in ::stop-commands::***, and the tool.execution_complete JSONL lines are intact in the raw log.

Suggested fix

Apply the same protection to every step that prints untrusted content: tool output, agent messages, reasoning and safe-output bodies. For example:

  • wrap the output of collect_ndjson_output.cjs and parse_copilot_log.cjs (and any similar log or summary step) in ::stop-commands::<random token> ... ::<token>::, or

  • escape ##[ and leading :: in lines before passing them to core.info.

A shared helper in setup_globals.cjs would cover all github-script steps at once.

Ngôn ngữ chính
Go
Star
5.7k
Fork
646
Merge trung bình
4 giờ 29 phút
Pull request đã merge (30 ngày)
829

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của github/gh-aw

Tất cả issue của github/gh-aw

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.