createPullRequest
Create a pull request after generating code changes.
Method signature
Description
The createPullRequest
method allows you to create a GitHub pull request after code changes have been generated using the Codex agent. This method streamlines the process of submitting code changes for review by automatically creating a pull request with the generated modifications.
Parameters
This method takes no parameters.
Return type
Type | Description |
---|---|
Promise<PullRequestResponse> | Promise that resolves to a pull request response object |
PullRequestResponse Interface
Property | Type | Required | Description |
---|---|---|---|
html_url | string | Yes | The URL to view the pull request on GitHub |
number | number | Yes | The pull request number |
branchName | string | Yes | The name of the branch created for the PR |
commitSha | string | No | The SHA of the commit |
Requirements
- Agent Type: This method is only available when using the Codex agent
- Initialization: The VibeKit instance must be properly initialized with Codex configuration
- Code Generation: Code changes should be generated before creating a pull request
Error handling
The method throws errors in the following scenarios:
Agent Type Error
- When: Called with an agent type other than “codex”
- Resolution: Ensure your VibeKit instance is configured with
agent.type: "codex"
Initialization Error
- When: The CodexAgent is not properly initialized
- Resolution: Verify your VibeKit configuration includes valid Codex settings
Usage examples
Basic Usage
Notes
- The pull request is automatically labeled with ‘codex’ or ‘claude’ to indicate it was created by the Codex or Claude agent
- Ensure your GitHub token has the necessary permissions to create pull requests in the target repository
- The method creates a new branch for the pull request automatically
- Code changes must be generated before calling this method