Skip to content

Commit cf03e46

Browse files
Copilotalexec
andauthored
[WIP] Remove skills from resume mode output (#184)
* Initial plan * Skip skills discovery in resume mode Co-authored-by: alexec <1142830+alexec@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: alexec <1142830+alexec@users.noreply.github.com>
1 parent b0d48e8 commit cf03e46

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

pkg/codingcontext/context.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,6 +574,12 @@ func (cc *Context) runBootstrapScript(ctx context.Context, path string) error {
574574
// discoverSkills searches for skill directories and loads only their metadata (name and description)
575575
// for progressive disclosure. Skills are folders containing a SKILL.md file.
576576
func (cc *Context) discoverSkills() error {
577+
// Skip skill discovery if resume mode is enabled
578+
// Check cc.resume directly first, then fall back to selector check for backward compatibility
579+
if cc.resume || (cc.includes != nil && cc.includes.GetValue("resume", "true")) {
580+
return nil
581+
}
582+
577583
var skillPaths []string
578584
for _, path := range cc.downloadedPaths {
579585
skillPaths = append(skillPaths, skillSearchPaths(path)...)

pkg/codingcontext/context_test.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2244,6 +2244,41 @@ description: %s
22442244
taskName: "test-task",
22452245
wantErr: true,
22462246
},
2247+
{
2248+
name: "resume mode skips skill discovery",
2249+
setup: func(t *testing.T, dir string) {
2250+
// Create task
2251+
createTask(t, dir, "test-task", "", "Task content")
2252+
2253+
// Create skill directory with SKILL.md
2254+
skillDir := filepath.Join(dir, ".agents", "skills", "test-skill")
2255+
if err := os.MkdirAll(skillDir, 0o755); err != nil {
2256+
t.Fatalf("failed to create skill directory: %v", err)
2257+
}
2258+
2259+
skillContent := `---
2260+
name: test-skill
2261+
description: A test skill that should not be discovered in resume mode
2262+
---
2263+
2264+
# Test Skill
2265+
2266+
This is a test skill.
2267+
`
2268+
skillPath := filepath.Join(skillDir, "SKILL.md")
2269+
if err := os.WriteFile(skillPath, []byte(skillContent), 0o644); err != nil {
2270+
t.Fatalf("failed to create skill file: %v", err)
2271+
}
2272+
},
2273+
opts: []Option{WithResume(true)},
2274+
taskName: "test-task",
2275+
wantErr: false,
2276+
checkFunc: func(t *testing.T, result *Result) {
2277+
if len(result.Skills.Skills) != 0 {
2278+
t.Errorf("expected 0 skills in resume mode, got %d", len(result.Skills.Skills))
2279+
}
2280+
},
2281+
},
22472282
}
22482283

22492284
for _, tt := range tests {

0 commit comments

Comments
 (0)