Conversation
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
…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
There was a problem hiding this comment.
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
LockSchemaV3and extendsLockMetadatawith agent/detection-agent fields; updates supported schema versions. - Updates YAML compilation to populate agent metadata from
WorkflowDataand 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.
| - 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 }} |
There was a problem hiding this comment.
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).
Summary
Updates the
gh-aw-metadatacomment embedded in compiled lock files from schemav2tov3, adding four new fields to capture the configured agent and detection agent information at compile time.New Metadata Format (v3)
New Fields (all
omitempty)agent_id"copilot","claude","codex")agent_modeldetection_agent_iddetection_agent_modelChanges
pkg/workflow/lock_schema.go: AddedLockSchemaV3constant, added it toSupportedSchemaVersions, added 4 newomitemptyJSON fields toLockMetadata, addedAgentMetadataInfostruct, updatedGenerateLockMetadatato use v3 and accept agent infopkg/workflow/compiler_yaml.go: Updated call site to extract agent/detection info fromWorkflowData(prefersEngineConfig.ID, falls back to legacyAIfield; detection info comes fromSafeOutputs.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 v4Backward Compatibility
omitempty— existing v3 files without agent fields are still validIsSchemaVersionSupportednow returnstruefor v1, v2, and v3