GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — [Bug]: A subagent prompt that opens with comment dividers freezes the thread · Issue #38367 · pingdotgg/t3code Closed Closed Copy link DescriptionBefore submitting
Areapackages/contracts or packages/shared ( Steps to reproduce
The regex backtracks exponentially on a prompt that opens with slash-only comment dividers, and on runs of block comments. On const WORKFLOW_SCRIPT_START = /^\s*(?:(?:\/\/[^\n]*|\/\*[\s\S]*?\*\/)\s*)*export\s+const\s+meta\b/; WORKFLOW_SCRIPT_START.test("////////////\n".repeat(3) + "const x = 1;"); // 11 ms WORKFLOW_SCRIPT_START.test("////////////\n".repeat(4) + "const x = 1;"); // 242 ms WORKFLOW_SCRIPT_START.test("/".repeat(40) + "\nconst x = 1;"); // 1066 ms WORKFLOW_SCRIPT_START.test("/**/".repeat(30) + "const x = 1;"); // 5307 ms Each extra divider line multiplies the time by about 20, so six lines of twelve slashes take more than a minute. In the app: open a subagent thread from a provider other than Claude whose prompt starts with a few lines like Expected behaviorThe thread opens. A prompt that does not start with Actual behaviorThe client blocks on the regex while it renders the thread. With a handful of divider lines it does not come back. The same backtracking also lets a commented-out export match: ImpactMinor bug or occasional failure. The trigger is narrow, but when it is hit the thread cannot be opened. Version or commit
EnvironmentFound by reading the code while reviewing static-analysis findings, then confirmed by timing the regex in Node 26.13.1 on Linux x64. I have not hit it in daily use. ActivityMetadataMetadataAssigneesLabelsNo labels TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| 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. |