Skip to content

chore: sync workflow templates#151

Closed
stranske wants to merge 1 commit intomainfrom
sync/workflows-640b9071ddde
Closed

chore: sync workflow templates#151
stranske wants to merge 1 commit intomainfrom
sync/workflows-640b9071ddde

Conversation

@stranske
Copy link
Copy Markdown
Owner

@stranske stranske commented Jan 5, 2026

Sync Summary

Files Updated

  • keepalive_loop.js: Core keepalive loop logic
  • keepalive_prompt_routing.js: Prompt routing logic for keepalive - determines which prompt template to use
  • issue_formatter.py: Issue formatter - converts raw text to AGENT_ISSUE_TEMPLATE format
  • format_issue.md: Prompt template for LLM-based issue formatting
  • llm_provider.py: LLM provider configuration - GitHub Models and OpenAI client setup
  • agents-guard.js: Guards against unauthorized agent workflow file changes
  • LABELS.md: Label definitions and usage

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: 640b9071ddde

Changes synced from sync-manifest.yml
Copilot AI review requested due to automatic review settings January 5, 2026 19:13
@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 #151. The PR title, branch name, or body must contain the issue number (e.g. #123, branch: issue-123, or the hidden marker ).

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jan 5, 2026

🤖 Keepalive Loop Status

PR #151 | 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/10 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 Triggers autofix on PR label Jan 5, 2026
@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 19:14:25 UTC
Report artifact | autofix-report-pr-151
Remaining | ∅
New | ∅
No additional artifacts

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 and supporting scripts from the central Workflows repository. The changes introduce new LLM-based functionality for task completion analysis and issue formatting, along with minor improvements to existing keepalive and guard scripts.

Key Changes

  • Adds new LLM provider abstraction with fallback chain (GitHub Models → OpenAI → regex patterns)
  • Introduces issue formatting utilities using LangChain for converting raw issues to standardized template format
  • Enhances keepalive prompt routing with additional CI failure mode aliases
  • Updates documentation timestamp and improves security comment clarity in agents-guard

Reviewed changes

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

Show a summary per file
File Description
tools/llm_provider.py New LLM provider abstraction with GitHub Models and OpenAI support, includes confidence validation system
scripts/langchain/issue_formatter.py New issue formatter that converts raw GitHub issues to AGENT_ISSUE_TEMPLATE format using LLM or regex fallback
scripts/langchain/prompts/format_issue.md Prompt template defining rules for LLM-based issue formatting
docs/LABELS.md Updates documentation timestamp from December 2025 to January 2026
.github/scripts/keepalive_prompt_routing.js Adds new CI failure mode aliases (ci_failure, fix-ci-failure) to FIX_MODES set
.github/scripts/keepalive_loop.js Refactors verification status checking to avoid redundant toLowerCase() calls
.github/scripts/agents-guard.js Expands security comment explaining the agents:allow-change label bypass behavior

Comment on lines +284 to +335
def _parse_response(
self,
content: str,
tasks: list[str],
quality_context: SessionQualityContext | None = None,
) -> CompletionAnalysis:
"""Parse LLM response into CompletionAnalysis with BS detection."""
try:
# Try to extract JSON from response
json_start = content.find("{")
json_end = content.rfind("}") + 1
if json_start >= 0 and json_end > json_start:
data = json.loads(content[json_start:json_end])
else:
raise ValueError("No JSON found in response")

raw_confidence = float(data.get("confidence", 0.5))
completed = data.get("completed", [])
in_progress = data.get("in_progress", [])
reasoning = data.get("reasoning", "")

# Apply BS detection to validate/adjust confidence
adjusted_confidence, warnings = self._validate_confidence(
raw_confidence=raw_confidence,
completed_count=len(completed),
in_progress_count=len(in_progress),
quality_context=quality_context,
reasoning=reasoning,
)

return CompletionAnalysis(
completed_tasks=completed,
in_progress_tasks=in_progress,
blocked_tasks=data.get("blocked", []),
confidence=adjusted_confidence,
reasoning=reasoning,
provider_used=self.name,
raw_confidence=raw_confidence if adjusted_confidence != raw_confidence else None,
confidence_adjusted=adjusted_confidence != raw_confidence,
quality_warnings=warnings if warnings else None,
)
except (json.JSONDecodeError, ValueError) as e:
logger.warning(f"Failed to parse LLM response: {e}")
# Return empty analysis on parse failure
return CompletionAnalysis(
completed_tasks=[],
in_progress_tasks=[],
blocked_tasks=[],
confidence=0.0,
reasoning=f"Failed to parse response: {e}",
provider_used=self.name,
)
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 method _parse_response includes the quality_context parameter and calls _validate_confidence with it, but this parameter is not documented in the method's interface. When the method is called from OpenAIProvider.analyze_completion on line 378, no quality_context is passed, which means it will always be None. This inconsistency could lead to reduced validation capabilities for the OpenAI provider compared to the GitHub Models provider.

Copilot uses AI. Check for mistakes.
Comment on lines +362 to +390
def analyze_completion(
self,
session_output: str,
tasks: list[str],
context: str | None = None,
) -> CompletionAnalysis:
client = self._get_client()
if not client:
raise RuntimeError("LangChain OpenAI not available")

# Reuse the same prompt building logic
github_provider = GitHubModelsProvider()
prompt = github_provider._build_analysis_prompt(session_output, tasks, context)

try:
response = client.invoke(prompt)
result = github_provider._parse_response(response.content, tasks)
# Override provider name
return CompletionAnalysis(
completed_tasks=result.completed_tasks,
in_progress_tasks=result.in_progress_tasks,
blocked_tasks=result.blocked_tasks,
confidence=result.confidence,
reasoning=result.reasoning,
provider_used=self.name,
)
except Exception as e:
logger.error(f"OpenAI API error: {e}")
raise
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 OpenAIProvider.analyze_completion method doesn't accept a quality_context parameter, but the GitHubModelsProvider does. This creates an inconsistent API between providers. Additionally, when OpenAIProvider calls github_provider._parse_response() on line 378, it doesn't pass the quality_context, which means OpenAI provider never benefits from confidence validation. Consider standardizing the interface across all providers.

Copilot uses AI. Check for mistakes.
{task_list}

## Session Output
{session_output[:8000]} # Truncate to avoid token limits
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 session output is truncated to 8000 characters on line 255, but this magic number is not defined as a named constant. Consider extracting this to a module-level constant like MAX_SESSION_OUTPUT_LENGTH = 8000 to improve maintainability and make it easier to adjust if needed.

Copilot uses AI. Check for mistakes.
Comment on lines +121 to +127
def analyze_completion(
self,
session_output: str,
tasks: list[str],
context: str | None = None,
quality_context: SessionQualityContext | None = None,
) -> CompletionAnalysis:
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 method signature includes a quality_context parameter that is not present in the abstract base class definition. This creates an inconsistent API where the subclass has a different signature than the abstract method it's implementing. Consider either adding this parameter to the base class abstract method or handling it through a different mechanism to maintain consistency.

Copilot uses AI. Check for mistakes.
@stranske stranske closed this Jan 5, 2026
@stranske stranske deleted the sync/workflows-640b9071ddde 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