Skip to content

[bug] A repo's folder cannot be changed — the console shows it as read-only text and the update API has no parameter for it, so a wrong path can only be deleted #410

Description

@serge-ivo

Reported

"I updated it, but it is still using the old one. Why?"

Because nothing you can reach changes a repo's folder. The path is displayed, never edited.

Measured

The console shows it as read-only text. agents/coder/web/src/RepoSettingsModal.tsx:86:

{repo.workdir && <Detail label="Folder" value={repo.workdir} />}

Detail is a display row — it sits between Clone status (:87) and Repo id (:88), both
obviously read-only. The modal's actual inputs are name (:77), dev / staging / prod URLs
(:103-107) and instructions (:57). The Folder line looks like a field and is a label.

The API has no parameter for it either. routes/coding-repos.ts:500:

const body =  as { name?: string; urls?: {}; mergePolicy?: string };

workdir is not in the payload type, not read, not passed to updateRepo. So there is no request
that changes it — the console is not failing to send one, there is nothing to send.

Verified live: Chess coder's repo still reads workdir: ~/dev/pas/platform/apps/chess-academy,
updatedAt: 2026-08-07 23:23:15 — unchanged after the owner edited what they reasonably believed
was the path.

Why this matters more than a missing input

It is the second half of #405. That ticket makes ready a checked claim at ADD time. This one
means a repo that is wrong — or that becomes wrong when a checkout moves, which is the ordinary case
can never be corrected, only deleted and rebuilt.

And deleting is not free. A repo row carries its name, its dev/staging/prod URLs, its merge policy
(#314), its per-repo instructions, its issue-mode configuration, and it is the foreign key for
coding_sessions and the timeline. "Just delete and re-add" asks the owner to throw all of that
away to fix a typo in a path.

The agent, meanwhile, is doing everything right and is stuck: it reports "repo_tree found no files
at ~/dev/pas/platform/apps/chess-academy … check the Coding tab to confirm the runner is pointing at
the right directory"
— advice that cannot be followed, because the Coding tab has no such control.

Do

  • Accept workdir on PUT /:instanceId/coding/repos/:repoId, validated the same way the
    add path validates it after [bug] A local repo is marked "ready" without anyone checking it exists — an empty checkout reports success, and the agent invents the code it cannot see #405 — an edit must not be able to install a path that a create
    would refuse.
  • Make the Folder row an input in RepoSettingsModal, with the validation result shown
    inline: this is exactly the moment to say "that directory is empty" rather than after the
    agent hits it.
  • Re-run the check on save, and clear cloneStatus: needs_attention when the new path is
    good — the status is a claim about the current path, so it must move with it.
  • Consider the same for provider/defaultClient if they are similarly display-only; the audit
    that finds one read-only-field-that-looks-editable should look for its siblings.

Acceptance

  • An owner can correct a wrong folder without deleting the repo, keeping name, URLs, merge
    policy, instructions and session history.
  • A folder that does not exist / is empty / is not a git work tree is refused on EDIT, with the
    same message the add path gives.
  • cloneStatus reflects the new path immediately after a successful edit.

Files: agents/coder/web/src/RepoSettingsModal.tsx:86,
workers/api/src/routes/coding-repos.ts:500-519, workers/api/src/lib/coding-store.ts (updateRepo).
Related: #405 (validation at add time — this is the missing edit half), #325 (the family of
"settings that said saved").

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

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions