You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 24, 2026. It is now read-only.
Worker prompts are built by string concatenation in BuildWorkerPrompt() (CopilotService.Organization.cs line ~2829). This concatenates identity, worktree note, shared prefix, original prompt, and task into one big string. The SDK provides a structured SystemMessageConfig with SectionOverride that can append/prepend/replace system prompt sections — a cleaner approach.
SystemPromptSections — enum of known section names
What to Change
Instead of string concatenation in BuildWorkerPrompt, use SessionConfig.SystemMessage with section overrides
Worker charter goes in the appropriate section, worktree note in another, shared context in another
This gives the SDK control over section ordering and prevents accidental clobbering
The current approach works but is fragile — adding a new section requires modifying the concatenation order
Risk
Low — this is a refactor of prompt construction, not a behavior change. The prompt content stays the same, just delivered through the SDK's structured system.
Problem
Worker prompts are built by string concatenation in
BuildWorkerPrompt()(CopilotService.Organization.csline ~2829). This concatenates identity, worktree note, shared prefix, original prompt, and task into one big string. The SDK provides a structuredSystemMessageConfigwithSectionOverridethat can append/prepend/replace system prompt sections — a cleaner approach.SDK APIs Available
SessionConfig.SystemMessage—SystemMessageConfigwith:Mode— append/prepend/replaceContent— raw contentSections— dictionary ofSectionOverrideper section nameSectionOverride—Action(append/prepend/replace),Content,Transform(dynamic)SystemPromptSections— enum of known section namesWhat to Change
BuildWorkerPrompt, useSessionConfig.SystemMessagewith section overridesRisk
Low — this is a refactor of prompt construction, not a behavior change. The prompt content stays the same, just delivered through the SDK's structured system.