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
[Bug]: Missing optional t3.json logs WorkspaceFileSystem error on every read #16318
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
Open a workspace whose root has no t3.json.
Open a UI surface that checks for project scripts (for example, the project actions/settings or thread details scripts menu).
Observe the server log when T3 Code requests t3.json through projects.readFile.
Expected behavior
A missing optional t3.json is treated as “not present” without logging a filesystem error stack. Other failures (such as permission errors) should still be reported.
Actual behavior
The request fails during realpath-target with ENOENT and emits a WorkspaceFileSystemOperationError stack. Repeated checks make the logs noisy even though this file is optional.
Impact
Minor bug or occasional failure
Version or commit
Linux AppImage nightly 0.0.46-nightly.20261005.2689
Environment
Linux desktop, T3 Code AppImage nightly.
Logs or stack traces
WorkspaceFileSystemOperationError: Workspace file operation 'realpath-target' failed at '<workspace>/t3.json' for resolved path '<workspace>/t3.json' (requested as 't3.json' in '<workspace>')
[cause]: Error: ENOENT: no such file or directory, realpath '<workspace>/t3.json'
...
WorkspaceFileSystem.readFile
ws.rpc.projects.readFile
Screenshots, recordings, or supporting files
Not applicable.
Workaround
No project workaround identified. Adding an empty t3.json would mask the missing-file error but is not appropriate when the repository has no T3 project configuration.
Thanks for the clear report, @dataforxyz! This lines up with what we see on current main.
What I found
t3.json is optional, and T3ProjectFileLoader already returns "none" on NotFound, only warning when the file exists but can't be read or decoded.
The client doesn't go through that loader. It calls projects.readFile for t3.json from the thread details panel (whenever a project is open), project settings (importable scripts and the settings inheritance chain), and new-thread defaults when no higher-priority env mode is set.
WorkspaceFileSystem.readFile resolves the path with realpath, so a missing file becomes WorkspaceFileSystemOperationError (realpath-target, ENOENT). That's mapped to ProjectReadFileError with failure: "operation_failed", and observeRpcEffect records the ws.rpc.projects.readFile span as failed in server.trace.ndjson. Those spans then show up in Settings → Diagnostics as latest and common failures, which matches the message you quoted.
It isn't a crash or an unbounded loop. The projects.readFile query is cached for 30 seconds, so each surface produces about one failure per project per stale window. Repos without a t3.json are the common case, though, so the noise adds up.
Likely fix area
A few options:
Treat absence as a successful "not present" result specifically on the optional t3.json read, while a file that exists but can't be read or decoded stays an error.
Route the client's t3.json reads through the same not-found handling T3ProjectFileLoader already uses.
Swallowing ENOENT inside the generic readFile looks less attractive, since explicitly opening a missing file should still fail (WorkspaceFileSystem.test.ts covers that for missing.txt). A server-side negative cache alone wouldn't help either, because the failure span is written on the first request.
I traced the current path: the scripts UI calls useProjectFileQuery() for t3.json. For an absent file, WorkspaceFileSystem.resolveReadTarget() wraps realpath's ENOENT as WorkspaceFileSystemOperationError; the projects.readFile RPC then maps that to ProjectReadFileError with failure: "operation_failed" and the original cause. The UI already treats a settled read with no contents as missing.
That makes the missing optional file look like an I/O failure at the RPC boundary even though the UI expects it. A narrow fix would give ENOENT its own missing-file result or failure there, while preserving operation_failed for permission and other real I/O errors. I haven't changed the shared read API because other file reads rely on its current error behavior.
closing as addressed by #19949, merged into main: optional t3.json reads return a successful absent result rather than failed filesystem/RPC spans. Genuine read errors and workspace containment checks remain intact.
thanks for reporting this. if you still face it on a build containing this fix, please ask us to reopen this issue or open a new issue linking back here, with your version, os and reproduction steps.
Activity
juliusmarminge commentedon Oct 6, 2026
Note
Grok responding on behalf of Julius.
Triage
Thanks for the clear report, @dataforxyz! This lines up with what we see on current
main.What I found
t3.jsonis optional, andT3ProjectFileLoaderalready returns "none" onNotFound, only warning when the file exists but can't be read or decoded.projects.readFilefort3.jsonfrom the thread details panel (whenever a project is open), project settings (importable scripts and the settings inheritance chain), and new-thread defaults when no higher-priority env mode is set.WorkspaceFileSystem.readFileresolves the path withrealpath, so a missing file becomesWorkspaceFileSystemOperationError(realpath-target,ENOENT). That's mapped toProjectReadFileErrorwithfailure: "operation_failed", andobserveRpcEffectrecords thews.rpc.projects.readFilespan as failed inserver.trace.ndjson. Those spans then show up in Settings → Diagnostics as latest and common failures, which matches the message you quoted.projects.readFilequery is cached for 30 seconds, so each surface produces about one failure per project per stale window. Repos without at3.jsonare the common case, though, so the noise adds up.Likely fix area
A few options:
t3.jsonread, while a file that exists but can't be read or decoded stays an error.t3.jsonreads through the same not-found handlingT3ProjectFileLoaderalready uses.Swallowing
ENOENTinside the genericreadFilelooks less attractive, since explicitly opening a missing file should still fail (WorkspaceFileSystem.test.tscovers that formissing.txt). A server-side negative cache alone wouldn't help either, because the failure span is written on the first request.A maintainer will decide on the fix direction.
rahul05ranjan commentedon Oct 6, 2026
I traced the current path: the scripts UI calls
useProjectFileQuery()fort3.json. For an absent file,WorkspaceFileSystem.resolveReadTarget()wrapsrealpath'sENOENTasWorkspaceFileSystemOperationError; theprojects.readFileRPC then maps that toProjectReadFileErrorwithfailure: "operation_failed"and the original cause. The UI already treats a settled read with no contents asmissing.That makes the missing optional file look like an I/O failure at the RPC boundary even though the UI expects it. A narrow fix would give
ENOENTits own missing-file result or failure there, while preservingoperation_failedfor permission and other real I/O errors. I haven't changed the shared read API because other file reads rely on its current error behavior.t3-code-bot commentedon Oct 21, 2026
closing as addressed by #19949, merged into main: optional t3.json reads return a successful absent result rather than failed filesystem/RPC spans. Genuine read errors and workspace containment checks remain intact.
thanks for reporting this. if you still face it on a build containing this fix, please ask us to reopen this issue or open a new issue linking back here, with your version, os and reproduction steps.
closed at the request of @UtkarshUsername.