Skip to content

Assistant fails to issue contents.write before git push, reports 403 as unrecoverable #203

Closed

Description

@sentry-junior

Summary

When asked to create a PR in a repo where github.contents.write was required, the assistant attempted git push without first issuing the credential, received a 403, reported the failure as a blocker, and stopped — instead of proactively issuing the credential and retrying.

Observed behavior

  • User asks assistant to open a PR on getsentry/sentry-docs.
  • Assistant clones the repo, writes the branch locally, commits, then runs git push — without issuing github.contents.write first.
  • GitHub returns 403. Assistant reports the 403 as a permissions blocker and tells the user to push manually.
  • A second user asks again in the same thread; the assistant succeeds this time (credential was likely already in session or the correct flow was triggered).

Root cause (hypothesis, high confidence)

The code-change / github skill issued github.pull-requests.write for the PR creation step but did not issue github.contents.write before the git push step. The git push therefore ran without an injected token, producing a 403. Rather than catching the 403, issuing the missing credential, and retrying the push, the assistant surfaced the error as an unrecoverable blocker.

Related: #188 (different symptom — wrong credential type prompted — but same class of credential-sequencing failure).

Expected behavior

Before any git push, the assistant should always issue github.contents.write --target owner/repo. On a 403 from a push, the assistant should issue the credential and retry rather than reporting the failure and stopping.

Potential fixes

  • Add an explicit pre-push step in the code-change and github skill instructions: issue github.contents.write before git push, not only before gh pr create.
  • Add a 403-recovery path: detect push auth failures, issue github.contents.write, and retry once before surfacing the error.

Action taken on behalf of David Cramer.

Activity

  1. added
    bug
    on Apr 16, 2026
  2. added 2 commits that reference this issue on Apr 17, 2026
    5271612
    64e55fb
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

    bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions