Skip to content

Commit 28b1bc5

Browse files
Add last_instructions configurable section
Expose lastInstructions as a customizable section across all 4 SDKs, addressing review feedback about duplicate tool-efficiency blocks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent e441f04 commit 28b1bc5

File tree

9 files changed

+15
-8
lines changed

9 files changed

+15
-8
lines changed

docs/getting-started.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1277,7 +1277,7 @@ const session = await client.createSession({
12771277
});
12781278
```
12791279

1280-
Available section IDs: `identity`, `tone`, `tool_efficiency`, `environment_context`, `code_change_rules`, `guidelines`, `safety`, `tool_instructions`, `custom_instructions`.
1280+
Available section IDs: `identity`, `tone`, `tool_efficiency`, `environment_context`, `code_change_rules`, `guidelines`, `safety`, `tool_instructions`, `custom_instructions`, `last_instructions`.
12811281

12821282
Each override supports four actions: `replace`, `remove`, `append`, and `prepend`. Unknown section IDs are handled gracefully — content is appended to additional instructions and a warning is emitted; `remove` on unknown sections is silently ignored.
12831283

dotnet/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,7 @@ var session = await client.CreateSessionAsync(new SessionConfig
510510
});
511511
```
512512

513-
Available section IDs are defined as constants on `SystemPromptSections`: `Identity`, `Tone`, `ToolEfficiency`, `EnvironmentContext`, `CodeChangeRules`, `Guidelines`, `Safety`, `ToolInstructions`, `CustomInstructions`.
513+
Available section IDs are defined as constants on `SystemPromptSections`: `Identity`, `Tone`, `ToolEfficiency`, `EnvironmentContext`, `CodeChangeRules`, `Guidelines`, `Safety`, `ToolInstructions`, `CustomInstructions`, `LastInstructions`.
514514

515515
Each section override supports four actions: `Replace`, `Remove`, `Append`, and `Prepend`. Unknown section IDs are handled gracefully: content is appended to additional instructions, and `Remove` overrides are silently ignored.
516516

dotnet/src/Types.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1033,6 +1033,8 @@ public static class SystemPromptSections
10331033
public const string ToolInstructions = "tool_instructions";
10341034
/// <summary>Repository and organization custom instructions.</summary>
10351035
public const string CustomInstructions = "custom_instructions";
1036+
/// <summary>End-of-prompt instructions: parallel tool calling, persistence, task completion.</summary>
1037+
public const string LastInstructions = "last_instructions";
10361038
}
10371039

10381040
/// <summary>

go/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Event types: `SessionLifecycleCreated`, `SessionLifecycleDeleted`, `SessionLifec
152152
- `SystemMessage` (\*SystemMessageConfig): System message configuration. Supports three modes:
153153
- **append** (default): Appends `Content` after the SDK-managed prompt
154154
- **replace**: Replaces the entire prompt with `Content`
155-
- **customize**: Selectively override individual sections via `Sections` map (keys: `SectionIdentity`, `SectionTone`, `SectionToolEfficiency`, `SectionEnvironmentContext`, `SectionCodeChangeRules`, `SectionGuidelines`, `SectionSafety`, `SectionToolInstructions`, `SectionCustomInstructions`; values: `SectionOverride` with `Action` and optional `Content`)
155+
- **customize**: Selectively override individual sections via `Sections` map (keys: `SectionIdentity`, `SectionTone`, `SectionToolEfficiency`, `SectionEnvironmentContext`, `SectionCodeChangeRules`, `SectionGuidelines`, `SectionSafety`, `SectionToolInstructions`, `SectionCustomInstructions`, `SectionLastInstructions`; values: `SectionOverride` with `Action` and optional `Content`)
156156
- `Provider` (\*ProviderConfig): Custom API provider configuration (BYOK). See [Custom Providers](#custom-providers) section.
157157
- `Streaming` (bool): Enable streaming delta events
158158
- `InfiniteSessions` (\*InfiniteSessionConfig): Automatic context compaction configuration
@@ -215,7 +215,7 @@ session, err := client.CreateSession(ctx, &copilot.SessionConfig{
215215
})
216216
```
217217

218-
Available section constants: `SectionIdentity`, `SectionTone`, `SectionToolEfficiency`, `SectionEnvironmentContext`, `SectionCodeChangeRules`, `SectionGuidelines`, `SectionSafety`, `SectionToolInstructions`, `SectionCustomInstructions`.
218+
Available section constants: `SectionIdentity`, `SectionTone`, `SectionToolEfficiency`, `SectionEnvironmentContext`, `SectionCodeChangeRules`, `SectionGuidelines`, `SectionSafety`, `SectionToolInstructions`, `SectionCustomInstructions`, `SectionLastInstructions`.
219219

