Skip to content

[Bug]: Worktree setup hangs forever when the setup command fails to parse in fish, and imported t3.json actions silently go stale #32556

Open

Description

@leo-mangold

Before submitting

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

Area

Server: worktree setup scripts (ProjectSetupScriptRunner), project actions / t3.json import

Steps to reproduce

  1. Use fish as the login shell (fish 4.3.2, macOS).

  2. Give a project a synchronous setup action whose command fish cannot parse, e.g. one written for bash:

    {
      "id": "setup",
      "name": "Setup",
      "command": "node \"${HOME:-.}/x.mjs\" setup",
      "icon": "configure",
      "runOnWorktreeCreate": true,
      "async": false
    }
  3. Start a thread (or a delegated child) in a new worktree.

Expected behavior

The setup fails quickly with the shell's error shown, and the thread either starts or reports that setup failed.

Actual behavior

The thread sits on "Preparing workspace" indefinitely (we saw runs of 49 and 63 minutes before stopping them by hand). Nothing ever times out.

The setup terminal shows what happens. T3 types the fish wrapper begin / command / end; printf '\n__T3_SETUP_DONE___<token>:%s\n' $status. fish rejects the command line (fish: ${ is not a valid variable in fish.) and discards it. The trailing end; printf … then lands on the same editor line as the redisplayed command (…setupend; printf …), fails to parse too, and the completion marker is never printed. The terminal is back at an idle prompt, but the runner keeps waiting for the marker.

A related problem made this hard to diagnose. The command came from actions imported with "Import from t3.json". We later fixed t3.json in the repo, but the imported copy (in settings.json and the project record) kept the old command, and nothing showed that the two had drifted. So the fixed t3.json looked as if it "did not apply".

Impact

Major degradation or frequent failure

Version or commit

T3 Code (Beta) 0.1.7, desktop, macOS

Environment

macOS (Apple Silicon), fish 4.3.2 as login shell, mise for tool versions

Logs or stack traces

The server trace shows ProjectSetupScriptRunner.runForThread → terminal.startSession (setup-…) → one terminal.write, then nothing until ws.rpc.subscribeWorktreeSetup / ThreadLaunchService.prepareInBackground is interrupted when the user stops the thread.

Workaround

Make the action command valid in fish ("$VAR/…" instead of "${VAR:-.}/…") and update the saved action, not just t3.json (re-import, or edit the action).

Suggestions:

  • Detect that the shell returned to its prompt (fish emits OSC 133 A/D) without the marker, and fail the setup with the terminal output, or add a timeout.
  • Show when an imported action differs from the current t3.json and offer to re-sync.

Related: #24423 (the same completion-marker hang with Nushell).

Activity

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