Skip to content

chore: sync workflow templates#155

Closed
stranske wants to merge 2 commits intomainfrom
sync/workflows-8e4caa9110ae
Closed

chore: sync workflow templates#155
stranske wants to merge 2 commits intomainfrom
sync/workflows-8e4caa9110ae

Conversation

@stranske
Copy link
Copy Markdown
Owner

@stranske stranske commented Jan 5, 2026

Sync Summary

Files Updated

  • agents-issue-optimizer.yml: Issue optimizer - LangChain-based issue formatting and optimization (Phase 1)
  • 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: 8e4caa9110ae

Changes synced from sync-manifest.yml
Copilot AI review requested due to automatic review settings January 5, 2026 21:19
@stranske stranske added sync Automated sync from Workflows automated Automated sync from Workflows labels Jan 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 5, 2026

⚠️ Action Required: Unable to determine source issue for PR #155. 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 added the autofix Triggers autofix on PR label Jan 5, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 5, 2026

🤖 Keepalive Loop Status

PR #155 | 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/5 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
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 5, 2026

Status | ✅ no new diagnostics
History points | 0
Timestamp | 2026-01-05 21:21:36 UTC
Report artifact | autofix-report-pr-155
Remaining | ∅
New | ∅
No additional artifacts

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 5, 2026

Autofix updated these files:

  • scripts/validate_dependency_test_setup.py

Copy link
Copy Markdown
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

This PR syncs workflow templates from the stranske/Workflows repository, introducing a new multi-phase GitHub Actions workflow for issue optimization and updating the issue formatter to preserve original issue content.

Key changes:

  • New workflow agents-issue-optimizer.yml implementing a three-phase issue processing system (analyze, apply, format)
  • Enhanced issue_formatter.py to append original issue content in a collapsible section
  • Code formatting improvements in scripts/validate_dependency_test_setup.py (style-only changes)

Reviewed changes

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

File Description
.github/workflows/agents-issue-optimizer.yml New workflow implementing label-triggered and manual issue optimization with three phases
scripts/langchain/issue_formatter.py Added functions to preserve original issue text in formatted output using dynamic code fences
scripts/validate_dependency_test_setup.py Code formatting updates (quote style, line breaks) following Python style conventions
autofix_report_enriched.json Updated timestamp and tracked file reference

OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
echo "Running analysis on issue #${ISSUE_NUMBER}"
python scripts/langchain/issue_optimizer.py \
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The workflow references 'scripts/langchain/issue_optimizer.py' which does not exist in the repository. The script execution will fail when attempting to run this file. This includes imports of IssueOptimizationResult, format_suggestions_comment, _extract_suggestions_json, and apply_suggestions which are all expected to be in this missing module.

Copilot uses AI. Check for mistakes.
Comment on lines +210 to +212
sys.path.insert(0, 'scripts/langchain')
from issue_optimizer import _extract_suggestions_json, apply_suggestions

Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The workflow references 'from issue_optimizer import _extract_suggestions_json, apply_suggestions' which relies on the non-existent 'issue_optimizer.py' module. This import will fail at runtime and prevent Phase 2 from executing successfully.

