Aident AI

Codex GitHub Connector Can't Mark a PR Ready? Switch Routes Safely
If the Codex GitHub connector fails while marking a pull request ready with Repository.fullDatabaseId doesn't exist, stop retrying that connector call. The error comes from an invalid field in the GraphQL response selection, not from evidence that your pull request is corrupt. Read the existing PR, preserve its number and head commit, switch to a reviewed route such as GitHub CLI or the GitHub UI, and verify that the same PR is now non-draft.
OpenAI issue 41433 documents this exact failure in Codex Desktop. Reports through September 2026 show the connector returning an undefinedField error for markPullRequestReadyForReview.pullRequest.headRepository.fullDatabaseId. Users then read the PR back and find that it is still a draft. The important recovery rule is simple: do not create a replacement PR and do not assume the failed mutation changed state.
Confirm that this is the same failure
This guide fits when all of these are true:
an existing GitHub pull request is still marked as a draft;
Codex tried to mark that PR ready through its GitHub connector;
the response names
headRepository.fullDatabaseIdandundefinedField;reading the PR again shows
isDraft: true;the intended head commit and base branch still identify the same review unit.
Do not collapse every ready-for-review failure into this bug. Use the error and a readback to classify it:
Evidence | Failure class | Safe next move |
|---|---|---|
| Connector response-selection bug | Preserve the PR and switch mutation routes |
| Credential or permission boundary | Repair or select the intended GitHub account before retrying |
PR is non-draft but checks or reviews are pending | Merge-readiness policy | Leave the PR open and wait for the required gates |
Readback shows a different head commit | Stale verification | Re-review and validate the new head before any state change |
The undefinedField response is useful evidence. GraphQL validates a document before executing it. If the connector asks for a field that the server schema does not define, do not treat the requested mutation as successfully applied. The readback is still the durable proof.
1. Capture the existing PR identity without writing
Record the repository, PR number, base branch, head commit, draft state, and URL. With GitHub CLI:
Replace PR_NUMBER and OWNER/REPO with the intended values. Keep the returned headRefOid for the final comparison. If the command selects a different repository, PR, base, or head than expected, stop. A route switch is not permission to act on an ambiguous target.
This read is also your protection against a common but expensive detour. Creating a replacement PR changes its number and can strand comments, approvals, check history, links, and automation attached to the original review unit.
2. Stop repeating the broken connector request
Retrying the same connector payload cannot repair an invalid response field. Preserve one redacted failure record containing:
the connector operation name;
the
undefinedFieldclassification;the rejected field path;
the PR number and expected head commit;
the readback showing that the PR remains a draft.
Do not paste tokens, installation IDs, or credential material into the record. Do not change branch content merely to retrigger the connector. A new commit changes the head identity and invalidates any review tied to the previous commit.
3. Use GitHub CLI when its identity check passes
GitHub CLI provides a supported command for changing a draft pull request to ready for review. First verify the authenticated account and exact PR again:
If those reads match the intended account, repository, PR, base, and saved head commit, mark that same PR ready:
Then read it back:
Success means isDraft is false, while number, baseRefName, headRefOid, and url still match the review unit you captured. If the head changed between the two reads, stop and review the new commit. Do not report the PR as validated against an old head.
Marking a PR ready does not approve or merge it. It only opens the existing change for review. Required checks, current-head approval, branch protection, and repository-specific merge policy still apply.
4. Use the GitHub UI as a deliberate fallback
If local GitHub CLI authentication is unavailable but you can verify the exact PR in GitHub, open the existing pull request and choose Ready for review. Confirm the repository name, PR number, branch names, and latest commit before clicking.
After the transition, refresh the page and verify that:
the Draft badge is gone;
the PR number and URL did not change;
the latest commit is still the expected head;
checks and review requirements are visible for that head.
Do not use the UI to bypass a credential or repository-ownership ambiguity. It is another mutation route, not an exception to target verification.
5. Use a connected GitHub Action with a fail-closed readback
For repeatable agent workflows, a connected GitHub Action can separate the operation from a caller-local CLI credential. The Aident catalog currently exposes read and mark_pull_request_ready_for_review GitHub Actions. That makes a reviewed route possible, but schema discovery alone does not prove that a particular provider path is unaffected by the connector bug.
Follow Aident setup, connect GitHub, and require the agent to:
search for the exact canonical GitHub read and ready-for-review Actions;
inspect both schemas and the connected account;
read the intended PR and capture its GraphQL node ID, number, base, head, draft state, and URL;
preflight the exact mutation input;
obtain explicit approval for the GitHub state change;
execute once;
read the same PR again and require
isDraft: falsewith the same number, base, head, and URL.
If the Action errors, returns an ambiguous result, or the head changes, fail closed. Do not bypass the integration layer, create a replacement PR, or infer success from the request being accepted. Switch to another reviewed route and retain the readback evidence.
For the broader route tradeoffs, see GitHub MCP Server vs Aident Loadout. If GitHub CLI works outside Codex but not inside its sandbox, use the Codex GitHub CLI authentication classifier. For threat-modeling agent access to repository content, continue to Secure GitHub Agentic Workflows Against Prompt Injection.
6. Verify the current head before automation continues
The safe end state is more specific than "the PR is ready." Capture a final read that proves:
Then let the repository's normal checks and reviewers act on that exact head. If any automation approval names an older commit, request or wait for a current-head review. If the branch is behind its base, update it through the repository's normal branch workflow, then expect prior commit-specific approval to become stale.
Do not merge merely because the draft flag changed. Draft state, approval state, mergeability, and queued auto-merge are separate GitHub states.
Questions people ask about this error
Why does Codex say Repository.fullDatabaseId does not exist?
The affected connector includes fullDatabaseId in a nested GitHub Repository response selection even though the current GraphQL schema does not define that field there. GitHub rejects the document with undefinedField. This is a connector query-shape problem, not evidence that the repository lacks a database identity.
Did the ready-for-review mutation run after that error?
Do not assume it did. The undefined-field failure occurs during GraphQL document validation, and affected users read the PR back as still draft. Treat a fresh read of isDraft as the source of truth.
How do I mark the Codex-created PR ready without losing approvals?
Operate on the existing PR number. Use gh pr ready, the GitHub UI, or a reviewed connected Action, then verify the same URL and head commit. Do not create a replacement PR unless you intentionally accept losing the existing review context.
How do I verify the exact head after switching routes?
Compare headRefOid before and after the mutation. The PR is ready for the reviewed change only when the number, base, head, and URL match and isDraft changed from true to false.
Conclusion
The fullDatabaseId error is a broken connector response selection, not a reason to discard the pull request. Preserve the existing PR, capture its exact head, stop repeating the invalid request, and switch to GitHub CLI, the GitHub UI, or a schema-inspected connected Action. Finish with a current-head readback. Only then can normal review and merge policy continue safely.
Sources
About the author
Aident AI
Related posts



The one tool
for every tool
your agent needs.
Give any AI agent real capabilities in seconds. Connect 27,000+ tools once, skip the setup headache, and let your agents execute.
