Repository navigation
Conversation
There was a problem hiding this comment.
Looks good to me. I checked it with the ACP tests: the PR's new elicitation tests fail on dev and pass here, and the ACP elicitation, turn, session and prompt test files and tsc -b in packages/cli all pass. The guard still holds: a field that mentions a secret and has no choices still keeps the whole form from being sent. Questions from the question tool are never required, so dropping <key>_custom only takes away the typed answer. websearch.provider forms already use custom: false, so they're unaffected.
Public API: unchanged. SecretQuestionMessage is a new export inside packages/cli only. The visible changes are which ACP elicitation schemas get sent and the message the model gets back, and the docs now describe both.
No blocking concerns.
There was a problem hiding this comment.
The new commit only adds an end-to-end test, and I have no concerns. It runs the real opencode acp subprocess: a choice question that mentions an API token is now sent with only q0, and a typed API-key question is held back with SecretQuestionMessage. The test fails on dev and passes here. It passed 3 runs in a row, and all of test/acp/ (103 tests) and tsc -b in packages/cli pass. The helper now answers requests from the agent through onRequest, or with a -32601 error when there's no handler, and none of the other subprocess tests are affected.
Public API: unchanged.
My earlier review had no open points.
What was wrong
With
opencode acpand a client that supportselicitation.form, thequestiontool silently held back any question whose key, title, description or option labels mentioned a password, token, secret, API key or credential. That happened even when the user could only pick from fixed choices, for example "Which API token should I use?" with options Alpha and Beta. The model then got the generic "couldn't be shown in this client" message. It read that as the client being unable to show questions, so it didn't rephrase.Root cause
requestedSchemainpackages/cli/src/acp/elicitation.tsran the credential regex over every field's prose and dropped the whole form on any match. It didn't check whether a field could actually take a typed answer. Questions from thequestiontool always allow a typed answer (custom: true, sent as an extra<key>_customstring property). So the only part of those forms that could collect a secret was that typed field, not the choices.Fix
<key>_customproperty. A closed set of choices can't collect a secret.SecretQuestionMessage. It explains why the question wasn't shown and tells the model to reword the question, offer fixed choices, or ask in its reply. Clients that can't show forms still get the existing generic message.No feature flag: this is a bug fix that narrows an existing guard. The guarantee in the docs still holds: OpenCode never sends a field that can take a typed answer when that field looks like it's asking for a secret.
Verification
packages/cli/test/acp/elicitation.test.tsfailed ondevand pass with this change:q0_custom/q1_customproperties are left out.elicitation/create, and the form is cancelled withSecretQuestionMessage.customselect with no options.bun test test/acp/elicitation.test.ts test/acp/turn.test.ts test/acp/session.test.ts test/acp/prompt.test.tsandbun typecheckinpackages/cli.Visual
Closes #61283