Repository navigation
Description
Summary
t3 serve --help lists --auto-bootstrap-project-from-cwd with the description "Create a project for the current working directory on startup when missing." t3 serve accepts the flag without an error or warning and creates no project. Disabling auto-bootstrap for t3 serve is intended (it was introduced that way and a unit test covers it); the defect is that serve's own help offers a flag that the command always overrides, so a user who follows the help gets no project and no message.
Steps to reproduce
- Create a Git repository with one commit and
cdinto it. - Run
t3 serve --helpand find the--auto-bootstrap-project-from-cwdentry. - Run
t3 serve --auto-bootstrap-project-from-cwd --base-dir <empty dir> --host 127.0.0.1 --port <free port> --log-level debug . - Read the
publishing welcome eventdebug entry, then stop the server and count the rows inprojection_projectsin<base-dir>/userdata/statev2.sqlite. - Control: repeat step 3 with a fresh
--base-dir, replacingt3 servewitht3 --no-browser, and repeat step 4.
All steps were run on both release builds, except the control in step 5, which was run on the nightly only.
Expected behavior
t3 serve --help is the command's own flag reference, so every flag it lists should either take effect on t3 serve or not be offered there, or the command should reject the flag or warn that it is ignored. Since PR #1871 made t3 serve never bootstrap a project, this flag currently does none of these. The user docs do not mention this flag for t3 serve.
Actual behavior
On both release builds, t3 serve starts normally, prints no warning or error at any log level, and logs (excerpt, environmentId omitted):
startup phase: publishing welcome event
{
cwd: '<repo dir>',
projectName: '<repo name>',
bootstrapProjectId: undefined,
bootstrapThreadId: undefined
}
projection_projects holds 0 rows afterwards. On the nightly, setting T3CODE_AUTO_BOOTSTRAP_PROJECT_FROM_CWD=true instead of passing the flag gives the same result. In the control run, t3 --no-browser --auto-bootstrap-project-from-cwd logs a defined bootstrapProjectId and bootstrapThreadId, and projection_projects holds 1 row.
In source, serveCommand is built from the same sharedServerCommandFlags that define and describe the flag, and it calls the server with startupPresentation: "headless" and forceAutoBootstrapProjectFromCwd: false. resolveServerConfig checks both of those before the flag and the environment variable.
Evidence
- Expected source:
t3 serve --helpoutput on both release builds; the flag and its description at config.ts#L64-L69, included in serve's flag set at config.ts#L241. - Failure source: the local runs under Actual behavior; the precedence at config.ts#L389-L397 and serve's forced options at server.ts#L90-L101.
- Evidence provenance: observed
- Local verification: reproduced
- Reproduction completeness: complete
The test at config.test.ts#L631 asserts that headless startup overrides T3CODE_AUTO_BOOTSTRAP_PROJECT_FROM_CWD=true, so the override itself is intended. The environment variable is not shown in serve's help; this report concerns the advertised flag.
Restoration check
Failing: t3 serve --help lists --auto-bootstrap-project-from-cwd, and t3 serve --auto-bootstrap-project-from-cwd starts with no project and no message. Passing: t3 serve --help no longer offers the flag, or t3 serve tells the user that it ignores the flag, or t3 serve with the flag creates the working-directory project. Control: t3 serve without the flag still creates no project, and t3 --auto-bootstrap-project-from-cwd still creates one.
Version or commit
t3 v0.1.9-nightly.20261111.4501(latest nightly) andt3 v0.1.8(latest stable, installed in isolation from npmt3@0.1.8) were run.- Source read at
main950c34226cc08ca4d9fc0e387b059a30463a1e47; the cited lines are identical at tagsv0.1.8andv0.1.9-nightly.20261111.4501.
Environment
macOS 27.2 (26B123), arm64. Linux and Windows were not tested.
Area
apps/server
Impact
Cosmetic issue
Workaround
Run t3 project add <path> (with the same --base-dir as serve, if serve uses one); in an isolated run on the nightly it exited 0 and added the working-directory project to that base dir's state. t3 --no-browser --auto-bootstrap-project-from-cwd also created the project in the control run, but it logs a pairing URL instead of serve's connection-string block and, according to its source, refuses to start while another server is running for the same base dir.
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
References
- PR Add headless
t3 servepairing output #1871 addedt3 serveand describes forcingnoBrowserand disabling auto-bootstrap for it. - Closed, unmerged PR feat(server): add headless Docker image #4911 proposed letting an explicit flag or environment variable opt
t3 serveinto auto-bootstrap; its closing comment cites the PR's new Docker deployment, not this precedence change.
Triage assessment
- Impact level: P3
- Assessment status: supported
- Impact basis: Serve's help offers a flag that the command always overrides. Server startup, pairing and other behavior are unaffected; a user who follows the help gets no project and no message, and has to add the project another way.
- Workaround status: available
- Workaround basis: Run
t3 project add <path>(with the same--base-diras serve, if serve uses one); in an isolated run on the nightly it exited 0 and added the working-directory project to that base dir's state.t3 --no-browser --auto-bootstrap-project-from-cwdalso created the project in the control run, but it logs a pairing URL instead of serve's connection-string block and, according to its source, refuses to start while another server is running for the same base dir.
Activity