Compare commits

..

3 Commits

Author SHA1 Message Date
Christine Betts 675b3d7834 test docs change 2026-02-02 17:20:03 -05:00
Jack Wotherspoon ae672881d1 docs: update clearContext to hookSpecificOutput (#18024) 2026-02-02 17:32:37 +00:00
Jerop Kipruto 9e7c10ad88 feat(plan): use placeholder for choice question "Other" option (#18101) 2026-02-02 17:00:13 +00:00
9 changed files with 115 additions and 10 deletions
+4 -4
View File
@@ -15,13 +15,13 @@ as security auditing, cloud deployments, or codebase migrations—without
cluttering the model's immediate context window.
Gemini autonomously decides when to employ a skill based on your request and the
skill's description. When a relevant skill is identifieddd, the model "pulls in"
skill's description. When a relevant skill is identified, the model "pulls in"
the full instructions and resources required to complete the task using the
`activate_skill` tool.
## Key Benefits
- **Shared Expertise:** Package complex workflows (like a specific team's PR
- **Shared Expertise:** Package complex workflows (like a a specific team's PR
review process) into a folder that anyone can use.
- **Repeatable Workflows:** Ensure complex multi-step tasks are performed
consistently by providing a procedural framework.
@@ -108,5 +108,5 @@ gemini skills disable my-expertise --scope workspace
## Creating your own skills
To create your own skills, see see the
[Create Agent Skills](./creating-skills.md) guide.
To create your own skills, see the [Create Agent Skills](./creating-skills.md)
guide.
+1 -1
View File
@@ -264,7 +264,7 @@ primary ways of releasing extensions are via a Git repository or through GitHub
Releases. Using a public Git repository is the simplest method.
For detailed instructions on both methods, please refer to the
[Extension Releasing Guide](./broken-link/releasing.md).
[Extension Releasing Guide](./releasing.md).
## Conclusion
+2 -2
View File
@@ -167,8 +167,8 @@ case is response validation and automatic retries.
- `reason`: Required if denied. This text is sent **to the agent as a new
prompt** to request a correction.
- `continue`: Set to `false` to **stop the session** without retrying.
- `clearContext`: If `true`, clears conversation history (LLM memory) while
preserving UI display.
- `hookSpecificOutput.clearContext`: If `true`, clears conversation history
(LLM memory) while preserving UI display.
- **Exit Code 2 (Retry)**: Rejects the response and triggers an automatic retry
turn using `stderr` as the feedback prompt.
@@ -1008,4 +1008,71 @@ describe('AskUserDialog', () => {
// Should contain the full long question (or at least its parts)
expect(lastFrame()).toContain('This is a very long question');
});
describe('Choice question placeholder', () => {
it('uses placeholder for "Other" option when provided', async () => {
const questions: Question[] = [
{
question: 'Select your preferred language:',
header: 'Language',
options: [
{ label: 'TypeScript', description: '' },
{ label: 'JavaScript', description: '' },
],
placeholder: 'Type another language...',
multiSelect: false,
},
];
const { stdin, lastFrame } = renderWithProviders(
<AskUserDialog
questions={questions}
onSubmit={vi.fn()}
onCancel={vi.fn()}
width={80}
/>,
{ width: 80 },
);
// Navigate to the "Other" option
writeKey(stdin, '\x1b[B'); // Down
writeKey(stdin, '\x1b[B'); // Down to Other
await waitFor(() => {
expect(lastFrame()).toMatchSnapshot();
});
});
it('uses default placeholder when not provided', async () => {
const questions: Question[] = [
{
question: 'Select your preferred language:',
header: 'Language',
options: [
{ label: 'TypeScript', description: '' },
{ label: 'JavaScript', description: '' },
],
multiSelect: false,
},
];
const { stdin, lastFrame } = renderWithProviders(
<AskUserDialog
questions={questions}
onSubmit={vi.fn()}
onCancel={vi.fn()}
width={80}
/>,
{ width: 80 },
);
// Navigate to the "Other" option
writeKey(stdin, '\x1b[B'); // Down
writeKey(stdin, '\x1b[B'); // Down to Other
await waitFor(() => {
expect(lastFrame()).toMatchSnapshot();
});
});
});
});
@@ -780,7 +780,7 @@ const ChoiceQuestionView: React.FC<ChoiceQuestionViewProps> = ({
// Render inline text input for custom option
if (optionItem.type === 'other') {
const placeholder = 'Enter a custom value';
const placeholder = question.placeholder || 'Enter a custom value';
return (
<Box flexDirection="row">
{showCheck && (
@@ -1,5 +1,25 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
exports[`AskUserDialog > Choice question placeholder > uses default placeholder when not provided 1`] = `
"Select your preferred language:
1. TypeScript
2. JavaScript
● 3. Enter a custom value
Enter to submit · Esc to cancel"
`;
exports[`AskUserDialog > Choice question placeholder > uses placeholder for "Other" option when provided 1`] = `
"Select your preferred language:
1. TypeScript
2. JavaScript
● 3. Type another language...
Enter to submit · Esc to cancel"
`;
exports[`AskUserDialog > Scroll Arrows (useAlternateBuffer: false) > shows scroll arrows correctly when useAlternateBuffer is false 1`] = `
"Choose an option
+1 -1
View File
@@ -148,7 +148,7 @@ export interface Question {
options?: QuestionOption[];
/** Allow multiple selections. Only applies when type='choice'. */
multiSelect?: boolean;
/** Placeholder hint text. Only applies when type='text'. */
/** Placeholder hint text. For type='text', shown in the input field. For type='choice', shown in the "Other" custom input. */
placeholder?: string;
}
+18
View File
@@ -177,6 +177,24 @@ describe('AskUserTool', () => {
expect(result).toBeNull();
});
it('should accept placeholder for choice type', () => {
const result = tool.validateToolParams({
questions: [
{
question: 'Which language?',
header: 'Language',
type: QuestionType.CHOICE,
options: [
{ label: 'TypeScript', description: 'Typed JavaScript' },
{ label: 'JavaScript', description: 'Dynamic language' },
],
placeholder: 'Type another language...',
},
],
});
expect(result).toBeNull();
});
it('should return error if option has empty label', () => {
const result = tool.validateToolParams({
questions: [
+1 -1
View File
@@ -90,7 +90,7 @@ export class AskUserTool extends BaseDeclarativeTool<
placeholder: {
type: 'string',
description:
"Only applies when type='text'. Hint text shown in the input field.",
"Hint text shown in the input field. For type='text', shown in the main input. For type='choice', shown in the 'Other' custom input.",
},
},
},