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 — [Bug]: A subagent prompt that opens with comment dividers freezes the thread · Issue #38367 · pingdotgg/t3code

[Bug]: A subagent prompt that opens with comment dividers freezes the thread #38367

New issue
Copy link
New issue
Copy link
Closed
#38368
Closed
[Bug]: A subagent prompt that opens with comment dividers freezes the thread#38367
#38368
Copy link

Description

@mInrOz
mInrOz
opened on Nov 17, 2026
Issue body actions

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

packages/contracts or packages/shared (packages/client-runtime, used by web, desktop and mobile)

Steps to reproduce

isWorkflowScriptMessage in packages/client-runtime/src/state/subagentRuntime.ts tests the first user message of a provider-native subagent thread against WORKFLOW_SCRIPT_START whenever the server did not set workflowScript on that message. Only the Claude adapter sets it, so other providers' subagent threads and older threads take this path.

The regex backtracks exponentially on a prompt that opens with slash-only comment dividers, and on runs of block comments. On main at 7b44788, Node 26.13.1:

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 ////////////////////////////////////////, for example a prompt that quotes a source file with divider comments at the top.

Expected behavior

The thread opens. A prompt that does not start with export const meta after its leading comments is rejected in linear time.

Actual behavior

The 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: // export const meta = {} is treated as a workflow script, because [^\n]* can stop before the end of the line.

Impact

Minor bug or occasional failure. The trigger is narrow, but when it is hit the thread cannot be opened.

Version or commit

main at 7b44788; the regex was added in #20857.

Environment

Found 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.

Activity

  1. juliusmarminge
    closed this as completedin #38368on Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue 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.