220220
Each section override supports four actions:
221221
- **`replace`** — Replace the section content entirely

go/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ const (
122122
SectionSafety = "safety"
123123
SectionToolInstructions = "tool_instructions"
124124
SectionCustomInstructions = "custom_instructions"
125+
SectionLastInstructions = "last_instructions"
125126
)
126127

127128
// SectionOverride defines an override operation for a single system prompt section.

nodejs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ const session = await client.createSession({
486486
});
487487
```
488488

489-
Available section IDs: `identity`, `tone`, `tool_efficiency`, `environment_context`, `code_change_rules`, `guidelines`, `safety`, `tool_instructions`, `custom_instructions`. Use the `SYSTEM_PROMPT_SECTIONS` constant for descriptions of each section.
489+
Available section IDs: `identity`, `tone`, `tool_efficiency`, `environment_context`, `code_change_rules`, `guidelines`, `safety`, `tool_instructions`, `custom_instructions`, `last_instructions`. Use the `SYSTEM_PROMPT_SECTIONS` constant for descriptions of each section.
490490

491491
Each section override supports four actions:
492492
- **`replace`** — Replace the section content entirely

nodejs/src/types.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,8 @@ export type SystemPromptSection =
285285
| "guidelines"
286286
| "safety"
287287
| "tool_instructions"
288-
| "custom_instructions";
288+
| "custom_instructions"
289+
| "last_instructions";
289290

290291
/** Section metadata for documentation and tooling. */
291292
export const SYSTEM_PROMPT_SECTIONS: Record<SystemPromptSection, { description: string }> = {
@@ -298,6 +299,7 @@ export const SYSTEM_PROMPT_SECTIONS: Record<SystemPromptSection, { description:
298299
safety: { description: "Environment limitations, prohibited actions, security policies" },
299300
tool_instructions: { description: "Per-tool usage instructions" },
300301
custom_instructions: { description: "Repository and organization custom instructions" },
302+
last_instructions: { description: "End-of-prompt instructions: parallel tool calling, persistence, task completion" },
301303
};
302304

303305
/**

python/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ CopilotClient(
143143
- `system_message` (dict): System message configuration. Supports three modes:
144144
- **append** (default): Appends `content` after the SDK-managed prompt
145145
- **replace**: Replaces the entire prompt with `content`
146-
- **customize**: Selectively override individual sections via `sections` dict (keys: `"identity"`, `"tone"`, `"tool_efficiency"`, `"environment_context"`, `"code_change_rules"`, `"guidelines"`, `"safety"`, `"tool_instructions"`, `"custom_instructions"`; values: `SectionOverride` with `action` and optional `content`)
146+
- **customize**: Selectively override individual sections via `sections` dict (keys: `"identity"`, `"tone"`, `"tool_efficiency"`, `"environment_context"`, `"code_change_rules"`, `"guidelines"`, `"safety"`, `"tool_instructions"`, `"custom_instructions"`, `"last_instructions"`; values: `SectionOverride` with `action` and optional `content`)
147147
- `streaming` (bool): Enable streaming delta events
148148
- `provider` (dict): Custom API provider configuration (BYOK). See [Custom Providers](#custom-providers) section.
149149
- `infinite_sessions` (dict): Automatic context compaction configuration
@@ -217,7 +217,7 @@ session = await client.create_session(
217217
)
218218
```
219219

220-
Available section IDs: `"identity"`, `"tone"`, `"tool_efficiency"`, `"environment_context"`, `"code_change_rules"`, `"guidelines"`, `"safety"`, `"tool_instructions"`, `"custom_instructions"`. Use the `SYSTEM_PROMPT_SECTIONS` dict for descriptions of each section.
220+
Available section IDs: `"identity"`, `"tone"`, `"tool_efficiency"`, `"environment_context"`, `"code_change_rules"`, `"guidelines"`, `"safety"`, `"tool_instructions"`, `"custom_instructions"`, `"last_instructions"`. Use the `SYSTEM_PROMPT_SECTIONS` dict for descriptions of each section.
221221

222222
Each section override supports four actions:
223223
- **`replace`** — Replace the section content entirely

python/copilot/types.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ class Tool:
217217
"safety",
218218
"tool_instructions",
219219
"custom_instructions",
220+
"last_instructions",
220221
]
221222

222223
SYSTEM_PROMPT_SECTIONS: dict[SystemPromptSection, str] = {
@@ -229,6 +230,7 @@ class Tool:
229230
"safety": "Environment limitations, prohibited actions, security policies",
230231
"tool_instructions": "Per-tool usage instructions",
231232
"custom_instructions": "Repository and organization custom instructions",
233+
"last_instructions": "End-of-prompt instructions: parallel tool calling, persistence, task completion",
232234
}
233235

234236

0 commit comments

Comments
 (0)