You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Safe-output comments cannot carry hidden machine-readable state because every HTML comment is stripped #67174
sanitize_content_core.cjs runs removeXmlComments on every safe-output body (add_comment and the others), so an agent or a post-agent step cannot store hidden, machine-readable state in a comment. gh-aw appends its own markers (<!-- gh-aw-agentic-workflow: ... -->, <!-- gh-aw-workflow-id: ... -->) after sanitization, so hidden markers are an accepted pattern internally but not available to workflow authors.
Use case
An on-demand review that supports -increment needs the commit the previous review covered. We ended every review comment with <!-- gh-aw--state: {"xxx_sha":"..."} --> and read it back from the PR's comment history (the cache-memory alternative does not persist for issue_comment-triggered runs). The marker was present in the agent's safe-output item and in the post-agent step's output, but absent from every comment GitHub stored, so every -increment request failed with "no baseline".
Reproduction
Running sanitizeContent (v0.91.1) on a body that ends with a hidden marker <!-- gh-aw-w-state: {"xxx_sha":"<sha>"} -->:
Marker form
Result after sanitization
<!-- ... -->
removed
[//]: # (...)
[//]: # (content dropped)
[label]: <https://...?x=<sha>>
URL replaced with a redacted placeholder
Visible line with the SHA in backticks
kept
Expected
One of:
a safe-output option that preserves HTML comments whose text starts with an allow-listed prefix (for example allow-html-comments: ["gh-aw-state:"]), still stripping everything else, or
a documented, supported way to attach hidden metadata to a safe-output comment.
If neither is wanted, the safe-outputs documentation should say that hidden markers are removed so authors do not rely on them.
Current-state refresher (2026-10-16): Partially addressed — supported structured state exists, but it is not hidden metadata.
The maintainer's latest question has a concrete answer: safe-outputs.data can carry the previous-review SHA, provided the workflow enables data (optionally with a schema) and the safe-output item supplies a data object. The current documentation describes this channel; the validator appends it as fenced JSON so it survives sanitization. Regression tests cover this behavior.
However, add-comment renders a visible “Structured data” JSON block, not an HTML comment. The sanitizer still removes HTML comments. Thus data addresses persistence/machine readability, not the exact hidden-state requirement.
#69437 is open as a draft with no changed files at inspection. Remaining decision: accept/document the visible structured-data approach or design a separate reviewed hidden-metadata mechanism. Static inspection; tests were read, not run.
Activity
pelikhan commentedon Oct 11, 2026
/scout research how to use safe-outputs data to store structured data in safe outputs
github-actions commentedon Oct 11, 2026
github-actions commentedon Oct 12, 2026
test body
pelikhan commentedon Oct 16, 2026
@copilot determine if the "data" feature in safe-outputs provide a solution for this.
pelikhan commentedon Oct 16, 2026
Current-state refresher (2026-10-16): Partially addressed — supported structured state exists, but it is not hidden metadata.
The maintainer's latest question has a concrete answer:
safe-outputs.datacan carry the previous-review SHA, provided the workflow enables data (optionally with a schema) and the safe-output item supplies adataobject. The current documentation describes this channel; the validator appends it as fenced JSON so it survives sanitization. Regression tests cover this behavior.However,
add-commentrenders a visible “Structured data” JSON block, not an HTML comment. The sanitizer still removes HTML comments. Thus data addresses persistence/machine readability, not the exact hidden-state requirement.#69437 is open as a draft with no changed files at inspection. Remaining decision: accept/document the visible structured-data approach or design a separate reviewed hidden-metadata mechanism. Static inspection; tests were read, not run.