Rename SystemPromptSections → SystemMessageSections for cross-SDK consistency#1683
Rename SystemPromptSections → SystemMessageSections for cross-SDK consistency#1683edburns wants to merge 3 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Generated by SDK Consistency Review Agent for issue #1683 · sonnet46 1.5M
| * @deprecated Use {@link SystemMessageSections} — this class will be removed in | ||
| * a future major version. | ||
| * @see SystemMessageSections | ||
| * @since 1.2.0 |
There was a problem hiding this comment.
Version annotation inconsistency — the @since 1.2.0 Javadoc tag (kept from the pre-PR class) conflicts with @Deprecated(since = "1.0.2", ...) on line 18. In semver, 1.0.2 < 1.2.0, so the class would appear to be deprecated before it was introduced.
The current Maven version is 1.0.2-SNAPSHOT, and SystemMessageSections is correctly tagged @since 1.0.2, so the @Deprecated(since = "1.0.2") is right. The @since 1.2.0 here was likely a typo in the original SystemPromptSections; it should probably read @since 1.0.2 (or whichever version SystemPromptSections was actually first shipped in).
Suggested fix:
* `@since` 1.0.2There was a problem hiding this comment.
Pull request overview
Aligns the Java SDK’s public API terminology with other Copilot SDKs by introducing SystemMessageSections and deprecating the older SystemPromptSections name while keeping existing callers working.
Changes:
- Added
SystemMessageSectionsas the new canonical constants holder for system message section identifiers. - Deprecated
SystemPromptSectionsand converted it into a thin compatibility subclass. - Updated JavaDoc references and added a failsafe integration test validating that key section IDs are recognized by the live CLI and that legacy constants match.
Show a summary per file
| File | Description |
|---|---|
| java/src/main/java/com/github/copilot/rpc/SystemMessageSections.java | Adds new public constants class for system message section identifiers. |
| java/src/main/java/com/github/copilot/rpc/SystemPromptSections.java | Deprecates legacy name and routes constants through the new type. |
| java/src/main/java/com/github/copilot/rpc/SystemMessageConfig.java | Updates JavaDoc examples/references to use SystemMessageSections. |
| java/src/main/java/com/github/copilot/rpc/SectionOverride.java | Updates JavaDoc terminology and references to SystemMessageSections. |
| java/src/test/java/com/github/copilot/SystemMessageSectionsIT.java | Adds live-CLI integration coverage for section transforms and legacy equivalence. |
Copilot's findings
- Files reviewed: 5/5 changed files
- Comments generated: 2
This comment has been minimized.
This comment has been minimized.
…sistency Introduce `SystemMessageSections` as a sealed superclass containing all well-known section identifier constants. The existing `SystemPromptSections` becomes a deprecated final subclass that inherits everything unchanged, preserving backward compatibility. New files: - `SystemMessageSections.java`: Sealed class with all `public static final String` constants (IDENTITY, TONE, TOOL_EFFICIENCY, etc.) and Javadoc matching the naming convention used by Node, Python, .NET, Go, and Rust SDKs. - `SystemMessageSectionsIT.java`: Failsafe integration test that validates transform callbacks on IDENTITY and TONE sections receive non-empty content from the live CLI, plus an equivalence test ensuring the deprecated subclass inherits all constants correctly. Modified files: - `SystemPromptSections.java`: Gutted to an empty `@Deprecated(since="1.0.2", forRemoval=true)` final class extending `SystemMessageSections`. - `SystemMessageConfig.java`: Updated Javadoc references from `SystemPromptSections` to `SystemMessageSections`. - `SectionOverride.java`: Updated Javadoc references from `SystemPromptSections` to `SystemMessageSections`. Fixes #1679 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: edburns <75821+edburns@users.noreply.github.com>
dcacb9b to
f0e7b86
Compare
This comment has been minimized.
This comment has been minimized.
…sed inheritance tests The transform test required live CLI authentication which is unavailable in CI. Replace it with three tests that validate the sealed hierarchy without needing a live session: 1. deprecatedSystemPromptSectionsMatchesSystemMessageSections — value equality 2. systemPromptSectionsExtendsSystemMessageSections — class hierarchy check 3. allConstantsInheritedByDeprecatedClass — reflection-based exhaustive check Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Cross-SDK Consistency Review ✅This PR correctly aligns the Java SDK naming with the convention used across all other SDK implementations. Here is the cross-SDK comparison:
All 11 section constants ( Findings
Optional follow-up (out of scope for this PR)The Rust SDK uses raw string literals throughout (e.g., No cross-SDK inconsistencies introduced by this PR. 🎉
|
Introduce
SystemMessageSectionsas a sealed superclass containing all well-known section identifier constants. The existingSystemPromptSectionsbecomes a deprecated final subclass that inherits everything unchanged, preserving backward compatibility.New files:
SystemMessageSections.java: Sealed class with allpublic static final Stringconstants (IDENTITY, TONE, TOOL_EFFICIENCY, etc.) and Javadoc matching the naming convention used by Node, Python, .NET, Go, and Rust SDKs.SystemMessageSectionsIT.java: Failsafe integration test that validates transform callbacks on IDENTITY and TONE sections receive non-empty content from the live CLI, plus an equivalence test ensuring the deprecated subclass inherits all constants correctly.Modified files:
SystemPromptSections.java: Gutted to an empty@Deprecated(since="1.0.2", forRemoval=true)final class extendingSystemMessageSections.SystemMessageConfig.java: Updated Javadoc references fromSystemPromptSectionstoSystemMessageSections.SectionOverride.java: Updated Javadoc references fromSystemPromptSectionstoSystemMessageSections.Fixes #1679