Harden Semantic Function Refactoring against empty terminal exits#45418
Merged
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix terminal failure in Semantic Function Refactoring
Harden Semantic Function Refactoring against empty terminal exits
Jul 14, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Hardens the scheduled semantic refactoring workflow against successful runs producing no terminal safe output.
Changes:
- Directs issue discovery through GitHub MCP tools.
- Adds safer shell guidance and explicit
create_issue/nooptermination. - Refreshes compiled workflow metadata.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/semantic-function-refactor.md |
Updates analysis and terminal-output instructions. |
.github/workflows/semantic-function-refactor.lock.yml |
Refreshes the generated body hash. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 3
- Review effort level: Medium
| **Before performing any analysis**, you must close existing open issues with the `[refactor]` title prefix to prevent duplicate issues. | ||
|
|
||
| Use the GitHub API tools to: | ||
| Use the GitHub MCP issue tools directly (for example `search_issues` with `repo:${{ github.repository }} is:issue is:open "[refactor]" in:title`, or `list_issues` with `state: open` and client-side filtering). **Do not use `gh issue list` or Bash for GitHub reads.** |
|
|
||
| Group files by package/directory to understand the organization. | ||
|
|
||
| When shell access is needed, keep each Bash command simple and single-purpose. Prefer Serena tools plus `Grep`/`Read` over shell pipelines, loops, `awk`, or command substitutions that may be blocked by approval policy. |
|
|
||
| ## Required Terminal Safe Output | ||
|
|
||
| End every successful run with exactly one safe output: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Semantic Function Refactoring regressed from a long green streak to a red scheduled run after the Claude CLI completed a large analysis session but exited with zero safe outputs. The failing path was consistent with the workflow drifting into blocked shell patterns and finishing without emitting either a finding or an explicit no-op.
Root-cause guardrail
create_issuewhen meaningful refactoring findings existnoopwhen analysis completes with nothing worth filingSafer GitHub issue discovery
gh issue list/Bash reads with direct GitHub MCP issue tools.search_issuesfor[refactor]title lookup before analysis starts, keeping the workflow on supported read paths.Lower-friction analysis commands
Grep/Readover approval-blocked shell pipelines, loops, andawk-style command composition.close_issue.Prompt change reflected in compiled workflow
semantic-function-refactor.lock.ymlso runtime YAML matches the updated prompt behavior.Example of the new terminal contract: