feat(cli): add --append-system-prompt option - #4810
Conversation
- Add --append-system-prompt CLI flag to append custom instructions to system prompt - Pass appendSystemPrompt through CLI -> ExtensionService -> ExtensionHost -> ExtensionState - Integrate with system prompt generation in src/core/prompts/system.ts - Add tests for CLI flag parsing and system prompt appending - Add changeset for patch release
🦋 Changeset detectedLatest commit: 69133f6 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge OverviewThis PR adds a Key Changes
Implementation Quality✅ Properly handles undefined/empty Files Reviewed (12 files)
|
The appendSystemPrompt property was added to ExtensionServiceOptions but not properly excluded from the Required<> type constraint, causing a TypeScript error. This fix: 1. Adds appendSystemPrompt to the Omit<> list in the options type 2. Adds appendSystemPrompt as an optional property in the type union 3. Spreads appendSystemPrompt into the options object when provided
Changed single-line comment to start/end markers for the multi-line appendSystemPrompt block in system.ts as per project conventions.
…ompt The --append-system-prompt CLI option was not working because the value was not being properly propagated through the full chain: 1. Added appendSystemPrompt to globalSettingsSchema in packages/types so it's recognized as a valid RooCodeSettings key 2. Added sync logic in ExtensionHost.syncConfigurationMessages() to send appendSystemPrompt to the extension via updateSettings message 3. Added appendSystemPrompt to getState() return object in ClineProvider.ts so it's included in ClineProviderState (which is passed to SYSTEM_PROMPT) 4. Added appendSystemPrompt to CLI's ExtensionState interface for type safety The full data flow is now: CLI options -> ExtensionService -> ExtensionHost.syncConfigurationMessages() -> updateSettings message -> contextProxy.setValue() -> getState() -> ClineProviderState -> SYSTEM_PROMPT() -> appended to prompt
CLI code is Kilo Code-specific and doesn't need kilocode_change markers since it won't be merged with upstream Roo Code.
0b69406 to
e54d556
Compare
… display state in the command_list (resolves Kilo-Org#4582) (Kilo-Org#4810) Co-authored-by: GitHub Action <action@github.com> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com> Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
… display state in the command_list (resolves Kilo-Org#4582) (Kilo-Org#4810)
… display state in the command_list (resolves Kilo-Org#4582) (Kilo-Org#4810) Co-authored-by: GitHub Action <action@github.com> Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com> Co-authored-by: rekram1-node <rekram1-node@users.noreply.github.com> Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
Summary
Add support for appending custom instructions to the system prompt via CLI flag.
Changes
--append-system-prompt <text>option to the CLI APIsrc/core/prompts/system.tsTesting
cli/src/__tests__/append-system-prompt.test.tsUsage
The custom text will be appended to the system prompt when the agent runs.
Related
Implements TDD approach with tests written first, then implementation.