GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(questions): enhance questions TUI + add full descendants support by mortimr · Pull Request #7653 · anomalyco/opencode

Conversation

@mortimr

@mortimr mortimr commented Jan 10, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Summary

This PR fixes nested agent questions not appearing in the TUI and improves question tool UX.
Fixes #7654

Problem

When using ohmyopencode (or similar setups) with sub-agents spawning other agents via background_task, questions from deeply nested agents don't show up in the main session's TUI. The old code only looked at direct children sessions, missing questions from grandchildren and beyond.

To reproduce (without this PR):

Do the following:
- spawn one subagent
- from this subagent spawn 3 background_task and give them a name (one, two and three)
- in each background_task ask 3 questions (ask if I prefer python or typescript). Include both the background_task name and the question number.
Once all is done, give me a summary of all answers

The questions never appear in the TUI.

Solution

Core Fix: Nested Agent Questions

  • Changed from direct children lookup to BFS traversal of all session descendants
  • Questions from any depth now surface to the root session
  • Added from parameter so users know which agent is asking ("Question from explorer-agent")

QoL Improvements

The remaining changes are quality-of-life tweaks to improve the interview workflow:

  • Answer display: Table layout with borders, word wrapping, multi-select answers on separate lines
  • Multi-select UX: Checkbox prefixes (☐/■), space to toggle, enter to confirm
  • Question type indicator: "Single"/"Multiple" tag in bottom bar
  • State reset: Fix stale selections bleeding into new questions

Test Infrastructure

  • OPENCODE_TEST_SKIP_GIT env var to skip git init (for commit signing setups)
  • Print OPENCODE_TEST_* vars at test start for visibility

Verification

  • Tested the reproduction prompt above - questions now appear
  • Manually verified single/multi-select flows
  • Added tests for from field

Screenshots

Short single without from

Screenshot 2026-01-10 at 23 26 22

Short single with from

Screenshot 2026-01-10 at 23 26 50

Simple Multi-select without from

Screenshot 2026-01-10 at 23 27 30

Simple Multi-select with from

Screenshot 2026-01-10 at 23 29 29

Multi-Question

Screenshot 2026-01-10 at 23 28 12

Long Markdown question (dark zone is scrollable)

Screenshot 2026-01-10 at 23 19 22

Support for Markdown in the discussion answers

Screenshot 2026-01-10 at 23 12 31

(this PR was mainly done by opencode with my supervision, I've been using the question workflow heavily lately with the https://github.com/paulp-o/ask-user-questions-mcp MCP. It's so great that we have questions natively in opencode now, but there descendant issue was preventing my old workflows from working properly as questions weren't bubbling up from lower than direct child agents. Also added some TUI improvements)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

crper reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@github-actions github-actions Bot added the needs:issue label Jan 10, 2026
@github-actions

github-actions Bot commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions

github-actions Bot commented Jan 10, 2026

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

Based on my searches, I found no duplicate PRs. The searches returned PR #7653 (the current PR) and some tangentially related PRs (like PR #6681 for the ask_user tool feature and PR #5020 for the TUI layout system), but none that specifically address the nested agent questions issue or the specific UX improvements mentioned in this PR.

No duplicate PRs found

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@github-actions github-actions Bot removed the needs:issue label Jan 10, 2026
@mortimr mortimr changed the title feat(opencode): fix nested agent questions and improve question tool UX feat(questions): fix nested agent questions and improve question tool UX Jan 10, 2026
mortimr added 2 commits January 10, 2026 23:33
@mortimr
feat(opencode): fix nested agent questions and improve question tool UX
f99b84a
- Fix questions from nested sub-agents not surfacing to root session (BFS traversal)
- Add 'from' field to identify which agent is asking
- Improve answer display with bordered table layout
- Overhaul multi-select: checkbox prefixes, space to toggle, enter to confirm
- Add OPENCODE_TEST_SKIP_GIT env var for test fixtures
@mortimr
feat(tui): add markdown support for question display
8cf1572
- Replace plain text rendering with syntax-highlighted code component for questions
- Add scrollable content area with height constraints for better readability
- Improve layout structure with proper flex properties and padding
- Update documentation to reflect markdown syntax support in question field
- Extract terminal dimensions for responsive layout calculations
@mortimr mortimr mentioned this pull request Jan 11, 2026
feat(web): add question tool support to web UI #7732
Closed
2 tasks
@mortimr mortimr changed the title feat(questions): fix nested agent questions and improve question tool UX feat(questions): enhance questions TUI + add full descendants support Jan 11, 2026
This was referenced Jan 13, 2026
feat(desktop): Ask Question Tool Support #8232
Merged
feat(tui): improve question prompt UX #8339
Merged
@github-actions github-actions Bot mentioned this pull request Jan 25, 2026
fix(questions): fixes #7654 where sub-sub agents can't ask questions #10539
Closed
@thdxr
thdxr force-pushed the dev branch from cbab81f to 2d3c7a0 Compare January 30, 2026 04:50
@opencode-agent
opencode-agent Bot force-pushed the dev branch from 00637c0 to 71e0ba2 Compare January 30, 2026 14:32
@thdxr
thdxr force-pushed the dev branch 3 times, most recently from f1ae801 to 08fa7f7 Compare January 30, 2026 14:37
@mortimr mortimr closed this by deleting the head repository Feb 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

[BUG] Questions from nested sub-agents don't appear in TUI

Uh oh!

There was an error while loading. Please reload this page.

1 participant

@mortimr
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.