GeezerVison is showing github.com — feat(questions): enhance questions TUI + add full descendants support by mortimr · Pull Request #7653 · anomalyco/opencode
Conversation
mortimr
commented
Jan 10, 2026
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
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
Short single with from
Simple Multi-select without from
Simple Multi-select with from
Multi-Question
Long Markdown question (dark zone is scrollable)
Support for Markdown in the discussion answers
(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
|
Thanks for your contribution!
This PR doesn't have a linked issue. All PRs must reference an existing issue.
Please:
- Open an issue describing the bug/feature (if one doesn't exist)
- Add
Fixes #<number> or Closes #<number> to this PR description
See CONTRIBUTING.md for details.
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
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
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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
- 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
- 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
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
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|