Removing system prompt editing from copilot.go#140
Conversation
…. That's copilot's job to do, once we pass in the appropriate skill folders.
There was a problem hiding this comment.
Pull request overview
This PR removes waza’s custom system-prompt mutation for skills so that Copilot’s own session configuration (via SkillDirectories) remains the single mechanism for skill injection, aligning waza behavior with the copilot CLI experience.
Changes:
- Removed creation/usage of
SystemMessageinCopilotEngine.Execute()session creation/resume. - Deleted tests that asserted skill injection via
SystemMessage.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| internal/execution/copilot.go | Stops appending a skills block to Copilot’s system prompt; relies on SkillDirectories only. |
| internal/execution/skill_injection_test.go | Removes tests that validated SystemMessage injection behavior. |
Comments suppressed due to low confidence (1)
internal/execution/skill_injection_test.go:167
- Test name/comment are now misleading: Execute no longer sets SystemMessage even when skills are present (SystemMessage injection was removed), so this is effectively asserting a global invariant rather than a 'no skills' case. Consider renaming the test to reflect the new behavior (e.g., that waza does not set SystemMessage at all) or replacing it with an assertion that SkillDirectories are passed through as the supported mechanism.
func TestCopilotEngine_Execute_NoSystemMessageWithoutSkills(t *testing.T) {
ctrl := gomock.NewController(t)
clientMock := NewMockcopilotClient(ctrl)
sessionMock := NewMockcopilotSession(ctrl)
sourceDir := t.TempDir() // No SKILL.md here
clientMock.EXPECT().Start(gomock.Any())
clientMock.EXPECT().CreateSession(gomock.Any(), gomock.Any()).DoAndReturn(
func(ctx context.Context, config *copilot.SessionConfig) (CopilotSession, error) {
// SystemMessage should be nil when no skills are found
assert.Nil(t, config.SystemMessage, "SystemMessage should be nil when no skills found")
return sessionMock, nil
You can also share your feedback on Copilot code review. Take the survey.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #140 +/- ##
=======================================
Coverage ? 73.76%
=======================================
Files ? 138
Lines ? 15775
Branches ? 0
=======================================
Hits ? 11637
Misses ? 3291
Partials ? 847
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…#191) * upgrade squad * fix: inject SKILL.md content, load trigger fixtures, pass MCP servers (#190, #186, #180) - Re-add buildSkillSystemMessage() to inject SKILL.md content via SystemMessage (mode: append) on CreateSession/ResumeSession. Injects full body for the target skill and compact summaries for all skills. PR #140 removed this, relying solely on SkillDirectories, which only handles skill tool routing — not content injection. - Load fixture files for trigger tests. trigger/runner.go now walks cfg.FixtureDir() once at init, caches ResourceFiles, and passes them on every trigger ExecutionRequest. Skips hidden dirs, vendor, node_modules, and files >1MB. - Pass mcp_servers eval config to copilot session. Adds MCPServers field to ExecutionRequest, convertMCPServers() helper in both orchestration and trigger runners, and passthrough in copilot.go. Closes #190 Closes #186 Closes #180 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Looks like we added in a "add in a skills block to the system prompt" feature, awhile ago, but that isn't something we should be doing. This would cause waza to use a different system prompts than people would normally see if they were using
copilotCLI, which is NOT our intention.We already do pass our skills folders when we create the session, which should give copilot all it needs in order to properly add them to its own system prompt.