Skip to content

Commit 59e4455

Browse files
chazcbclaude
andcommitted
Add hint and default optional fields to input options schema
- Add `hint` for UI guidance (placeholder text, input hints) - Add `default` for declaring default values agents will use - Update examples to demonstrate usage - Add open question about whether both description and hint are needed Co-Authored-By: Claude <[email protected]>
1 parent a9dc390 commit 59e4455

File tree

1 file changed

+60
-12
lines changed

1 file changed

+60
-12
lines changed

docs/rfds/session-input-options.mdx

Lines changed: 60 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -49,20 +49,25 @@ Add an `inputOptions` field to `InitializeResponse` that declares what options a
4949
"newSession": {
5050
"model": {
5151
"enum": ["claude-sonnet-4-20250514", "claude-opus-4-20250514", "claude-haiku"],
52+
"default": "claude-sonnet-4-20250514",
5253
"description": "Model to use for this session"
5354
},
5455
"systemPrompt": {
5556
"type": "string",
56-
"description": "Custom system prompt to guide the agent's behavior"
57+
"description": "Custom system prompt to guide the agent's behavior",
58+
"hint": "You are a helpful coding assistant..."
5759
},
5860
"enabledSubagents": {
5961
"type": "array",
6062
"items": { "type": "string" },
61-
"description": "List of subagent IDs to enable for this session"
63+
"description": "List of subagent IDs to enable for this session",
64+
"default": []
6265
},
6366
"maxTokens": {
6467
"type": "integer",
65-
"description": "Maximum tokens per response"
68+
"description": "Maximum tokens per response",
69+
"default": 4096,
70+
"hint": "Enter a value between 1 and 8192"
6671
}
6772
},
6873
"loadSession": {
@@ -103,13 +108,18 @@ Clients pass input options via `inputOptions` on `NewSessionRequest` and `LoadSe
103108
**For Clients:**
104109
- Query `inputOptions` from `InitializeResponse` to know what the Agent accepts
105110
- Build dynamic forms showing available options with proper input types (text fields, dropdowns for enums, checkboxes for booleans)
111+
- Use `description` to show help text explaining each option
112+
- Use `hint` for placeholder text or input guidance (e.g., example values)
113+
- Pre-populate form fields with `default` values when provided
106114
- Show different options for "New Session" vs "Load Session" flows
107115
- Gracefully handle Agents that don't declare any `inputOptions`
108116

109117
**For Agents:**
110-
- Declare supported options with types and descriptions
118+
- Declare supported options with types, descriptions, hints, and defaults
119+
- Use `default` to communicate the value that will be used if the client omits the option
120+
- Use `hint` to provide example values or input guidance for clients to display
111121
- MUST handle all options as optional - clients may not provide all (or any) options
112-
- MUST provide sensible defaults for undeclared options
122+
- MUST use declared `default` values when options are not provided by the client
113123
- Can declare standard ACP options (`cwd`, `mcpServers`) in `inputOptions` to indicate explicit support
114124

115125
**Key behaviors:**
@@ -126,14 +136,19 @@ Clients pass input options via `inputOptions` on `NewSessionRequest` and `LoadSe
126136
The `inputOptions` schema uses a simplified JSON Schema subset to balance expressiveness with cross-language compatibility:
127137

128138
```typescript
139+
interface InputOptionBase {
140+
description?: string; // Human-readable description of the option
141+
hint?: string; // UI hint (e.g., placeholder text for input fields)
142+
}
143+
129144
type InputOptionSchema =
130-
| { type: "string"; description?: string }
131-
| { type: "number"; description?: string }
132-
| { type: "integer"; description?: string }
133-
| { type: "boolean"; description?: string }
134-
| { enum: (string | number | boolean | null)[]; description?: string }
135-
| { type: "array"; items: InputOptionSchema; description?: string }
136-
| { type: "object"; properties: Record<string, InputOptionSchema>; required?: string[]; description?: string };
145+
| InputOptionBase & { type: "string"; default?: string }
146+
| InputOptionBase & { type: "number"; default?: number }
147+
| InputOptionBase & { type: "integer"; default?: number }
148+
| InputOptionBase & { type: "boolean"; default?: boolean }
149+
| InputOptionBase & { enum: (string | number | boolean | null)[]; default?: string | number | boolean | null }
150+
| InputOptionBase & { type: "array"; items: InputOptionSchema; default?: unknown[] }
151+
| InputOptionBase & { type: "object"; properties: Record<string, InputOptionSchema>; required?: string[]; default?: Record<string, unknown> };
137152

138153
interface InitializeResponse {
139154
protocolVersion: number;
@@ -159,6 +174,18 @@ interface LoadSessionRequest {
159174
}
160175
```
161176

177+
### Optional metadata fields
178+
179+
All option types support three optional metadata fields:
180+
181+
- **`description`** - Human-readable explanation of what the option does. Clients typically display this as help text or tooltips.
182+
183+
- **`hint`** - UI guidance for input fields. For text inputs, this is typically shown as placeholder text. For numeric inputs, it might describe valid ranges. For enums, it could explain how to choose between options.
184+
185+
- **`default`** - The value the agent will use if the client doesn't provide this option. Clients SHOULD pre-populate form fields with default values. Agents MUST use the declared default when an option is omitted.
186+
187+
All three fields are optional. Agents can declare options with just a type, or provide any combination of these metadata fields.
188+
162189
### Why JSON Schema subset instead of `select`/`text` types?
163190

164191
The existing [Session Config Options RFD](./session-config-options) uses `select` and `text` types because runtime selectors are primarily UI widgets - dropdowns and text fields.
@@ -284,6 +311,27 @@ Feedback welcome on which approach the community prefers.
284311

285312
No. Agents MUST handle missing options gracefully. Clients MAY not support input options UI. This is purely for discoverability and better UX.
286313

314+
### Should we have both `description` and `hint`, or just `description`?
315+
316+
This is an open question. The current proposal includes both:
317+
318+
- **`description`** - Explains what the option does (shown as help text/tooltip)
319+
- **`hint`** - Provides input guidance (shown as placeholder text)
320+
321+
**Arguments for having both:**
322+
- They serve different UI purposes: `description` is explanatory, `hint` is exemplary
323+
- Matches common form patterns where labels/help text differ from placeholder text
324+
- Allows "System prompt" (description) vs "You are a helpful assistant..." (hint)
325+
326+
**Arguments for just `description`:**
327+
- Simpler schema with fewer fields to implement
328+
- Clients can derive placeholder text from description if needed
329+
- Less ambiguity about which field to use for what purpose
330+
- Many options don't need both (e.g., boolean toggles, enum dropdowns)
331+
332+
Feedback welcome on whether the added complexity of `hint` is worth it.
333+
287334
## Revision history
288335

336+
- 2025-01-26: Added `hint` and `default` optional fields to schema
289337
- 2025-01-22: Initial draft

0 commit comments

Comments
 (0)