Codex GitHub Connector Can't Mark a PR Ready? Switch Routes Safely

Codex GitHub Connector Can't Mark a PR Ready? Switch Routes Safely

Aident AI

A coral ribbon detours through an amber opening around a rejected facet in a cobalt paper plane.

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.fullDatabaseId and undefinedField;

  • 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

undefinedField names Repository.fullDatabaseId; PR remains draft

Connector response-selection bug

Preserve the PR and switch mutation routes

gh pr ready says authentication or repository access failed

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:

gh pr view PR_NUMBER \
  --repo OWNER/REPO \
  --json number,isDraft,baseRefName,headRefOid,url

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 undefinedField classification;

  • 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:

gh auth status --active --hostname github.com
gh pr view PR_NUMBER \
  --repo OWNER/REPO \
  --json number,isDraft,baseRefName,headRefOid,url

If those reads match the intended account, repository, PR, base, and saved head commit, mark that same PR ready:

gh pr ready PR_NUMBER --repo OWNER/REPO

Then read it back:

gh pr view PR_NUMBER \
  --repo OWNER/REPO \
  --json number,isDraft,baseRefName,headRefOid,url

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:

  1. search for the exact canonical GitHub read and ready-for-review Actions;

  2. inspect both schemas and the connected account;

  3. read the intended PR and capture its GraphQL node ID, number, base, head, draft state, and URL;

  4. preflight the exact mutation input;

  5. obtain explicit approval for the GitHub state change;

  6. execute once;

  7. read the same PR again and require isDraft: false with 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:

same repository
+ same PR number and URL
+ same intended base branch
+ same reviewed head commit
+ isDraft = false
= ready for current-head review

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

Home

Home

Home

Integrations

Integrations

Integrations

Vault

Vault

Vault

Audit

Audit

Audit

Arana Grande

Arana Grande

Arana Grande

Free

Free

Free

30-day audit summary

30-day audit summary

30-day audit summary

Daily action-call volume and the latest receipts from the Loadout audit trail.

Daily action-call volume and the latest receipts from the Loadout audit trail.

Daily action-call volume and the latest receipts from the Loadout audit trail.

View Audit

View Audit

View Audit

Loadout usage

Loadout usage

Loadout usage

617 action calls in the last 30 days

617 action calls in the last 30 days

617 action calls in the last 30 days

May 19 - Jun 17

May 19 - Jun 17

May 19 - Jun 17

10 active days

10 active days

10 active days

Less

Less

Less

More

More

More

Recent activity

Recent activity

Recent activity

Latest action-call receipts from connected agents

Latest action-call receipts from connected agents

Latest action-call receipts from connected agents

Apr 23, 09:23 AM

Apr 23, 09:23 AM

Apr 23, 09:23 AM

Shopify

Shopify

Shopify

Creates Or Updates An Asset For A Theme

Creates Or Updates An Asset For A Theme

Creates Or Updates An Asset For A Theme

Success

Success

Success

Apr 23, 09:21 AM

Apr 23, 09:21 AM

Apr 23, 09:21 AM

Shopify

Shopify

Shopify

Update Products Param Product Id

Update Products Param Product Id

Update Products Param Product Id

Success

Success

Success

Apr 23, 08:53 AM

Apr 23, 08:53 AM

Apr 23, 08:53 AM

Shopify

Shopify

Shopify

Update Products Param Product Id

Update Products Param Product Id

Update Products Param Product Id

Failed

Failed

Failed

Apr 22, 22:13 PM

Apr 22, 22:13 PM

Apr 22, 22:13 PM

Shopify

Shopify

Shopify

Create Product Image

Create Product Image

Create Product Image

Success

Success

Success

Apr 22, 22:12 PM

Apr 22, 22:12 PM

Apr 22, 22:12 PM

Shopify

Shopify

Shopify

Create Product Image

Create Product Image

Create Product Image

Success

Success

Success

Connected integration coverage

Connected integration coverage

Connected integration coverage

162

162

162

of 753 accessible connected

of 753 accessible connected

of 753 accessible connected

Callable actions

Callable actions

Callable actions

1,126

1,126

1,126

Vault credentials

Vault credentials

Vault credentials

8

8

8

Explore what's possible

Explore what's possible

Explore what's possible

See all Integrations

See all Integrations

See all Integrations

Google Ads

Google Ads

Google Ads

All available Goolge Ads tools via...

All available Goolge Ads tools via...

All available Goolge Ads tools via...

X (twitter)

X (twitter)

X (twitter)

All available X tools via...

All available X tools via...

All available X tools via...

Github

Github

Github

All available Github tools via...

All available Github tools via...

All available Github tools via...

Notion

Notion

Notion

All available Notion tools via...

All available Notion tools via...

All available Notion tools via...

Slack

Slack

Slack

All available Slack tools via...

All available Slack tools via...

All available Slack tools via...

Firecrawl

Firecrawl

Firecrawl

All available Firecrawl tools via...

All available Firecrawl tools via...

All available Firecrawl tools via...

753 integrations are available for loadouts.

753 integrations are available for loadouts.

753 integrations are available for loadouts.

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.

Try Aident Loadout

Empower your Codex or OpenClaws to get real jobs done. Connect 27,000+ tools in one prompt, and let your agents deliver real results.

Try Aident Loadout

Empower your Codex or OpenClaws to get real jobs done. Connect 27,000+ tools in one prompt, and let your agents deliver real results.

Try Aident Loadout

Empower your Codex or OpenClaws to get real jobs done. Connect 27,000+ tools in one prompt, and let your agents deliver real results.