Skip to content

chore: sync workflow templates - #128

Merged
stranske merged 2 commits into
mainfrom
sync/workflows-13e4f1e21f38
Jan 8, 2026
Merged

chore: sync workflow templates#128
stranske merged 2 commits into
mainfrom
sync/workflows-13e4f1e21f38

Conversation

@stranske

@stranske stranske commented Jan 8, 2026

Copy link
Copy Markdown
Owner

Sync Summary

Files Updated

  • agents-verify-to-issue.yml: Verify to issue - creates follow-up issues from verification feedback (Phase 4E)
  • agents-auto-label.yml: Auto-label - suggests/applies labels based on semantic matching (Phase 5A)
  • agents-capability-check.yml: Capability check - pre-flight agent feasibility gate (Phase 3A)
  • agents-decompose.yml: Task decomposition - breaks large issues into sub-tasks (Phase 3B)
  • agents-dedup.yml: Duplicate detection - flags similar open issues (Phase 3C)
  • issue_formatter.py: Issue formatter - converts raw text to AGENT_ISSUE_TEMPLATE format

Files Skipped

  • pr-00-gate.yml: File exists and sync_mode is create_only
  • ci.yml: File exists and sync_mode is create_only
  • dependabot.yml: File exists and sync_mode is create_only

Review Checklist

  • CI passes with updated workflows
  • No repo-specific customizations were overwritten

Source: stranske/Workflows
Manifest: .github/sync-manifest.yml

Automated sync from stranske/Workflows
Template hash: 13e4f1e21f38

Changes synced from sync-manifest.yml
Copilot AI review requested due to automatic review settings January 8, 2026 03:35
@stranske stranske added sync Automated sync from Workflows automated Automated sync from Workflows labels Jan 8, 2026
@github-actions

github-actions Bot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

⚠️ Action Required: Unable to determine source issue for PR #128. The PR title, branch name, or body must contain the issue number (e.g. #123, branch: issue-123, or the hidden marker ).

@github-actions

github-actions Bot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

🤖 Keepalive Loop Status

PR #128 | Agent: Codex | Iteration 0/5

Current State

Metric Value
Iteration progress [----------] 0/5
Action wait (missing-agent-label)
Disposition skipped (transient)
Gate success
Tasks 0/9 complete
Keepalive ❌ disabled
Autofix ❌ disabled

🔍 Failure Classification

| Error type | infrastructure |
| Error category | resource |
| Suggested recovery | Confirm the referenced resource exists (repo, PR, branch, workflow, or file). |

@github-actions github-actions Bot added the autofix Let bots format/lint automatically label Jan 8, 2026
@github-actions github-actions Bot added the autofix:patch Autofix patch available label Jan 8, 2026
@github-actions

github-actions Bot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Status | ✅ no new diagnostics
History points | 0
Timestamp | 2026-01-08 03:37:38 UTC
Report artifact | autofix-report-pr-128
Remaining | ∅
New | ∅
No additional artifacts

@github-actions

github-actions Bot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

Autofix updated these files:

  • scripts/langchain/issue_formatter.py

@github-actions github-actions Bot removed the autofix:patch Autofix patch available label Jan 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR syncs workflow templates from the stranske/Workflows repository, introducing five new agent-based workflows and a minor formatting improvement to issue_formatter.py. The workflows implement various automation features for issue and PR management using LLM-based analysis.

Key Changes:

  • Added five new agent workflow files implementing issue processing automation (verify-to-issue, auto-label, capability check, decomposition, duplicate detection)
  • Minor formatting fix in issue_formatter.py adding proper import grouping per PEP 8
  • All workflows follow consistent patterns using Python scripts embedded via heredoc or -c flag with environment variable passing

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
scripts/langchain/issue_formatter.py Adds blank line between third-party and local imports (PEP 8 compliance)
.github/workflows/agents-verify-to-issue.yml Creates follow-up issues from PR verification feedback via label trigger
.github/workflows/agents-auto-label.yml Suggests and auto-applies labels using semantic similarity matching
.github/workflows/agents-capability-check.yml Pre-flight gate checking if agents can complete assigned tasks
.github/workflows/agents-decompose.yml Breaks down large issues into manageable sub-tasks using LLM
.github/workflows/agents-dedup.yml Detects and flags potential duplicate issues via embeddings


