t3code icon indicating copy to clipboard operation
t3code copied to clipboard

~ expansion for project path not working

Open scode opened this issue 8 months ago • 5 comments

At first I thought this was about the codex binary not being found, but turns out it was the project path.

Symptom:

Image

At first I thought I was hitting https://github.com/pingdotgg/t3code/issues/234 but then after codex spotted a bug when I pointed it to that bug, I realized it was I used ~/git/saltybox instead of /Users/scode/git/saltybox for the project path.

Using the full path without a ~ fixes the problem for me.

Image

To be super clear, I am referring to the project path in this dialog when adding a project:

Image

scode avatar Mar 07 '26 04:03 scode

Here's the evidence codex produced, which I have not validated. But to be clear I filed the issue after manually testing and confirming that removing the use of ~ in the project path solved the problem.

The ~ expansion bug has direct log evidence. The strongest points are:

The app records the workspace as the correct absolute path, /Users/scode/git/saltybox, in server-child.log (line 648) and server.log (line 53). Later, in the same log stream, the checkpoint/git path is passed around as the literal string ~/git/saltybox instead of the absolute path. See server-child.log (line 661) and server.log (line 55). The actual filesystem error is also against the literal tilde path, not the expanded home path: PlatformError: NotFound: FileSystem.access (~/git/saltybox) at server-child.log (line 666) and server.log (line 55) Error: ENOENT: no such file or directory, access '~/git/saltybox' at server-child.log (line 671) and server.log (line 55) That combination is the key evidence: T3 knows the repo as /Users/scode/git/saltybox, but a later code path downgrades it to ~/git/saltybox, and Node then tries to fs.access that exact literal string. node:fs does not expand ~, so it fails with ENOENT.

There’s also repetition, which makes this hard to dismiss as one bad event. The same pattern appears multiple times in server-child.log (line 25), server-child.log (line 443), and server-child.log (line 493), all with the same literal ~/git/saltybox failure.

I also verified that /Users/scode/git/saltybox exists on disk locally. So the failure is not “repo missing”; it is specifically “tilde path was never expanded.”

Here are the relevant excerpts inline.

From server-child.log:

[20:08:48.682] INFO (#1812): codex app-server opening thread { threadId: '686216cb-1df4-4eab-8a3a-15e6ff1cbfd5', requestedRuntimeMode: 'full-access', requestedModel: 'gpt-5.4', requestedCwd: '/Users/scode/git/saltybox', resumeThreadId: null } A few seconds later, same log:

[20:09:16.959] WARN (#82): checkpoint reactor failed to process input { source: 'domain', eventType: 'thread.message-sent', cause: 'Error: Git command failed in CheckpointStore.resolveCheckpointCommit: git rev-parse --verify --quiet refs/t3/checkpoints/.../turn/0^{commit} (~/git/saltybox) - NotFound: FileSystem.access (~/git/saltybox) - failed to spawn. ... [cause]: PlatformError: NotFound: FileSystem.access (~/git/saltybox) ... [cause]: Error: ENOENT: no such file or directory, access '~/git/saltybox' }' } And immediately after:

[20:09:16.963] WARN (#82): checkpoint reactor failed to process input { source: 'domain', eventType: 'thread.turn-start-requested', cause: 'Error: Git command failed in CheckpointStore.resolveCheckpointCommit: git rev-parse --verify --quiet refs/t3/checkpoints/.../turn/0^{commit} (~/git/saltybox) - NotFound: FileSystem.access (~/git/saltybox) - failed to spawn. ... [cause]: PlatformError: NotFound: FileSystem.access (~/git/saltybox) ... [cause]: Error: ENOENT: no such file or directory, access '~/git/saltybox' }' } Same pattern also appears in server.log:

timestamp=2026-03-07T04:08:48.682Z level=Info fiber=#1812 message=""codex app-server opening thread"" message="{"threadId":"686216cb-1df4-4eab-8a3a-15e6ff1cbfd5", "requestedRuntimeMode":"full-access", "requestedModel":"gpt-5.4", "requestedCwd":"/Users/scode/git/saltybox", "resumeThreadId":null}" Then later:

timestamp=2026-03-07T04:09:16.959Z level=Warn fiber=#82 message=""checkpoint reactor failed to process input"" message="{"source":"domain","eventType":"thread.message-sent", "cause":"Error: Git command failed ... (~/git/saltybox) - NotFound: FileSystem.access (~/git/saltybox) - failed to spawn. ... [cause]: Error: ENOENT: no such file or directory, access '~/git/saltybox' ..."}" That is the core evidence: T3 logs the cwd as /Users/scode/git/saltybox, but the checkpoint/git path later becomes literal ~/git/saltybox, and Node tries to access that exact string.

scode avatar Mar 07 '26 04:03 scode

FYI, this is codex attempt at fixing it and it "seems to work": https://gist.github.com/scode/3c872a5a1a3257f3c627d0c6d2c5729c

(Note: That is pure AI with zero oversight/human review. Not suggesting that diff be merged. Just a data point for what seems to at least superficially fix it.)

scode avatar Mar 07 '26 04:03 scode

second this. also tried with tilde, wouldn't work

pzauner avatar Mar 07 '26 10:03 pzauner

Probably fixed by https://github.com/pingdotgg/t3code/pull/320

mwolson avatar Mar 07 '26 16:03 mwolson

~I just got the 0.0.4 release which has #320 in it, but the problem remains.~

Correction: With 0.0.4 creating a project with ~ in it works. But an existing project previously created remains broken.

scode avatar Mar 07 '26 17:03 scode