Skip to content

Removing system prompt editing from copilot.go#140

Merged
richardpark-msft merged 3 commits into
microsoft:mainfrom
richardpark-msft:wz-rollback-system-prompt
Mar 18, 2026
Merged

Removing system prompt editing from copilot.go#140
richardpark-msft merged 3 commits into
microsoft:mainfrom
richardpark-msft:wz-rollback-system-prompt

Conversation

@richardpark-msft

Copy link
Copy Markdown
Member

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 copilot CLI, 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.

Richard Park added 2 commits March 17, 2026 23:24
Copilot AI review requested due to automatic review settings March 18, 2026 00:13
@github-actions github-actions Bot enabled auto-merge (squash) March 18, 2026 00:13
@richardpark-msft richardpark-msft enabled auto-merge (squash) March 18, 2026 00:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 SystemMessage in CopilotEngine.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.

Comment thread internal/execution/copilot.go
@codecov-commenter

codecov-commenter commented Mar 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (main@b07221f). Learn more about missing BASE report.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #140   +/-   ##
=======================================
  Coverage        ?   73.76%           
=======================================
  Files           ?      138           
  Lines           ?    15775           
  Branches        ?        0           
=======================================
  Hits            ?    11637           
  Misses          ?     3291           
  Partials        ?      847           
Flag Coverage Δ
go-implementation 73.76% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@richardpark-msft richardpark-msft merged commit 3e9a7ac into microsoft:main Mar 18, 2026
6 checks passed
spboyer added a commit that referenced this pull request Apr 21, 2026
…#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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants