Compare commits

...
Author SHA1 Message Date
praisonai-triage-agent[bot]andMervin Praison 4eb020af28 fix: add text=True to subprocess.run for consistent error handling
- Addresses subprocess.run inconsistency found in code review
- First subprocess call now has text=True like the second call
- Ensures e.stderr is always str, not bytes, for better error messages

Co-authored-by: Mervin Praison <[email protected]>
2026-05-04 04:55:03 +00:00
老憨 4b5036a83f fix: move debug log from docstring to actual code in github_create_branch
The logger.debug call for successful branch checkout was accidentally
placed inside the docstring instead of being executable code. This moves
it to after the checkout subprocess call so it actually logs.

Fixes #1350
2026-05-04 12:43:05 +08:00
@@ -7,15 +7,15 @@ logger = logging.getLogger(__name__)
@tool
def github_create_branch(branch_name: str) -> str:
"""Create and checkout a new git branch.
logger.debug(f"Branch '{branch_name}' checked out successfully.")
Args:
branch_name: The name of the branch to create and checkout.
"""
try:
# Check if we are in a git repository
subprocess.run(["git", "rev-parse", "--is-inside-work-tree"], check=True, capture_output=True)
subprocess.run(["git", "rev-parse", "--is-inside-work-tree"], check=True, capture_output=True, text=True)
subprocess.run(["git", "checkout", "-B", branch_name], check=True, capture_output=True, text=True)
logger.debug(f"Branch '{branch_name}' checked out successfully.")
return f"Successfully created and checked out branch '{branch_name}'"
except subprocess.CalledProcessError as e:
logger.error(f"Failed to create branch: {e.stderr}")