Skip to content

xerj feedback --open-pr commits and pushes into whatever repository it is run from #960

Description

@xerj-org

What happens

xerj feedback --open-pr runs, in the current working directory's git repository:

git checkout -b field-report/<slug>
git add user-feedback/16-agent-field-reports/<file>.md
git commit --only <relpath> -m "docs(field-report): <slug>"
git push -u origin field-report/<slug>
gh pr create --base main --head field-report/<slug> …

engine/crates/xerj-autoindex/src/feedback.rs:435-482. The push is -u origin <branch> and gh pr create carries no --repo. Nothing checks which repository this is; the only precondition is that a .git exists (:426 "(no .git found)").

Why it matters

An agent's working directory is normally the user's own project, not a clone of xerj-org/xerj. Inviting an agent to file a field report (llms.txt, AGENTS.md, and the --help invitation all do) therefore invites it to create a branch in the user's repository, commit a file into a user-feedback/16-agent-field-reports/ path that does not belong there, push it to the user's origin, and open a pull request against the user's main. On a repository the user does not own, the push fails after the branch and commit already exist locally.

Reproduced during the llms.txt study (2026-09-19) in a foreign repository with a stub gh: exit 0, branch created, commit made, pushed to the foreign origin, gh pr create invoked without --repo. Confirmed in the source above.

Suggested fix

Resolve the target explicitly instead of inheriting it: check git remote get-url origin (and gh repo view) resolves to xerj-org/xerj, and if it does not, refuse loudly and print the commands and the fork instructions instead of touching the tree — the same fail-loud shape --open-pr already uses when gh is missing. gh pr create --repo xerj-org/xerj and pushing to the contributor's fork would make the intended path explicit.

Surfaced by the llms.txt agent-documentation study (docs/research/llms-txt-2026-09) while verifying that the documented feedback path works as written.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions