Skip to content

feat: update gh-aw-metadata payload to v3 with agent id/model and detection agent id/model#21899

Merged
pelikhan merged 2 commits intomainfrom
copilot/update-gh-aw-metadata-payload
Mar 20, 2026
Merged

feat: update gh-aw-metadata payload to v3 with agent id/model and detection agent id/model#21899
pelikhan merged 2 commits intomainfrom
copilot/update-gh-aw-metadata-payload

Conversation

Copy link
Contributor

Copilot AI commented Mar 20, 2026

Summary

Updates the gh-aw-metadata comment embedded in compiled lock files from schema v2 to v3, adding four new fields to capture the configured agent and detection agent information at compile time.

New Metadata Format (v3)

# gh-aw-metadata: {"schema_version":"v3","frontmatter_hash":"...","strict":true,"agent_id":"copilot","agent_model":"gpt-5","detection_agent_id":"copilot","detection_agent_model":"gpt-5.1-codex-mini"}

New Fields (all omitempty)

Field Description
agent_id Engine/agent identifier (e.g., "copilot", "claude", "codex")
agent_model Statically configured model for the agent (omitted if using runtime env var)
detection_agent_id Detection engine identifier (omitted if using default/main engine)
detection_agent_model Detection engine model (omitted if not explicitly configured)

Changes

  • pkg/workflow/lock_schema.go: Added LockSchemaV3 constant, added it to SupportedSchemaVersions, added 4 new omitempty JSON fields to LockMetadata, added AgentMetadataInfo struct, updated GenerateLockMetadata to use v3 and accept agent info
  • pkg/workflow/compiler_yaml.go: Updated call site to extract agent/detection info from WorkflowData (prefers EngineConfig.ID, falls back to legacy AI field; detection info comes from SafeOutputs.ThreatDetection.EngineConfig)
  • pkg/workflow/lock_schema_test.go: Updated tests for v3 as current schema, added tests for new agent fields, updated "unsupported future version" test cases to use v4
  • 177 workflow lock files recompiled to emit v3 metadata

Backward Compatibility

  • v1 and v2 lock files continue to parse and validate correctly
  • New fields are omitempty — existing v3 files without agent fields are still valid
  • IsSchemaVersionSupported now returns true for v1, v2, and v3

Copilot AI and others added 2 commits March 20, 2026 03:08
…on_agent_id, detection_agent_model fields

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/d752e56f-f08b-4618-9f8e-c146acee1c63
Copilot AI requested a review from pelikhan March 20, 2026 03:30
@pelikhan pelikhan marked this pull request as ready for review March 20, 2026 03:48
Copilot AI review requested due to automatic review settings March 20, 2026 03:48
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the embedded gh-aw-metadata header in compiled workflow lock files from schema v2 to v3, adding agent and detection-agent identifiers/models captured at compile time.

Changes:

  • Introduces LockSchemaV3 and extends LockMetadata with agent/detection-agent fields; updates supported schema versions.
  • Updates YAML compilation to populate agent metadata from WorkflowData and emit v3 metadata.
  • Updates lock schema tests for v3 and adds coverage for the new metadata fields; recompiles workflow lock files to emit v3 metadata.

Reviewed changes

Copilot reviewed 180 out of 180 changed files in this pull request and generated 1 comment.

File Description
pkg/workflow/lock_schema.go Adds schema v3 and new metadata fields; updates metadata generation to emit v3 and include agent info.
pkg/workflow/compiler_yaml.go Extracts agent/detection-agent info from workflow data and passes it into lock metadata generation.
pkg/workflow/lock_schema_test.go Updates schema/version expectations to v3 and adds tests for agent metadata JSON (omitempty + extraction).
.github/workflows/*.lock.yml Recompiled lock files to emit v3 gh-aw-metadata (and includes other regenerated workflow content in places).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 1557 to +1564
- name: Add the 'smoked' label to the current pull request
id: action_add_smoked_label
if: steps.process_safe_outputs.outputs.action_add_smoked_label_payload != ''
uses: actions-ecosystem/action-add-labels@18f1af5e3544586314bbe15c0273249c770b2daf # v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
labels: ${{ fromJSON(steps.process_safe_outputs.outputs.action_add_smoked_label_payload).labels }}
number: ${{ fromJSON(steps.process_safe_outputs.outputs.action_add_smoked_label_payload).number }}
payload: ${{ steps.process_safe_outputs.outputs.action_add_smoked_label_payload }}
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generated step passes the safe-outputs action payload as a single payload input to actions-ecosystem/action-add-labels, but the safe-output action handler exports a JSON object of action inputs (see actions/setup/js/safe_output_action_handler.cjs docs) that is typically consumed via fromJSON(...).<input>. Unless this third-party action explicitly supports a payload input, the step likely won’t receive required inputs (e.g., labels/issue number) and may fail or no-op. Consider reverting to per-input mapping from the JSON output (or switching uses: to an action that accepts a JSON payload).

Copilot uses AI. Check for mistakes.
@pelikhan pelikhan merged commit 210dad8 into main Mar 20, 2026
93 checks passed
@pelikhan pelikhan deleted the copilot/update-gh-aw-metadata-payload branch March 20, 2026 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants