[Bug]: Moving a project folder reports a Codex spawn failure instead of the missing folder, and the project cannot be re-linked
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 23k
- Forks
- 5.9k
- Avg merge
- 11h 14m
- Merged PRs (30d)
- 357
Description
Before submitting
- I searched existing issues and did not find a duplicate.
- I included enough detail to reproduce or investigate the problem.
Area
apps/server
Steps to reproduce
- Add any project, like
D:\t3code-repro\workspace\t3codeand start a session in it and send any message. - Quit T3 Code. Move the folder to anywhere like
D:\t3code-repro\workspace\tools\t3code. - Reopen T3 Code. The project is still listed and still shows its threads. The server logs no warning about the missing root at startup.
- Open the thread and send another message.
- Look for any way to point the project at its new location.
- Add the folder from its new location instead.
Expected behavior
Step 4 should report that the workspace folder is missing, and name it. For example:
This project's folder no longer exists:
D:\t3code-repro\workspace\t3code
Step 5 should offer some way to re-link the project to its new path, keeping its threads.
Actual behavior
Step 4 shows a toast blaming the Codex binary and quoting a .ts source location, never mentioning the folder:
ProviderAdapterProcessError: Provider adapter process error (codex) for thread 830169cc-...:
Failed to spawn Codex App Server process for command: codex app-server
at file:///.../apps/server/src/provider/Layers/CodexAdapter.ts:1441:15
The real reason is present in the error object, but only three [cause] levels down (full chain under Logs): NotFound: FileSystem.access (D:\t3code-repro\workspace\t3code). So the missing folder is detected and then discarded before it reaches the user.
Step 5 has no affordance at all: nothing in the project context menu, project settings, or command palette points a project at a new path.
Step 6 silently creates a second project with the same name, leaving the original threads in the first project, whose folder no longer exists. There is no way to move them across.
I dug into why the path is lost and why re-linking is impossible; posting that as a follow-up comment to keep this field readable.
Impact
Major degradation or frequent failure
Version or commit
6efcf3e10 (v0.0.32-nightly.20260730.954); also present in v0.0.31 stable
Environment
Windows 11, T3 Code dev build via pnpm dev, codex provider, Node 25.4.0
Logs or stack traces
ProviderAdapterProcessError: Provider adapter process error (codex) for thread 830169cc-6827-4bdb-ab7f-a8c351fbc60e: Failed to spawn Codex App Server process for command: codex app-server
at file:///D:/t3code-repro/src/apps/server/src/provider/Layers/CodexAdapter.ts:1441:15
at startSession (file:///D:/t3code-repro/src/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts:503:23)
at startSession (definition) (file:///D:/t3code-repro/src/apps/server/src/provider/Layers/ProviderService.ts:522:70)
at ensureSessionForThread (file:///D:/t3code-repro/src/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts:628:12)
at ensureSessionForThread (definition) (file:///D:/t3code-repro/src/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts:360:41)
at processTurnStartRequested (file:///D:/t3code-repro/src/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts:1064:16)
at processTurnStartRequested (definition) (file:///D:/t3code-repro/src/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts:780:44)
at processDomainEvent (file:///D:/t3code-repro/src/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts:1082:5)
at processDomainEvent (definition) (file:///D:/t3code-repro/src/apps/server/src/orchestration/Layers/ProviderCommandReactor.ts:1038:37) {
[cause]: CodexAppServerSpawnError: Failed to spawn Codex App Server process for command: codex app-server
at file:///D:/t3code-repro/src/apps/server/src/provider/Layers/CodexSessionRuntime.ts:756:13 {
[cause]: PlatformError: NotFound: FileSystem.access (D:\t3code-repro\workspace\t3code)
at Module.systemError (.../effect/dist/PlatformError.js:144:39) {
[cause]: Error: ENOENT: no such file or directory, access 'D:\t3code-repro\workspace\t3code'
}
}
}
Screenshots, recordings, or supporting files
Workaround
None in-app. I recovered by editing ~/.t3/userdata/state.sqlite with the app closed, after backing it up with sqlite3 .backup:
BEGIN IMMEDIATE;
-- 1. Reparent the stranded thread into the project with the correct root.
-- Raw projection edit, because no event can move a thread between projects.
UPDATE projection_threads
SET project_id = '<new-project-id>'
WHERE thread_id = '<stranded-thread-id>';
-- 2. Patch the historical thread.created payload so a projection replay reproduces the same state.
UPDATE orchestration_events
SET payload_json = replace(payload_json, '<old-project-id>', '<new-project-id>')
WHERE sequence = <sequence of that thread.created>;
-- 3. Append a real project.deleted event for the now-empty duplicate. Since
-- projection_state.last_applied_sequence sits below this row, the app applies it itself on the
-- next start, so no projection row needs hand-editing for this part.
INSERT INTO orchestration_events
(event_id, aggregate_kind, stream_id, stream_version, event_type, occurred_at,
command_id, causation_event_id, correlation_id, actor_kind, payload_json, metadata_json)
VALUES
('<uuid>', 'project', '<old-project-id>', 1, 'project.deleted', '<iso-ts>',
NULL, NULL, NULL, 'client',
'{"projectId":"<old-project-id>","deletedAt":"<iso-ts>"}', '{}');
COMMIT;
Related: #975, #1726, #1932 (misleading error, closed without the exact text now provided above), #2357 (relocate, closed not_planned), #2467 and #1614 (closed unmerged), #3829 (merged).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the error through apps/server/src/provider/Layers/CodexAdapter.ts:1441 and CodexSessionRuntime.ts:756, then follow project and thread handling in ProviderCommandReactor.ts. Reproduce the missing-folder case and inspect state.sqlite persistence. Done means the user sees the missing path and can relink the existing project without losing its threads.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- sqlite, typescript
- Domain
- backend, database, frontend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100