Skip to content

docs: correct the Python Customize Mode section IDs and action list - #2264

Open
examon wants to merge 1 commit into
mainfrom
sdk-bugfix-161
Open

docs: correct the Python Customize Mode section IDs and action list#2264
examon wants to merge 1 commit into
mainfrom
sdk-bugfix-161

Conversation

@examon

@examon examon commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Fixes #2263

The Python README's "Customize Mode" section listed 10 section IDs and described "four string actions". The shipped Python API exposes 12 sections and 5 string actions, so preamble, runtime_instructions and preserve were undiscoverable for anyone following the Python README.

The change

Two lines in python/README.md:

  • the "Available section IDs" list now enumerates all 12 members of SystemMessageSection, in declaration order, and notes that identity and tool_instructions are section groups and that preamble targets just the identity preamble;
  • the actions sentence now says "five string actions" and includes preserve, with a short gloss of what it is for, and the unknown-section sentence is scoped to the content-bearing actions.

Both additions reuse the wording already in dotnet/README.md, nodejs/README.md, go/README.md and docs/getting-started.md, so the Python README now matches the rest of the documentation rather than introducing a new phrasing.

No code changes.

What the package actually exposes

pip install github-copilot-sdk
python surface.py

surface.py:

import typing

from copilot.session import SectionOverrideAction, SystemMessageSection

section_ids = typing.get_args(SystemMessageSection)
literal_arm = next(
    arg for arg in typing.get_args(SectionOverrideAction)
    if typing.get_origin(arg) is typing.Literal
)
string_actions = typing.get_args(literal_arm)

print(len(section_ids), "section IDs:", list(section_ids))
print(len(string_actions), "string actions:", list(string_actions))

Output:

12 section IDs: ['preamble', 'identity', 'tone', 'tool_efficiency', 'environment_context', 'code_change_rules', 'guidelines', 'safety', 'tool_instructions', 'custom_instructions', 'runtime_instructions', 'last_instructions']
5 string actions: ['replace', 'remove', 'append', 'prepend', 'preserve']

The README previously listed 10 of those 12 section IDs (omitting preamble and runtime_instructions) and 4 of those 5 actions (omitting preserve). After this change it lists all 12 and all 5, in the order shown above.

Checks

python/README.md is the only file changed, so no Python code path is affected.

Run in python/:

  • uv run ruff format --check . — passes
  • uv run ruff checkAll checks passed!
  • uv run ty check copilot — exits 0

The Python README's "Customize Mode" section listed 10 section IDs and
described "four string actions". The shipped Python API exposes 12
sections (`SystemMessageSection`) and 5 string actions (the literal arm
of `SectionOverrideAction`): `preamble`, `runtime_instructions` and
`preserve` were missing, so following the README it was impossible to
discover them.

Bring the two lines in line with the shipped API and with the equivalent
sections in the Node.js, Go and .NET READMEs and in
docs/getting-started.md, which already document all 12 sections and all
5 actions, including the section-group semantics that make `preamble`
and `preserve` meaningful.
@examon
examon requested a review from a team as a code owner August 5, 2026 04:02
Copilot AI balanced review requested due to automatic review settings August 5, 2026 04:02

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

Updates Python documentation to match the shipped system-message customization API.

Changes:

  • Documents all 12 section IDs and section-group behavior.
  • Documents all five actions, including preserve.
  • Clarifies handling of unknown section IDs.
Show a summary per file
File Description
python/README.md Corrects Customize Mode sections and actions.

Review details

  • Files reviewed: 1/1 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review ✅

This PR modifies only python/README.md — no code changes, no SDK API surface changes.

The documentation correction aligns the Python README with the already-accurate wording in dotnet/README.md, nodejs/README.md, go/README.md, and docs/getting-started.md. No cross-SDK inconsistencies introduced; the change resolves an existing inconsistency between the Python docs and the other SDKs' docs.

No further action needed.

Generated by SDK Consistency Review Agent for #2264 · sonnet46 15.9 AIC · ⌖ 5.36 AIC · ⊞ 6.6K ·

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.

Python README Customize Mode omits the preamble and runtime_instructions sections and the preserve action

2 participants