mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-06-10 19:37:17 -07:00
feat(btw): add experimental.btw setting and documentation
- Added `experimental.btw` setting to the settings schema. - Updated `/btw` command to check if `experimental.btw` is enabled. - Added documentation for `/btw` in `docs/reference/commands.md`. - Regenerated settings documentation in `docs/reference/configuration.md` and `docs/cli/settings.md`. - Updated unit tests for `/btw` command to provide mock context and test enablement flag.
This commit is contained in:
committed by
Mahima Shanware
parent
55a7a22471
commit
cbe297bc97
+17
-11
@@ -159,17 +159,23 @@ they appear in the UI.
|
||||
|
||||
### Experimental
|
||||
|
||||
| UI Label | Setting | Description | Default |
|
||||
| ---------------------------------------------------- | ----------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
||||
| Enable Git Worktrees | `experimental.worktrees` | Enable automated Git worktree management for parallel work. | `false` |
|
||||
| Use OSC 52 Paste | `experimental.useOSC52Paste` | Use OSC 52 for pasting. This may be more robust than the default system when using remote terminal sessions (if your terminal is configured to allow it). | `false` |
|
||||
| Use OSC 52 Copy | `experimental.useOSC52Copy` | Use OSC 52 for copying. This may be more robust than the default system when using remote terminal sessions (if your terminal is configured to allow it). | `false` |
|
||||
| Model Steering | `experimental.modelSteering` | Enable model steering (user hints) to guide the model during tool execution. | `false` |
|
||||
| Direct Web Fetch | `experimental.directWebFetch` | Enable web fetch behavior that bypasses LLM summarization. | `false` |
|
||||
| Memory Manager Agent | `experimental.memoryManager` | Replace the built-in save_memory tool with a memory manager subagent that supports adding, removing, de-duplicating, and organizing memories. | `false` |
|
||||
| Use the generalist profile to manage agent contexts. | `experimental.generalistProfile` | Suitable for general coding and software development tasks. | `false` |
|
||||
| Enable Context Management | `experimental.contextManagement` | Enable logic for context management. | `false` |
|
||||
| Topic & Update Narration | `experimental.topicUpdateNarration` | Enable the experimental Topic & Update communication model for reduced chattiness and structured progress reporting. | `false` |
|
||||
| UI Label | Setting | Description | Default |
|
||||
| ---------------------------------------------------- | ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
|
||||
| Enable Tool Output Masking | `experimental.toolOutputMasking.enabled` | Enables tool output masking to save tokens. | `true` |
|
||||
| Enable Git Worktrees | `experimental.worktrees` | Enable automated Git worktree management for parallel work. | `false` |
|
||||
| Use OSC 52 Paste | `experimental.useOSC52Paste` | Use OSC 52 for pasting. This may be more robust than the default system when using remote terminal sessions (if your terminal is configured to allow it). | `false` |
|
||||
| Use OSC 52 Copy | `experimental.useOSC52Copy` | Use OSC 52 for copying. This may be more robust than the default system when using remote terminal sessions (if your terminal is configured to allow it). | `false` |
|
||||
| Model Steering | `experimental.modelSteering` | Enable model steering (user hints) to guide the model during tool execution. | `false` |
|
||||
| Direct Web Fetch | `experimental.directWebFetch` | Enable web fetch behavior that bypasses LLM summarization. | `false` |
|
||||
| Memory Manager Agent | `experimental.memoryManager` | Replace the built-in save_memory tool with a memory manager subagent that supports adding, removing, de-duplicating, and organizing memories. | `false` |
|
||||
| Use the generalist profile to manage agent contexts. | `experimental.generalistProfile` | Suitable for general coding and software development tasks. | `false` |
|
||||
| Enable Context Management | `experimental.contextManagement` | Enable logic for context management. | `false` |
|
||||
| Agent History Truncation | `experimental.agentHistoryTruncation` | Enable truncation window logic for the Agent History Provider. | `false` |
|
||||
| Agent History Truncation Threshold | `experimental.agentHistoryTruncationThreshold` | The maximum number of messages before history is truncated. | `30` |
|
||||
| Agent History Retained Messages | `experimental.agentHistoryRetainedMessages` | The number of recent messages to retain after truncation. | `15` |
|
||||
| Agent History Summarization | `experimental.agentHistorySummarization` | Enable summarization of truncated content via a small model for the Agent History Provider. | `false` |
|
||||
| Topic & Update Narration | `experimental.topicUpdateNarration` | Enable the experimental Topic & Update communication model for reduced chattiness and structured progress reporting. | `false` |
|
||||
| Enable /btw Side Inquiries | `experimental.btw` | Enable the experimental /btw side inquiry command for ephemeral, non-persisted chat turns. | `false` |
|
||||
|
||||
### Skills
|
||||
|
||||
|
||||
@@ -49,6 +49,13 @@ Slash commands provide meta-level control over the CLI itself.
|
||||
behavior can be modified using the `advanced.bugCommand` setting in your
|
||||
`.gemini/settings.json` files.
|
||||
|
||||
### `/btw`
|
||||
|
||||
- **Description:** Ask a side question without affecting history (ephemeral).
|
||||
- **Note:** This command is experimental and requires `experimental.btw: true`
|
||||
in your `settings.json`.
|
||||
- **Usage:** `/btw <question>`
|
||||
|
||||
### `/chat`
|
||||
|
||||
- **Description:** Alias for `/resume`. Both commands now expose the same
|
||||
|
||||
@@ -1725,6 +1725,11 @@ their corresponding top-level category object in your `settings.json` file.
|
||||
for reduced chattiness and structured progress reporting.
|
||||
- **Default:** `false`
|
||||
|
||||
- **`experimental.btw`** (boolean):
|
||||
- **Description:** Enable the experimental /btw side inquiry command for
|
||||
ephemeral, non-persisted chat turns.
|
||||
- **Default:** `false`
|
||||
|
||||
#### `skills`
|
||||
|
||||
- **`skills.enabled`** (boolean):
|
||||
|
||||
@@ -2206,6 +2206,16 @@ const SETTINGS_SCHEMA = {
|
||||
'Enable the experimental Topic & Update communication model for reduced chattiness and structured progress reporting.',
|
||||
showInDialog: true,
|
||||
},
|
||||
btw: {
|
||||
type: 'boolean',
|
||||
label: 'Enable /btw Side Inquiries',
|
||||
category: 'Experimental',
|
||||
requiresRestart: false,
|
||||
default: false,
|
||||
description:
|
||||
'Enable the experimental /btw side inquiry command for ephemeral, non-persisted chat turns.',
|
||||
showInDialog: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
extensions: {
|
||||
|
||||
@@ -17,8 +17,39 @@ describe('btwCommand', () => {
|
||||
expect(btwCommand.isSafeConcurrent).toBe(true);
|
||||
});
|
||||
|
||||
it('returns an error message when args are empty', () => {
|
||||
const context = {} as CommandContext;
|
||||
it('returns an error message when btw is not enabled in settings', () => {
|
||||
const context = {
|
||||
services: {
|
||||
settings: {
|
||||
merged: {
|
||||
experimental: {
|
||||
btw: false,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} as unknown as CommandContext;
|
||||
const result = btwCommand.action!(context, 'question');
|
||||
expect(result).toEqual({
|
||||
type: 'message',
|
||||
messageType: 'error',
|
||||
content:
|
||||
'/btw is an experimental feature. To enable it, run `gemini settings set experimental.btw true`.',
|
||||
});
|
||||
});
|
||||
|
||||
it('returns an error message when args are empty and btw is enabled', () => {
|
||||
const context = {
|
||||
services: {
|
||||
settings: {
|
||||
merged: {
|
||||
experimental: {
|
||||
btw: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} as unknown as CommandContext;
|
||||
const result = btwCommand.action!(context, ' ');
|
||||
expect(result).toEqual({
|
||||
type: 'message',
|
||||
@@ -27,8 +58,18 @@ describe('btwCommand', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('returns a btw action when query is provided', () => {
|
||||
const context = {} as CommandContext;
|
||||
it('returns a btw action when query is provided and btw is enabled', () => {
|
||||
const context = {
|
||||
services: {
|
||||
settings: {
|
||||
merged: {
|
||||
experimental: {
|
||||
btw: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
} as unknown as CommandContext;
|
||||
const result = btwCommand.action!(context, ' what is this regex doing? ');
|
||||
expect(result).toEqual({
|
||||
type: 'btw',
|
||||
|
||||
@@ -12,7 +12,17 @@ export const btwCommand: SlashCommand = {
|
||||
kind: CommandKind.BUILT_IN,
|
||||
autoExecute: true,
|
||||
isSafeConcurrent: true,
|
||||
action: (_context, args) => {
|
||||
action: (context, args) => {
|
||||
const isBtwEnabled = context.services.settings.merged.experimental?.btw;
|
||||
if (!isBtwEnabled) {
|
||||
return {
|
||||
type: 'message',
|
||||
messageType: 'error',
|
||||
content:
|
||||
'/btw is an experimental feature. To enable it, run `gemini settings set experimental.btw true`.',
|
||||
};
|
||||
}
|
||||
|
||||
const query = args.trim();
|
||||
if (!query) {
|
||||
return {
|
||||
|
||||
@@ -74,7 +74,6 @@ import {
|
||||
import {
|
||||
getDisplayString,
|
||||
resolveModel,
|
||||
isGemini2Model,
|
||||
} from '../config/models.js';
|
||||
import { getResponseText, partToString } from '../utils/partUtils.js';
|
||||
import { parseThought } from '../utils/thoughtUtils.js';
|
||||
|
||||
Reference in New Issue
Block a user