Suggested change
sys.path.insert(0, 'scripts/langchain')
from issue_optimizer import _extract_suggestions_json, apply_suggestions
def _extract_suggestions_json(body: str):
\"\"\"Extract a JSON object containing suggestions from a comment body.
This looks first for a fenced ```json code block, and falls back to
the first top-level JSON object found in the text.
\"\"\"
if not body:
return None
# Try to find a ```json ... ``` fenced block
fenced_match = re.search(r\"```json\\s*(\\{[\\s\\S]*?\\})\\s*```\", body, re.IGNORECASE)
candidate = None
if fenced_match:
candidate = fenced_match.group(1)
else:
# Fallback: first JSON object-like substring
brace_match = re.search(r\"\\{[\\s\\S]*\\}\", body)
if brace_match:
candidate = brace_match.group(0)
if not candidate:
return None
try:
return json.loads(candidate)
except Exception:
return None
def apply_suggestions(issue_body: str, suggestions, use_llm: bool = False):
\"\"\"Apply suggestions to the issue body.
Expects suggestions to contain a 'formatted_body' or similar field.
Falls back to returning the original body if the structure is unknown.
\"\"\"
if isinstance(suggestions, dict):
if 'formatted_body' in suggestions and isinstance(suggestions['formatted_body'], str):
formatted = suggestions['formatted_body']
elif 'body' in suggestions and isinstance(suggestions['body'], str):
formatted = suggestions['body']
elif 'issue_body' in suggestions and isinstance(suggestions['issue_body'], str):
formatted = suggestions['issue_body']
else:
formatted = issue_body
else:
formatted = issue_body
return {'formatted_body': formatted}

Copilot uses AI. Check for mistakes.
Comment on lines +12 to +19
phase:
description: "Phase to run (analyze, apply, or format)"
required: true
type: choice
options:
- analyze
- apply
- format
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The PR description mentions this is "Phase 1" and includes issue formatting capabilities, but the workflow file includes references to Phase 2 (apply suggestions) and Phase 3 (format) operations that depend on the missing 'issue_optimizer.py' module. Either the PR description should clarify that this is a complete multi-phase system, or the workflow should be scoped to only include the formatting phase (Phase 3) that can work with the included 'issue_formatter.py' module.

Copilot uses AI. Check for mistakes.
Comment on lines +159 to +184
with open('/tmp/dedup_comments.json', encoding='utf-8') as f:
comments = json.load(f)

marker = issue_dedup.SIMILAR_ISSUES_MARKER
for comment in comments or []:
body = (comment or {}).get('body') or ''
if marker in body:
raise SystemExit(0)

# Conservative defaults; can be tuned later.
threshold = 0.82
store = issue_dedup.build_issue_vector_store(open_issues)
if store is None:
raise SystemExit(0)

title = (issue.get('title') or '').strip()
body = (issue.get('body') or '').strip()
query = f"{title}\n{body}".strip() if body else title
if not query:
raise SystemExit(0)

matches = issue_dedup.find_similar_issues(store, query, threshold=threshold, k=5)
comment = issue_dedup.format_similar_issues_comment(matches, max_items=5)
if comment:
with open('/tmp/dedup_comment.md', 'w', encoding='utf-8') as out:
out.write(comment)
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

Inconsistent indentation in the Python inline script. Lines 159-160, 162-166, and 170-172 use 2-space indentation while lines 157-158 and 168-169 use 0-space indentation. This will cause a Python IndentationError when the script runs. All lines within the same scope should use consistent indentation (either all at the same level after the opening 'with' statements, or properly nested).

Suggested change
with open('/tmp/dedup_comments.json', encoding='utf-8') as f:
comments = json.load(f)
marker = issue_dedup.SIMILAR_ISSUES_MARKER
for comment in comments or []:
body = (comment or {}).get('body') or ''
if marker in body:
raise SystemExit(0)
# Conservative defaults; can be tuned later.
threshold = 0.82
store = issue_dedup.build_issue_vector_store(open_issues)
if store is None:
raise SystemExit(0)
title = (issue.get('title') or '').strip()
body = (issue.get('body') or '').strip()
query = f"{title}\n{body}".strip() if body else title
if not query:
raise SystemExit(0)
matches = issue_dedup.find_similar_issues(store, query, threshold=threshold, k=5)
comment = issue_dedup.format_similar_issues_comment(matches, max_items=5)
if comment:
with open('/tmp/dedup_comment.md', 'w', encoding='utf-8') as out:
out.write(comment)
with open('/tmp/dedup_comments.json', encoding='utf-8') as f:
comments = json.load(f)
marker = issue_dedup.SIMILAR_ISSUES_MARKER
for comment in comments or []:
body = (comment or {}).get('body') or ''
if marker in body:
raise SystemExit(0)
# Conservative defaults; can be tuned later.
threshold = 0.82
store = issue_dedup.build_issue_vector_store(open_issues)
if store is None:
raise SystemExit(0)
title = (issue.get('title') or '').strip()
body = (issue.get('body') or '').strip()
query = f"{title}\n{body}".strip() if body else title
if not query:
raise SystemExit(0)
matches = issue_dedup.find_similar_issues(store, query, threshold=threshold, k=5)
comment = issue_dedup.format_similar_issues_comment(matches, max_items=5)
if comment:
with open('/tmp/dedup_comment.md', 'w', encoding='utf-8') as out:
out.write(comment)

Copilot uses AI. Check for mistakes.
Comment on lines +152 to +184
import json
from scripts.langchain import issue_dedup

with open('/tmp/issue.json', encoding='utf-8') as f:
issue = json.load(f)
with open('/tmp/open_issues.json', encoding='utf-8') as f:
open_issues = json.load(f)
with open('/tmp/dedup_comments.json', encoding='utf-8') as f:
comments = json.load(f)

marker = issue_dedup.SIMILAR_ISSUES_MARKER
for comment in comments or []:
body = (comment or {}).get('body') or ''
if marker in body:
raise SystemExit(0)

# Conservative defaults; can be tuned later.
threshold = 0.82
store = issue_dedup.build_issue_vector_store(open_issues)
if store is None:
raise SystemExit(0)

title = (issue.get('title') or '').strip()
body = (issue.get('body') or '').strip()
query = f"{title}\n{body}".strip() if body else title
if not query:
raise SystemExit(0)

matches = issue_dedup.find_similar_issues(store, query, threshold=threshold, k=5)
comment = issue_dedup.format_similar_issues_comment(matches, max_items=5)
if comment:
with open('/tmp/dedup_comment.md', 'w', encoding='utf-8') as out:
out.write(comment)
Copy link

Copilot AI Jan 5, 2026

Choose a reason for hiding this comment

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

The workflow references 'scripts.langchain.issue_dedup' module which does not exist in the repository. The import statement will fail at runtime. Either this module needs to be added as part of this PR, or the dedup check step should be removed or updated to reference an existing module.

Suggested change
import json
from scripts.langchain import issue_dedup
with open('/tmp/issue.json', encoding='utf-8') as f:
issue = json.load(f)
with open('/tmp/open_issues.json', encoding='utf-8') as f:
open_issues = json.load(f)
with open('/tmp/dedup_comments.json', encoding='utf-8') as f:
comments = json.load(f)
marker = issue_dedup.SIMILAR_ISSUES_MARKER
for comment in comments or []:
body = (comment or {}).get('body') or ''
if marker in body:
raise SystemExit(0)
# Conservative defaults; can be tuned later.
threshold = 0.82
store = issue_dedup.build_issue_vector_store(open_issues)
if store is None:
raise SystemExit(0)
title = (issue.get('title') or '').strip()
body = (issue.get('body') or '').strip()
query = f"{title}\n{body}".strip() if body else title
if not query:
raise SystemExit(0)
matches = issue_dedup.find_similar_issues(store, query, threshold=threshold, k=5)
comment = issue_dedup.format_similar_issues_comment(matches, max_items=5)
if comment:
with open('/tmp/dedup_comment.md', 'w', encoding='utf-8') as out:
out.write(comment)
import sys
# The advisory issue deduplication helper module is not available
# in this repository. Skip this optional check without failing
# the workflow.
sys.stdout.write("Advisory deduplication module not found; skipping duplicate issue check.\n")

Copilot uses AI. Check for mistakes.
@stranske stranske closed this Jan 5, 2026
@stranske stranske deleted the sync/workflows-8e4caa9110ae branch January 17, 2026 17:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autofix Triggers autofix on PR 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