- name: Create follow-up issue
id: create-issue
if: steps.check-merged.outputs.merged == 'true'

Copilot AI Jan 8, 2026

Copy link

Choose a reason for hiding this comment

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

When no verification comment is found, the extract step calls core.setFailed() but subsequent steps don't check if extraction was successful. They only check if the PR is merged. This means steps 3-5 will attempt to run even when extraction failed, potentially causing errors when trying to access undefined outputs. Consider adding a check for steps.extract.outcome == 'success' to the conditionals of subsequent steps, or use 'return' to exit early without failing the step.

Suggested change
if: steps.check-merged.outputs.merged == 'true'
if: steps.check-merged.outputs.merged == 'true' && steps.extract.outcome == 'success'

Copilot uses AI. Check for mistakes.
Comment on lines +100 to +101
with open('../open_issues.json') as f:
issues_data = json.load(f)

Copilot AI Jan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The file read operation doesn't include error handling. If the file doesn't exist or contains invalid JSON, the workflow will fail with an unclear error. Consider adding a try-except block with a descriptive error message to make debugging easier.

Suggested change
with open('../open_issues.json') as f:
issues_data = json.load(f)
try:
with open('../open_issues.json') as f:
issues_data = json.load(f)
except FileNotFoundError:
print('::warning::open_issues.json not found; skipping duplicate detection')
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
f.write('has_duplicates=false\n')
sys.exit(0)
except json.JSONDecodeError as e:
print(f'::error::Failed to parse open_issues.json as JSON: {e}')
sys.exit(1)

Copilot uses AI. Check for mistakes.
Comment on lines +79 to +80
tasks = open('../tasks.md').read()
acceptance = open('../acceptance.md').read()

Copilot AI Jan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The file read operations don't include error handling. If the files don't exist or contain invalid data, the workflow will fail with an unclear error. Consider adding a try-except block with a descriptive error message to make debugging easier.

Suggested change
tasks = open('../tasks.md').read()
acceptance = open('../acceptance.md').read()
try:
with open('../tasks.md', 'r', encoding='utf-8') as f:
tasks = f.read()
with open('../acceptance.md', 'r', encoding='utf-8') as f:
acceptance = f.read()
except OSError as e:
print(f'::error::Failed to read input files: {e}')
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
f.write('check_failed=true\n')
sys.exit(1)

Copilot uses AI. Check for mistakes.

permissions:
contents: read
issues: write

Copilot AI Jan 8, 2026

Copy link

Choose a reason for hiding this comment

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

This workflow uses the label_matcher.py script which performs embedding-based similarity matching, but it's missing the 'models: read' permission that other similar workflows (agents-dedup.yml, agents-decompose.yml, agents-capability-check.yml) include. If the embedding provider requires this permission, the workflow may fail. Consider adding 'models: read' to the permissions block for consistency.

Suggested change
issues: write
issues: write
models: read

Copilot uses AI. Check for mistakes.
title: '[Follow-up] Address verification concerns from PR #' + prNumber,
body: issueBody,
labels: ['follow-up', 'agents:optimize']
});

Copilot AI Jan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The JSON.parse call uses a template literal that directly interpolates step outputs without validation. If the step output contains special characters or malformed JSON, this could cause a runtime error. Consider using process.env with proper error handling instead, similar to how other parts of the workflow handle multi-line content.

Copilot uses AI. Check for mistakes.
Comment on lines +164 to +166
with:
script: |
const autoApplyLabels = JSON.parse('${{ steps.match.outputs.auto_apply_labels }}');

