Skip to content

Commit 3de7b98

Browse files
authored
fix(skill-optimizer): pre-flight stash, higher limits, targeted eval tasks (#28292)
1 parent f433037 commit 3de7b98

6 files changed

Lines changed: 76 additions & 19 deletions

.github/workflows/daily-skill-optimizer.lock.yml

Lines changed: 24 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/daily-skill-optimizer.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ jobs:
4242
exit 1
4343
fi
4444
45+
- name: Stash any uncommitted changes
46+
shell: bash
47+
run: |
48+
git stash --include-untracked || true
49+
4550
- name: Run skill-optimizer
4651
id: run_skill_optimizer
4752
shell: bash
@@ -68,8 +73,8 @@ jobs:
6873
"models": [
6974
"openrouter/anthropic/claude-sonnet-4.6"
7075
],
71-
"maxTasks": 10,
72-
"maxIterations": 1
76+
"maxTasks": 20,
77+
"maxIterations": 3
7378
}
7479
EOF
7580
@@ -113,6 +118,12 @@ jobs:
113118
echo "run_mode=$RUN_MODE" >> "$GITHUB_OUTPUT"
114119
echo "run_status=$RUN_STATUS" >> "$GITHUB_OUTPUT"
115120
121+
- name: Restore stashed changes
122+
if: always()
123+
shell: bash
124+
run: |
125+
git stash pop || true
126+
116127
- name: Upload skill-optimizer artifact
117128
if: always()
118129
uses: actions/upload-artifact@v7.0.1

.skill-optimizer/skill-optimizer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"timeout": 240000,
1111
"taskGeneration": {
1212
"enabled": true,
13-
"maxTasks": 10,
13+
"maxTasks": 20,
1414
"outputDir": "."
1515
},
1616
"models": [
@@ -32,6 +32,7 @@
3232
"model": "openrouter/anthropic/claude-sonnet-4.6",
3333
"allowedPaths": ["SKILL.md"],
3434
"validation": [],
35-
"maxIterations": 1
35+
"maxIterations": 3,
36+
"requireCleanGit": false
3637
}
3738
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"id": "ansi-escape-prevention",
3+
"input": "I'm editing a compiled workflow YAML file in .github/workflows/ and some terminal output I pasted seems to have broken the YAML parser. How do I avoid ANSI escape codes in workflow YAML files, and how do I check for them?",
4+
"ideal": "ANSI escape codes (e.g. \\x1b[31m, \\x1b[0m) are terminal color codes that break YAML parsing. To avoid them: (1) never copy-paste from colored terminal output into YAML files; use --no-color flags or pipe through `| cat` to strip colors before saving; (2) run `make recompile` to regenerate clean .lock.yml files from .md sources—the workflow compiler automatically strips ANSI codes during compilation via stringutil.StripANSI(); (3) detect existing ANSI codes with: `find .github/workflows -name '*.yml' -o -name '*.yaml' | xargs grep -P '\\x1b\\[[0-9;]*[a-zA-Z]'`; (4) after fixing the source .md file, always run `make recompile` rather than hand-editing .lock.yml files.",
5+
"criteria": [
6+
"Mentions that ANSI escape codes break YAML parsing",
7+
"Recommends using --no-color or piping through `| cat` when generating terminal output",
8+
"Mentions `make recompile` to regenerate clean workflow files",
9+
"Notes that the compiler automatically strips ANSI codes",
10+
"Provides a command to detect ANSI codes in YAML files"
11+
]
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"id": "sanitized-outputs-migration",
3+
"input": "I have a workflow that uses `${{ needs.activation.outputs.text }}` and `${{ needs.activation.outputs.title }}` in the agent prompt to get the issue body and title. I'm seeing a deprecation warning during compilation. What should I change, and why?",
4+
"ideal": "Replace `needs.activation.outputs.text`, `needs.activation.outputs.title`, and `needs.activation.outputs.body` with `steps.sanitized.outputs.text`, `steps.sanitized.outputs.title`, and `steps.sanitized.outputs.body` respectively. The reason: the agent prompt is generated inside the activation job itself, and a job cannot reference its own needs outputs via `needs.activation.outputs.*` in GitHub Actions. The `sanitized` step within the activation job computes sanitized versions of the triggering content and exposes them as `steps.sanitized.outputs.*`. The compiler still accepts the old form and auto-rewrites it (emitting a deprecation warning), but you should use `steps.sanitized.outputs.*` directly in all new and updated workflows. Note: only `text`, `title`, and `body` are affected—continue using `needs.activation.outputs.*` for other outputs like `comment_id`, `comment_repo`, and `slash_command` in downstream jobs.",
5+
"criteria": [
6+
"Identifies the correct replacement: steps.sanitized.outputs.text/title/body",
7+
"Explains why needs.activation.outputs.* doesn't work inside the activation job",
8+
"Mentions that the compiler auto-rewrites the old form with a deprecation warning",
9+
"Notes that only text, title, body are affected (not comment_id, slash_command, etc.)",
10+
"Clarifies that needs.activation.outputs.* still works in downstream jobs"
11+
]
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"id": "skill-optimizer-clean-git",
3+
"input": "Our daily skill-optimizer CI job keeps failing with the error: `target.repoPath: target repo has uncommitted changes (optimize.requireCleanGit is enabled)`. The init step runs fine but the run step fails every time. How should I fix this so the optimizer can run successfully in CI?",
4+
"ideal": "There are two complementary fixes: (1) Add requireCleanGit set to false in the optimize section of .skill-optimizer/skill-optimizer.json — this disables the clean-git guard so the optimizer can run even when the workspace has uncommitted files (e.g. from a previous make recompile or init step that modifies config files). (2) In the workflow YAML, add a git stash --include-untracked step before invoking the optimizer and a corresponding git stash pop step (with if: always()) after the run to restore any stashed changes. Using requireCleanGit: false is the simplest fix for CI environments where the checkout is ephemeral; adding the stash step is a belt-and-suspenders approach that also works if the flag is not available in your version of the tool.",
5+
"criteria": [
6+
"Identifies setting requireCleanGit: false in .skill-optimizer/skill-optimizer.json as a fix",
7+
"Mentions the optimize section of the config file",
8+
"Suggests git stash --include-untracked before the optimizer run",
9+
"Mentions git stash pop (with always() condition) to restore changes afterward",
10+
"Explains that uncommitted changes can come from init or recompile steps"
11+
]
12+
}

0 commit comments

Comments
 (0)