Skip to content

Bug Report - Termic fails to read directory content #250

Closed

Description

@adamatan
Image

I'm getting Couldn't read this folder. Retry messages on the "All Files" tab. Clicking on the message or on the round button on the top right does not help. What's a good way to debug this one?

Activity

  1. simion commented on Aug 21, 2026

    @simion
    Owner

    Related: #159

    Will investigate further.
    I'll add the exact error

  2. simion commented on Aug 21, 2026

    @simion
    Owner

    The row was carrying no information: it hard-coded "Couldn't read this folder" and threw the actual rejection away, so a report of it could only ever be a screenshot. Fixed on main in 0cd6aa6, will be in the next release.

    What you will see instead. The row now says what failed, with the raw Rust error underneath and in the tooltip: "Permission denied", "This folder no longer exists", "This folder links outside the task", and so on. An error nobody has mapped shows verbatim rather than being replaced by a generic sentence. task_dir_list also names the path in every error now, so an ENOENT says WHICH path went missing, and a containment rejection says where the symlink pointed. The folder view (a directory link opened in the preview tab) reads the same way.

    The leading suspect for your case. task_dir_list canonicalizes and rejects anything resolving outside the task, so a folder that is a symlink OUT of the worktree lists as a directory but can never be read. Retrying and refreshing cannot fix it, which is exactly what you describe. A linked vendor directory, a shared cache, a pnpm-style link all take that shape. If that is it, the row will say "This folder links outside the task" and the tooltip will name the target.

    The other likely one is a plain permissions failure on the directory, which the new message separates cleanly from the first.

    When you next hit it, paste the row's text plus its tooltip and I will know which one it is. If it turns out to be the symlink case, the follow-up question is whether to allow a link that resolves inside the PROJECT rather than only inside the task worktree, which is a sandbox policy decision rather than a bug.

  3. simion commented on Aug 21, 2026

    @simion
    Owner

    The folder-read diagnostics are live in v0.29.0. Update and open the folder again: the row should now name what failed (permission denied, links outside the task, no longer exists) with the raw error under it. Paste what it says and I can tell you whether it is fixable from here.

  4. adamatan commented on Aug 21, 2026

    @adamatan
    ContributorAuthor
    Image

    It's an interesting case. The .claude directory lives in the repo root, and not copied to worktrees because it's not in git. I do, however, have access to it in the repo root.

    @simion what are your thoughts? Should we stay with this behaviour?

  5. simion commented on Aug 21, 2026

    @simion
    Owner

    hmm, we do link .claude from repo root to worktrees because some these dirs are gitignored.

    Yes, will fix 🤝

  6. simion commented on Aug 21, 2026

    @simion
    Owner

    Confirmed, and it turns out to be self-inflicted — thank you both, the screenshot was exactly what was needed.

    .claude/ is a symlink we create. link_config_dir links .claude/, .gemini/ and .codex/ from the repo root into every new worktree precisely because they are commonly gitignored, so git worktree add leaves them out and an agent spawned there would otherwise lose its project subagents, skills and commands. The containment check then canonicalized that link, saw it landing outside the worktree, and refused to read back through the very link termic had just made. So the folder listed (the parent's read_dir sees a directory entry) and could never be opened — no retry or refresh could help. It hit the editor too, not just the tree: opening .claude/settings.json failed the same way.

    Fixed on main. Reads now allow a symlink at the task root whose target resolves inside the project root. Bounded three ways, each with a test:

    • It is a fallback — everything that resolved before resolves identically, and ../outside / /etc/passwd stay rejected.
    • Only a link at the task root qualifies; one buried in the repo widens nothing.
    • A link that leaves the project is still refused, which is the .claude -> ~/.ssh case the check exists for.

    Read paths only. Rename, delete and every git path keep the strict check, so nothing can mutate the main checkout by writing through a link from a worktree.

    On the question I raised earlier about whether to allow links resolving inside the project rather than only the task: that is the bound now, chosen because a name-based allowance tied to worktree_symlink_paths would break every task linked while an older list was in effect.

    Will be in the next release.

  7. adamatan commented on Aug 22, 2026

    @adamatan
    ContributorAuthor

    Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions