Skip to content

Commit 53623c7

Browse files
authored
[Fix]: allow agent to configure draft status for opened prs/mrs via git mcp (OpenHands#9117)
1 parent e6036b8 commit 53623c7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

openhands/integrations/gitlab/gitlab_service.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,6 @@ async def create_mr(
470470
target_branch: The name of the branch you want the changes merged into
471471
title: The title of the merge request (optional, defaults to a generic title)
472472
description: The description of the merge request (optional)
473-
draft: Whether to create the MR as a draft (optional, defaults to False)
474473
475474
Returns:
476475
- MR URL when successful

openhands/server/routes/mcp.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ async def create_pr(
8787
target_branch: Annotated[str, Field(description='Target branch on repo')],
8888
title: Annotated[str, Field(description='PR Title')],
8989
body: Annotated[str | None, Field(description='PR body')],
90+
draft: Annotated[bool, Field(description='Whether PR opened is a draft')] = True
9091
) -> str:
9192
"""Open a PR in GitHub"""
9293

@@ -126,6 +127,7 @@ async def create_pr(
126127
target_branch=target_branch,
127128
title=title,
128129
body=body,
130+
draft=draft
129131
)
130132

131133
if conversation_id:
@@ -146,7 +148,7 @@ async def create_mr(
146148
],
147149
source_branch: Annotated[str, Field(description='Source branch on repo')],
148150
target_branch: Annotated[str, Field(description='Target branch on repo')],
149-
title: Annotated[str, Field(description='MR Title')],
151+
title: Annotated[str, Field(description='MR Title. Start title with `DRAFT:` or `WIP:` if applicable.')],
150152
description: Annotated[str | None, Field(description='MR description')],
151153
) -> str:
152154
"""Open a MR in GitLab"""

0 commit comments

Comments
 (0)