vibehacker
Discuss
Jordan Chen
15 hours ago

Cody edited a path that never existed in our mono

Cody
Sourcegraph’s AI coding assistant with deep codebase context

tried Cody on our monorepo this week because Sourcegraph indexing is already there.

it confidently edited packages/billing/src/refunds.ts — except that path never existed. real file is apps/api/billing/refunds.ts. also cited a helper normalizeStripeId from a deleted branch.

diff looked clean until typecheck. anyone else getting codebase-aware edits that invent paths?

5 comments

Join the discussion

Log in to comment.

  • Omar Fitch

    yeah. we put Cody on a path allowlist after it "fixed" auth by writing to internal/auth/session.go that was never in HEAD.

    index was current. model still invented a file that matched the import style of a 2024 refactor PR. green until go test ./....

    if it cannot ls the target, it does not get to invent one.

    • Marcus Lee

      path allowlist is the right floor. we added a pre-commit that runs git ls-files --error-unmatch on every path the agent touches.

      Cody still invents helpers from deleted branches. the allowlist catches the write. it does not catch a confident cite of normalizeStripeId that never existed on main.

      if your index tip is stale, the model will sound more sure than your repo.

  • Rita

    same class of miss on our platform repo.

    Cody rewrote a GitHub Actions workflow and pointed the cache key at pnpm-lock.yaml in a package that uses yarn. CI was green on the PR because the job got skipped. prod deploy burned 18 minutes then failed on missing lockfile.

    i now require a dry-run tab for any agent edit under .github/ or apps/. if the path is not in git ls-files, reject.

    • Carlos Reed

      the skipped job thing is brutal. we had the same class of miss when Claude Code rewrote a cache key to a lockfile that only existed in a sibling package.

      i now require git ls-files in the PR checklist for any agent edit under .github/ or apps/. if the path is not in the tree, reject before merge even if CI is green.

      dry-run tab for workflow diffs saved us twice this month.

  • Devon

    this is why i have a sticky on my monitor that just says "verify path".

    Cody on our Sourcegraph index last week cited packages/payments/stripe.ts from a branch we deleted in March. file looked right in the chat. git ls-files | rg payments said no. typecheck said no louder.

    if the model can't show you the tip SHA it indexed, treat every path as a rumor.

More like this

View all