Skip to content

fix: bump question tool max options from 4 to 10 - #69

Merged
striderZA merged 2 commits into
masterfrom
fix/question-tool-max-items
Jun 22, 2026
Merged

fix: bump question tool max options from 4 to 10#69
striderZA merged 2 commits into
masterfrom
fix/question-tool-max-items

Conversation

@striderZA

Copy link
Copy Markdown
Owner

The question tool's TypeBox schema enforced maxItems: 4, rejecting any call with 5+ options at validation time before the TUI even runs. Bumped to 10 -- covers more options without going unbounded.\n\nChange: .pi/extensions/ocgs-question/index.ts line 52, maxItems: 4maxItems: 10.

@github-actions

Copy link
Copy Markdown
Contributor

Review: fix/question-tool-max-items

Change: .pi/extensions/ocgs-question/index.ts:69maxItems: 4maxItems: 10

Verdict: Changes look correct functionally. One inconsistency to fix:

Must fix

  1. Stale promptGuidelines (line 86): Still says "2-4 options" — needs to match the new schema:
    "Use the question tool when you need the user to make a strategic choice between 2-10 options."
    

Should fix (pre-existing, now more visible)

  1. No scrolling in TUI (lines 253–267): The render function iterates all options linearly with no scroll window. On a small terminal, 10 options + "Type something." + descriptions could overflow. Consider adding a scrollOffset tracked alongside optionIndex to show a window of ~5-6 at a time.

  2. No number-key shortcuts (lines 170–212): Options render as 1., 2., ... 10. but pressing those digits does nothing — only ↑↓ navigate. Adding digit-to-index mapping would make 10+ options much faster to use.

  3. Alignment at 10+ (line 258): i + 1. produces 10. (3 chars) vs 1. (2 chars), shifting the description indentation for double-digit entries. Padding with padStart would keep things aligned.

Low severity

  • The renderCall (line 376) and renderResult (line 404) helpers work correctly regardless of count — no changes needed.
  • Logging, QuestionDetails interface, and the simpleOptions mapping all handle arbitrary array lengths fine.

Overall: The core schema change is correct and minimal. Fix the stale prompt guidelines before merging.

New%20session%20-%202026-06-22T17%3A44%3A38.736Z
opencode session  |  github run

- Fix stale promptGuidelines: '2-4 options' → '2-10 options'
- Add scrollable option window (VISIBLE_OPTIONS=6) with '↑ more'/'↓ more'
- Add number-key shortcuts: 1-9 selects option, 0 selects 'Type something.'
- Pad option numbers so double-digit '10.' keeps indentation aligned
- Update footer hint to show the new shortcuts
@striderZA
striderZA merged commit 9a703bd into master Jun 22, 2026
@striderZA
striderZA deleted the fix/question-tool-max-items branch June 22, 2026 18:16
@github-actions

Copy link
Copy Markdown
Contributor

fatal: couldn't find remote ref fix/question-tool-max-items

opencode session  |  github run

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant