You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(server): setup scripts complete with shell line editors - #25472
Bash line editors can treat carriage-return-separated setup wrappers as unfinished multiline input. Worktree setup then never reports completion and the waiting agent cannot start.
Change
Submit complete POSIX commands with encoded script text, preserve trailing newlines, and evaluate in a subshell before reporting exit status. Long scripts use bounded, independently complete assignments. Preserve Fish, PowerShell, and main's startup-readiness handling. Reuse the existing test harness instead of adding another mock runner.
Scope and approval
This is an obvious, focused bug fix under the small-fix contribution exception. It only repairs POSIX completion-observed setup and settle delivery, preserving the original intent and all other shell paths. Maintainer takeover was already recorded on https://git.cafe/pingdotgg/t3code/pulls/17817, and Maria explicitly requested this replacement after the archived fork rejected pushes.
Verification
vp run check:changed passed through Blacksmith: format, lint, both knip passes, GraphQL generation, affected typechecks, and all 12 adjacent tests. The six shell cases include literals/heredocs, long input, stdin, trailing backslash-newline, explicit exit, and syntax error. Two fail against current main before the fix.
Real dev client with Bash 5.2 and ble.sh: main remains in MULTILINE with setup waiting; this branch completes the same setup and the Codex agent replies setup verified.
Additional real node-pty checks pass with plain Bash and ble.sh: multiline/heredoc, trailing backslash-newline, explicit exit 7, syntax error 2, and 120-line Unicode script.
Two independent GPT-6.1-Sol static reviews found no blockers. The replacement's file contents are identical to the reviewed merge candidate.
Unverified: native zsh, Fish, PowerShell, macOS/Windows, mobile/Electron, relay/tunnel. Long-input byte limits are tested; the long case was not repeated through the browser. Existing cosmetic limit: line-editor redraws can show internal assignments for long scripts.
The contributor fork is archived and rejects maintainer pushes. Compared with the original PR's current diff, this retains its production wrapper and all six shell regression cases, replaces the duplicate test harness with main's harness, and preserves main's startup-readiness tests. No behavior was dropped. The commit credits Abid A Gafoor.
Built with GPT-6.1-Sol in the Codex harness on T3 Code.
Macroscope's review found this PR approvable — Updates POSIX setup-script completion handling to work with shell line editors and long commands. Existing script selection and execution restrictions remain unchanged, keeping the change narrowly scoped.
No code changes detected at 8c07e7f. Prior analysis still applies.
You can add or adjust custom eligibility rules. Learn more.
Reviewing files that changed from the base of the PR and between 4e318cc and 8c07e7f.
You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.
Use the checkbox below for a quick retry:
Trigger review
No actionable comments were generated in the recent review.
Walkthrough
The POSIX completion wrapper encodes and evaluates setup commands in a subshell, splits long commands into terminal-sized chunks, and reports their exit status. Tests cover multiline scripts, long commands, stdin, trailing backslash-newline behavior, and exit codes.
Changes: POSIX setup command delivery
Layer / File(s)
Summary
POSIX wrapper and execution validation apps/server/src/project/ProjectSetupScriptRunner.ts, apps/server/src/project/ProjectSetupScriptRunner.test.ts
The wrapper encodes and evaluates commands in a subshell, splits commands that exceed the 1,023-byte limit, and emits the command status. Live tests run submitted commands through Bash and check multiline syntax, literal text, long scripts, stdin, trailing backslash-newline behavior, and exit codes.
pingdotgg/t3code#24775: Both PRs change setup command delivery in ProjectSetupScriptRunner; this PR changes the POSIX wrapper sent after shell readiness.
pingdotgg/t3code#23576: Both PRs modify the shell-specific completion behavior in ProjectSetupScriptRunner.
pingdotgg/t3code#24428: Both PRs modify setup-script completion wrappers and exit-status reporting.
Suggested labels:bugfix
Suggested reviewers:t3dotgg, juliusmarminge
Merge Risk: Minimal · previous review 4e318
No demonstrated issue prevents merging after normal checks; the reported interactive-shell checks remain unverified.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: setup scripts now complete when a shell line editor (Bash with ble.sh) is in use. It matches the changeset, which changes the POSIX setup wrapper so that submitted com…
Description check
The description follows the repository template. It has Problem, Change, Scope and approval, and Verification sections, plus a takeover note. The Problem section gives the bug and its effect, and the …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: setup scripts now complete when a shell line editor (Bash with ble.sh) is in use. It matches the changeset, which changes the POSIX setup wrapper so that submitted commands complete, and it follows the conventional commit format. The title is concise and specific.
Full details: Description check
Explanation
The description follows the repository template. It has Problem, Change, Scope and approval, and Verification sections, plus a takeover note. The Problem section gives the bug and its effect, and the Change section explains the fix. Scope cites the small-fix exception and the prior takeover PR. Verification lists the checks run, the observed results, and what was not verified, including zsh, Fish, PowerShell, macOS/Windows, and mobile/Electron. The template's agent-model line is present at the end. The description covers what the template requires.
Finishing Touches
Generate docstrings
Commit to this branch
Create a new PR
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
verified unchanged head 301c1a1a30b00a7ef3bae145ef3c6c310a0f8ff7 on this linux boat vm. git.cafe and github both use https://git.cafe/pingdotgg/t3code/pulls/25472. the pr is open; its sole commit has no authors from the excluded maintainer accounts.
installed dependencies with vp i in a separate github/main worktree (4914cdd98f) and on the exact pr head. ran both dev environments in the background with separate state. used repository playwright and /usr/bin/google-chrome.
created a project pointing at a real git repository through the client. configured a synchronous worktree setup action through the action editor. used bash 5.2.21 with ble.sh cb9c2c3.
on main, the multiline script with an apostrophe, quoted heredoc, unicode, and a trailing comment stays in ble.sh's MULTILINE state. setup waits and the provider does not start.
on this head, the same script completes, creates setup-proof.txt, and starts a real codex gpt-6.1-sol turn through the local proxy. codex runs cat setup-proof.txt and returns setup verified.
neighboring behavior: a 120-line unicode/quoted/backslash script completes through the same worktree flow, then codex reads its proof file. exit 7 reports exactly that status in the client and prevents the agent from starting.
blacksmith vp run check:changed 071239804e375078dd3fae3b14704b4def57e048 passed format, lint, both knip passes, graphql generation, affected typechecks, and all 12 adjacent tests. an explicit pr base was needed because the worker has shallow history. the pr currently has 29 successful checks, none failing or pending.
native ios/android and electron clients, macos/windows, zsh/fish/powershell, relay/tunnel connections, other providers, and the settle-trigger path were not exercised on this linux web-client pass. interactive stdin and trailing backslash-newline have passing adjacent automated coverage, but were not repeated through the browser. no performance claim is made; ble.sh redraws expose internal assignments during long scripts.
GigaZoro
pushed a commit
to GigaZoro/CodeShip
that referenced
this pull request
Oct 30, 2026
Upstream pingdotgg#25472 runs setup scripts through eval so shell line editors complete them. macOS /bin/bash 3.2 exits 1 for a syntax error inside eval where bash 4+ exits 2; both still report a failed setup.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reproduced on T3 Code 0.1.7-nightly.20261102.4061 (server on Linux, Bash 5.3.9, ble.sh 0.4.0-nightly+fb1811e). A worktree setup script stayed in ble.sh's -- MULTILINE -- (RET or C-m: insert a newline, C-j: run) state, the step sat on "Seed Unity Library" for several minutes, and the agent never started. The script itself runs in about 10 ms when invoked directly.
Typing the current POSIX wrapper (( cmd\r); printf '\n__T3_SETUP_DONE__%s\n' "$?"\r) into an interactive Bash with ble.sh attached reproduces it. With ble.sh left detached, the same input prints the sentinel. I'm working around it by skipping ble-attach when NO_COLOR=1 and FORCE_COLOR=0, which only setup terminals set. I'd like to drop that once this lands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
size:M30-99 changed lines (additions + deletions).vouch:trustedPR author is trusted by repo permissions or the VOUCHED list.
2 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Bash line editors can treat carriage-return-separated setup wrappers as unfinished multiline input. Worktree setup then never reports completion and the waiting agent cannot start.
Change
Submit complete POSIX commands with encoded script text, preserve trailing newlines, and evaluate in a subshell before reporting exit status. Long scripts use bounded, independently complete assignments. Preserve Fish, PowerShell, and main's startup-readiness handling. Reuse the existing test harness instead of adding another mock runner.
Scope and approval
This is an obvious, focused bug fix under the small-fix contribution exception. It only repairs POSIX completion-observed setup and settle delivery, preserving the original intent and all other shell paths. Maintainer takeover was already recorded on https://git.cafe/pingdotgg/t3code/pulls/17817, and Maria explicitly requested this replacement after the archived fork rejected pushes.
Verification
vp run check:changedpassed through Blacksmith: format, lint, both knip passes, GraphQL generation, affected typechecks, and all 12 adjacent tests. The six shell cases include literals/heredocs, long input, stdin, trailing backslash-newline, explicit exit, and syntax error. Two fail against current main before the fix.setup verified.Takeover
Replaces https://git.cafe/pingdotgg/t3code/pulls/17817, with thanks to @sgaabdu4 for the original implementation.
The contributor fork is archived and rejects maintainer pushes. Compared with the original PR's current diff, this retains its production wrapper and all six shell regression cases, replaces the duplicate test harness with main's harness, and preserves main's startup-readiness tests. No behavior was dropped. The commit credits Abid A Gafoor.
Built with GPT-6.1-Sol in the Codex harness on T3 Code.