Skip to content

Commit b0efbe5

Browse files
authored
fix(sergo): handle cache miss gracefully to prevent spurious failure issues (#29205)
1 parent 0f3f1ea commit b0efbe5

2 files changed

Lines changed: 27 additions & 2 deletions

File tree

.github/workflows/sergo.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,11 @@ Document all available Serena tools by exploring the MCP server's tool list.
9595
### 1.3 Load Previous Tools List from Cache
9696
Check if you have a cached tools list from previous runs:
9797
```bash
98-
cat /tmp/gh-aw/cache-memory/sergo-tools-list.json
98+
if [ -f /tmp/gh-aw/cache-memory/sergo-tools-list.json ]; then
99+
cat /tmp/gh-aw/cache-memory/sergo-tools-list.json
100+
else
101+
echo "No cached tools list found — this is a first run or the cache expired. Start fresh without a tools history."
102+
fi
99103
```
100104

101105
The file should contain:
@@ -126,7 +130,11 @@ echo '{"last_updated": "<ISO-8601-timestamp>", "tools": [...]}' > /tmp/gh-aw/cac
126130
### 2.1 Load Previous Strategies
127131
Read the strategy history to understand what analysis approaches have been used before:
128132
```bash
129-
cat /tmp/gh-aw/cache-memory/sergo-strategies.jsonl
133+
if [ -f /tmp/gh-aw/cache-memory/sergo-strategies.jsonl ]; then
134+
cat /tmp/gh-aw/cache-memory/sergo-strategies.jsonl
135+
else
136+
echo "No strategy history found — this is a first run or the cache expired. Start fresh with a new exploration strategy."
137+
fi
130138
```
131139

132140
Each line in this JSONL file represents a previous strategy execution:
@@ -589,6 +597,14 @@ Ensure your discussion:
589597
- **Prune old data**: Consider keeping last 30-60 days
590598
- **Document schema**: Keep cache file formats clear
591599

600+
### When to Call `missing_data`
601+
602+
Only call the `missing_data` tool when an **external** dependency is truly unavailable and prevents analysis from completing — for example, the Serena MCP server is unreachable and tools cannot be discovered.
603+
604+
**Do NOT call `missing_data` for**:
605+
- An absent `sergo-tools-list.json`, `sergo-strategies.jsonl`, or `sergo-stats.json` at startup — this is **expected and normal** for the first run or after a cache reset. Just initialize the files and proceed.
606+
- Having no historical strategy data to compare against yet.
607+
592608
### Serena MCP Usage
593609
- **Explore capabilities**: Don't just use the same tools repeatedly
594610
- **Combine tools**: Use multiple tools for deeper analysis

docs/src/content/docs/reference/frontmatter-full.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3678,6 +3678,15 @@ safe-outputs:
36783678
# (optional)
36793679
preserve-branch-name: true
36803680

3681+
# When true (and preserve-branch-name is true), allows the handler to force-delete
3682+
# an existing remote branch ref and recreate it from the agent's local HEAD. When
3683+
# false (default), if the agent-specified branch already exists on the remote with
3684+
# preserve-branch-name enabled, the handler falls back (e.g. opens an issue)
3685+
# rather than overwriting the remote ref. Useful for long-lived reusable branches
3686+
# whose previous PR was merged.
3687+
# (optional)
3688+
recreate-ref: true
3689+
36813690
# List of glob patterns for files to exclude from the patch. Each pattern is
36823691
# passed to `git format-patch` as a `:(exclude)<pattern>` magic pathspec, so
36833692
# matching files are stripped by git at generation time and will not appear in the

0 commit comments

Comments
 (0)