Skip to content

[FEATURE]: Add a "Comments" tab before Confirm in the question prompt, and always show "Type your own answer" #39410

Closed as not planned
airvzxf/opencode
#1

Description

@airvzxf
  • I have verified this feature I'm about to request hasn't been suggested before.

Problem

The question prompt's Confirm screen shows a clean review of every selected answer and then submits. Two gaps make the flow awkward in practice:

Gap 1 — No place to add global comments before confirming

Often the right answer is one of the presented options plus a short free-form note that applies to the whole request, not to any single option. Today the only free-text input is the per-question "Type your own answer" row, which forces the user to abandon the option they just picked and retype the whole thing including their context. This is especially painful in plan mode, where the user is triaging a proposed plan and wants to say "approve, but also…" or "no, because…" alongside their selection.

Concrete examples:

  • Agent asks "Which auth approach should we use?" → user picks "JWT" → user wants to add "but only if the cookie domain is scoped to the app, not *.example.com". Today they have to type the entire sentence into the custom-answer row, losing the chosen option.
  • Plan-mode Yes/No confirmation → user wants to write "yes, but please move the migrations to a separate PR". The current UI offers no input slot for this.

Gap 2 — "Type your own answer" is hidden whenever the model sets custom: false

The UI only renders the custom-answer row when custom !== false on each Question.Info. The model is instructed not to set custom: false (see packages/opencode/src/tool/question.txt), but nothing structurally prevents it from doing so — and in practice the row sometimes disappears. The user then has no way to break out of the canned options.

Proposed solution

Two coupled changes:

1. New Comments tab before Confirm

Add a tab labeled "Comments" in the tab row, positioned right before the final Confirm tab. It opens a multi-line textarea so the user can write free-form notes that apply to the whole question request (not to one specific option). On Confirm, the textarea content is sent to the agent alongside the selected answers, so the model sees:

User has answered your questions:

  • Q1 header: <selected labels / typed text>
  • Q2 header: <selected labels / typed text>

Additional user comments: <textarea content>

The Comments tab is shown only when there is more than one question in the request, mirroring how the existing Confirm tab is hidden in single-question mode (multi-question prompts are where the global comment is most useful; single-question prompts already have the per-question custom-answer row).

2. Always render "Type your own answer"

Make the per-question "Type your own answer" row always visible in the question UI, regardless of the custom flag on Question.Info. The schema keeps the field for backward compatibility, but the UI no longer gates the row on it. The model is still told (in question.txt) that custom answers are added automatically.

This is a UI-only change — no schema change required.

Wire shape (additive)

To carry the global comment, extend the reply payload additively. The new field is optional so existing clients keep working:

- Question.Reply = { answers: Question.Answer[] }
+ Question.Reply = { answers: Question.Answer[], comments?: string }

The question tool formats the comment into the tool's reply string so the model sees both the per-question answers and the global note in one block.

Why this complements existing issues

The three proposals (#30028, #38295, this one) are complementary and can ship independently.

Files this will touch

  • packages/schema/src/question.ts — additive comments?: string on Question.Reply
  • packages/schema/src/v1/question.ts — mirror the additive change for V1 compat
  • packages/opencode/src/cli/cmd/run/question.shared.ts — extend the state machine with an extras field and tab
  • packages/opencode/src/cli/cmd/run/footer.question.tsx — render the new tab, the textarea view, and the new keyboard hints
  • packages/opencode/src/tool/question.ts — format the global comment into the tool's reply string
  • packages/opencode/src/question/index.ts — propagate comments through the reply service
  • packages/opencode/src/server/routes/instance/httpapi/groups/question.ts + handler — accept the optional comments field on POST /:requestID/reply
  • packages/opencode/src/tool/question.txt — update the model-facing description to mention the always-on custom row
  • packages/tui/src/routes/session/question.tsx — mirror the change in the legacy TUI
  • packages/app/src/pages/session/composer/session-question-dock.tsx — mirror the change in the App dock (header tabs + textarea)
  • packages/ui/src/i18n/en.ts — add ui.question.comments.placeholder, ui.question.comments.tab strings

Happy to send a PR against dev once the direction is blessed. I can split this into separate PRs (schema → TUI → App) if maintainers prefer a narrower review surface.


This issue is being opened from a community fork (airvzxf/opencode) for design review before implementation. Implementation will be sent as a PR against anomalyco/opencode's dev branch.

Activity

  1. airvzxf commented on Jul 29, 2026

    @airvzxf
    Author

    Heads-up—implementing this in PR airvzxf/opencode#1. The PR takes a different shape than the original proposal in this issue (auto-append a textOnly question inside the existing questions array, no new wire field). Reasoning and side-by-side comparison live in the PR body—a short version: avoids a Reply schema change and an HTTP API migration, and the auto-append fires for 1-question prompts too (this issue's tab approach intentionally hides Comments for single-question prompts).

    If the maintainer prefers the original comments?: string + dedicated tab approach, I can rework on top of the same branch; the second commit (the summary-view fixup) would then revert cleanly. Closing this issue from the PR (Closes #39410) when upstream merges.

    Demo (terminal recording of the full flow):

    asciicast

    Screenshots in the PR body are hosted on the fork's release airvzxf/opencode assets/comments-screenshots-2026-07-29 (asset bucket only—no code, no commits).

  2. github-actions commented on Sep 28, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  3. antonio-ivanovski commented on Oct 26, 2026

    @antonio-ivanovski

    Still relevant. Closing for inactivity doesn't remove the gap, and the auth example here is exactly my case: I want to pick "JWT" and add a condition on cookie scope, but the only way today is to retype everything under "Type your own answer", which also hides that I picked the offered option.

    The additive comments?: string on the reply is the right shape, and it's what #48820 now tracks. I hope the Comments-tab idea gets revived there rather than staying closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions