From a39f745f395647c818d452ed441ababcbf3064f3 Mon Sep 17 00:00:00 2001 From: examon Date: Wed, 5 Aug 2026 03:39:05 +0000 Subject: [PATCH] docs: correct the Python Customize Mode section IDs and action list 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. --- python/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/README.md b/python/README.md index 10630fb84..bb17f68cc 100644 --- a/python/README.md +++ b/python/README.md @@ -710,9 +710,9 @@ async with await client.create_session( ... ``` -Available section IDs: `"identity"`, `"tone"`, `"tool_efficiency"`, `"environment_context"`, `"code_change_rules"`, `"guidelines"`, `"safety"`, `"tool_instructions"`, `"custom_instructions"`, `"last_instructions"`. +Available section IDs: `"preamble"`, `"identity"`, `"tone"`, `"tool_efficiency"`, `"environment_context"`, `"code_change_rules"`, `"guidelines"`, `"safety"`, `"tool_instructions"`, `"custom_instructions"`, `"runtime_instructions"`, `"last_instructions"`. `"identity"` and `"tool_instructions"` are section groups that target a collection of related sub-sections as a unit; use `"preamble"` to target just the identity preamble. -Each section override supports four string actions: `"replace"`, `"remove"`, `"append"`, and `"prepend"`. Unknown section IDs are handled gracefully: content is appended to additional instructions, and `"remove"` overrides are silently ignored. +Each section override supports five string actions: `"replace"`, `"remove"`, `"append"`, `"prepend"`, and `"preserve"` (a no-op that opts an individually-addressable section out of a group-level `"remove"`). Unknown section IDs are handled gracefully: content from `"replace"`/`"append"`/`"prepend"` overrides is appended to additional instructions, and `"remove"` overrides are silently ignored. You can also pass a transform callback as the `action` instead of a string. The callback receives the current section content and returns the new content (sync or async):