anomalyco / anomalyco/opencode

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

Open
#39,410 1 comment 0 reactions 1 assignee View on GitHub

@jlongster is already working on this.

Since Jul 28, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

  • 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

  • #8930 (closed): same intent ("allow custom comment in Asking Question"), closed as a duplicate without a working solution — this proposal carries the same idea forward with a concrete wire shape.
  • #17108 (closed): text qualifier per option — orthogonal. Per-option qualifiers and a global comment box both have value.
  • #30028 (open): inline input field on specific options — model-driven, requires a schema change. The Comments tab is user-driven and additive.
  • #38295 (open): Tab to extend a question option into a custom answer — orthogonal; extends a single option in place. The Comments tab extends the whole request before confirmation.
  • #34476 (open): auto-enter edit mode on "Type your own answer" — UX detail on the per-question row that we are already keeping.

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.