Skip to content

agent-data: a branch name with a slash breaks the detached write before git runs #1762

Description

@suleimansh

@gemstack/agent-data says every function takes the branch as an argument and hardcodes none. The detached one-shot write does not hold up its end: it builds its temporary worktree path from the branch name, mkdtemp(join(tmpdir(), ${branch}-write-)), so a name with a slash, feature/x say, fails with ENOENT on the missing /tmp/feature/ before any git command runs. The funneled write takes the same name without complaint, since .branches/<branch> simply nests.

Nothing breaks today: the only branch in use is agent-data. Found by a cold read of the package on 2026-09-08. Fix: derive the temp dir prefix from a slash-free form of the name.

packages/agent-data/src/file-branch.ts, the mkdtemp in the detached write.

🤖 curated · Fable 5.1, effort high

Activity

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