Skip to content

fix(shared): raise question card option length limit to 300 chars - #147

Merged
Hasan-Jawaheri merged 2 commits into
mainfrom
fix/question-card-option-limit
Nov 24, 2026
Merged

Hasan-Jawaheri merged 2 commits into
mainfrom
fix/question-card-option-limit

Conversation

@Hasan-Jawaheri

@Hasan-Jawaheri Hasan-Jawaheri commented Nov 23, 2026 •

Copy link
Copy Markdown

Summary

Question cards sometimes fell back to plain blockquotes when an agent wrote an option slightly longer than 120 characters (e.g., 123–132 characters), because parseQuestionQuote enforced the same hard 120-character cap as the prompt instructions and LLMs don't reliably count exact character lengths.

What changes

  • Raised the per-option character limit in packages/shared/src/questionCards.ts (parseQuestionQuote) from 120 to 300 (MAX_OPTION_LENGTH), while leaving QUESTION_CARD_INSTRUCTIONS unchanged so agents are still guided to write concise options.
  • Even with 8 max-length options and a 500-character prompt, the quote stays well within the existing 4,000-character total quote cap, and QuestionCard options already wrap cleanly ([overflow-wrap:anywhere]).
  • Updated packages/shared/src/questionCards.test.ts to cover accepting options up to 300 characters and rejecting options over 300 characters.
  • Gave the four multi-iframe tests in apps/web/src/browserHistoryStore.browser.test.ts a 30s timeout (and documented the divergence in fork/README.md) so loading 3 srcdoc iframes on ubuntu-24.04 GitHub runners doesn't trip Vitest's 15s default timeout.

Verification

  • vp test run packages/shared/src/questionCards.test.ts apps/server/src/orchestration-v2/openQuestions.test.ts (120/120 passed)
  • vp test run apps/web/src/browserHistoryStore.browser.test.ts (10/10 passed)
  • vp run fmt:check, vp lint --report-unused-disable-directives, vp run knip:check, vp run --filter @t3tools/shared typecheck

Agent instructions still ask models to keep options concise (at most 120 characters), but models frequently overshoot by a handful of characters and silently fall back to plain blockquotes instead of interactive question cards. Raising the parser limit in parseQuestionQuote to 300 characters adds headroom while staying comfortably below the 4,000-character quote cap even with 8 options and a 500-character prompt.
@cursor

cursor Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Relaxing parser bounds is display-only and stays under the 4,000-char quote cap; the other edits are test timeouts and fork docs.

Overview
Raises parseQuestionQuote's per-option cap from 120 to 300 characters via MAX_OPTION_LENGTH, so agent-written choices that slightly exceed the documented 120-char guidance still render as question cards instead of plain blockquotes. Agent-facing instructions stay at 120; unit tests now accept options up to 300 chars and reject 301+.

On this fork, the four multi-iframe browserHistoryStore.browser.test.ts cases get 30s Vitest timeouts (with lint exceptions) because each srcdoc iframe reloads the Vite module graph and often exceeds the default 15s on slower GitHub runners; fork/README.md documents how to preserve that if upstream conflicts.

Reviewed by Cursor Bugbot for commit 511bb09. Bugbot is set up for automated code reviews on this repo. Configure here.

Each srcdoc iframe in browserHistoryStore.browser.test.ts imports the module graph fresh from the Vite dev server; on ubuntu-24.04 GitHub runners the 3-iframe test takes ~12.5-16s and repeatedly trips Vitest's 15s default timeout, cascading into the following test. Give the four multi-iframe tests a 30s timeout and record the divergence in fork/README.md.
@Hasan-Jawaheri
Hasan-Jawaheri merged commit 7d92bc6 into main Nov 24, 2026
28 checks passed
@Hasan-Jawaheri
Hasan-Jawaheri deleted the fix/question-card-option-limit branch November 24, 2026 07:49
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