You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add a note to a question-card answer without losing the selected option
#32493
When an agent asks a structured question (Claude's AskUserQuestion, Codex request_user_input, Grok, OpenCode...), the user can pick an option or type a custom answer, never both. Typing in the custom field clears the selection:
web: setPendingUserInputCustomAnswer drops selectedOptionValues once the text is non-empty (apps/web/src/pendingUserInput.ts), and resolvePendingUserInputAnswer returns the custom text first.
mobile: same rule in its own copy (apps/mobile/src/lib/threadActivity.ts:1558).
Common case: "Option B, but keep the old endpoint for one release." Today that means either picking B and losing the nuance, or retyping the whole answer as free text, so the agent no longer receives the option it offered as a selection.
Native protocols already carry it
Provider
Native answer shape
Note next to a choice
Claude
answers + annotations[question].notes, "Free-text notes the user added to their selection" (@anthropic-ai/claude-agent-sdk/sdk-tools.d.ts)
Native. T3 only sends questions + answers (ClaudeAdapterV2.ts, claudeSdkUserInputAnswers)
Codex
{ answers: string[] } per question
Native convention. The Codex TUI appends the note as an extra entry "user_note: <text>" after the selected label (codex-rs/tui/src/bottom_pane/request_user_input/mod.rs)
Grok (xAI ACP)
answers + annotations[question].notes
Native, and the adapter already maps any value that is not an option label to notes (XAiAcpExtension.ts, normalizeAnswerForXAi). Only the client blocks it
OpenCode v2 forms
text field, or a list for multiselect
No dedicated field. Could be folded into the text when the field allows custom input; not possible on a multiselect without a fake entry
Antigravity
one optionId (ACP permission), allowCustomAnswer: false
Not possible
Pi select
a single value
Not possible without breaking option matching (unverified on the Pi side)
Client (web and mobile): when an option is selected, show an optional "Add a note" field instead of replacing the selection. Keep "Other" as it is for a fully custom answer.
Contract: carry the note per question in runtime-request.respond, e.g. notesByQuestionId, next to attachmentsByQuestionId. No change to ProviderUserInputAnswers.
Adapters map it natively:
Claude: annotations[questionText].notes
Codex: append "user_note: <note>" to that question's answers
Grok: annotations[questionText].notes (merged with what it builds today)
OpenCode: fold into the text field when custom is allowed, otherwise unsupported
Antigravity, Pi select, ACP elicitation: unsupported
Capability: the adapter declares whether a question accepts a note, so the client shows the field only where the note reaches the agent. A note silently dropped would be worse than no field.
Server-side precedent: question attachments are already per-question and adapter-agnostic (apps/server/src/provider/userInputAttachments.ts appends them to the answer text). A generic "append the note to the answer text" fallback would reach every provider, but it breaks providers that match answers against option labels or ids (Antigravity, Pi select, OpenCode multiselect), which is why the proposal maps per adapter.
Open questions
Unsupported providers: hide the field, or send the note as a follow-up message after the answer (one extra turn)?
Multi-select: one note for the question (Claude, Codex, and Grok all key notes per question), not one per option.
Should the web and mobile draft logic move to packages/client-runtime while touching it? Both files duplicate the same rules today.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Problem
When an agent asks a structured question (Claude's
AskUserQuestion, Codexrequest_user_input, Grok, OpenCode...), the user can pick an option or type a custom answer, never both. Typing in the custom field clears the selection:setPendingUserInputCustomAnswerdropsselectedOptionValuesonce the text is non-empty (apps/web/src/pendingUserInput.ts), andresolvePendingUserInputAnswerreturns the custom text first.apps/mobile/src/lib/threadActivity.ts:1558).Common case: "Option B, but keep the old endpoint for one release." Today that means either picking B and losing the nuance, or retyping the whole answer as free text, so the agent no longer receives the option it offered as a selection.
Native protocols already carry it
answers+annotations[question].notes, "Free-text notes the user added to their selection" (@anthropic-ai/claude-agent-sdk/sdk-tools.d.ts)questions+answers(ClaudeAdapterV2.ts,claudeSdkUserInputAnswers){ answers: string[] }per question"user_note: <text>"after the selected label (codex-rs/tui/src/bottom_pane/request_user_input/mod.rs)answers+annotations[question].notesnotes(XAiAcpExtension.ts,normalizeAnswerForXAi). Only the client blocks itoptionId(ACP permission),allowCustomAnswer: falseselectvalueProposal
runtime-request.respond, e.g.notesByQuestionId, next toattachmentsByQuestionId. No change toProviderUserInputAnswers.annotations[questionText].notes"user_note: <note>"to that question'sanswersannotations[questionText].notes(merged with what it builds today)customis allowed, otherwise unsupportedselect, ACP elicitation: unsupportedServer-side precedent: question attachments are already per-question and adapter-agnostic (
apps/server/src/provider/userInputAttachments.tsappends them to the answer text). A generic "append the note to the answer text" fallback would reach every provider, but it breaks providers that match answers against option labels or ids (Antigravity, Piselect, OpenCode multiselect), which is why the proposal maps per adapter.Open questions
packages/client-runtimewhile touching it? Both files duplicate the same rules today.Related
Checked against
mainat 4ee6bfd. No existing discussion or issue found for notes on a question answer.Written by Claude (Opus 5.5) through the Claude Code harness in T3 Code, at the user's request.
All reactions