Copilot AI Jan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The JSON.parse call uses a template literal to directly parse step outputs. If the auto_apply_labels output contains special characters or is malformed, this will cause a runtime error. Consider using a safer parsing approach with try-catch error handling or accessing the value through process.env.

Suggested change
with:
script: |
const autoApplyLabels = JSON.parse('${{ steps.match.outputs.auto_apply_labels }}');
env:
AUTO_APPLY_LABELS: ${{ steps.match.outputs.auto_apply_labels }}
with:
script: |
let autoApplyLabelsRaw = process.env.AUTO_APPLY_LABELS;
let autoApplyLabels;
try {
autoApplyLabels = JSON.parse(autoApplyLabelsRaw || '[]');
} catch (error) {
core.setFailed(`Failed to parse AUTO_APPLY_LABELS: ${error}`);
return;
}

Copilot uses AI. Check for mistakes.
Comment on lines +205 to +206
const suggestedLabels = JSON.parse('${{ steps.match.outputs.suggested_labels }}');
const autoApplied = JSON.parse('${{ steps.match.outputs.auto_apply_labels }}');

Copilot AI Jan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The JSON.parse call uses a template literal to directly parse step outputs. If the suggested_labels output contains special characters or is malformed, this will cause a runtime error. Consider using a safer parsing approach with try-catch error handling or accessing the value through process.env.

Copilot uses AI. Check for mistakes.
from scripts.langchain.task_decomposer import decompose_task

# Read issue context
context = open('../issue_context.md').read()

Copilot AI Jan 8, 2026

Copy link

Choose a reason for hiding this comment

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

The file read operation doesn't include error handling. If the file doesn't exist or contains invalid data, the workflow will fail with an unclear error. Consider adding a try-except block with a descriptive error message to make debugging easier.

Suggested change
context = open('../issue_context.md').read()
try:
with open('../issue_context.md', 'r', encoding='utf-8') as f:
context = f.read()
except Exception as e:
print(f'::error::Failed to read issue context from ../issue_context.md: {e}')
sys.exit(1)

Copilot uses AI. Check for mistakes.
Comment on lines +93 to +98
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
f.write('check_failed=false\n')
f.write(f'recommendation={result.recommendation}\n')
f.write(f'blocked_count={len(result.blocked_tasks)}\n')
f.write(f'partial_count={len(result.partial_tasks)}\n')
f.write(f'result_json={json.dumps(result_dict)}\n')

Copilot AI Jan 8, 2026

Copy link

Choose a reason for hiding this comment

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

Writing complex JSON directly to GITHUB_OUTPUT and then parsing it through YAML interpolation could cause issues if the JSON contains special characters that interfere with YAML parsing. Consider using a file-based approach (write to a file, then read from that file) for complex data structures, similar to how duplicates.json and subtasks.md are handled in other workflows.

Suggested change
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
f.write('check_failed=false\n')
f.write(f'recommendation={result.recommendation}\n')
f.write(f'blocked_count={len(result.blocked_tasks)}\n')
f.write(f'partial_count={len(result.partial_tasks)}\n')
f.write(f'result_json={json.dumps(result_dict)}\n')
# Write full JSON result to a file to avoid complex JSON in GITHUB_OUTPUT
json_path = os.path.join('..', 'capability_result.json')
with open(json_path, 'w') as json_file:
json.dump(result_dict, json_file)
with open(os.environ['GITHUB_OUTPUT'], 'a') as f:
f.write('check_failed=false\n')
f.write(f'recommendation={result.recommendation}\n')
f.write(f'blocked_count={len(result.blocked_tasks)}\n')
f.write(f'partial_count={len(result.partial_tasks)}\n')
f.write(f'result_json_path={os.path.abspath(json_path)}\n')

Copilot uses AI. Check for mistakes.
@stranske
stranske merged commit 3d4d3fe into main Jan 8, 2026
27 checks passed
@stranske
stranske deleted the sync/workflows-13e4f1e21f38 branch January 8, 2026 03:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autofix Let bots format/lint automatically automated Automated sync from Workflows sync Automated sync from Workflows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants