|
22 | 22 | from base_agent import BaseAgent, TInputSchema, TOutputSchema |
23 | 23 | from constants import COMMIT_PREFIX, BRANCH_PREFIX |
24 | 24 | from observability import setup_observability |
25 | | -from tools.shell_command import ShellCommandTool |
| 25 | +from tools.commands import RunShellCommandTool |
26 | 26 | from triage_agent import RebaseData, ErrorData |
27 | 27 | from utils import mcp_tools, redis_client, get_git_finalization_steps |
28 | 28 |
|
@@ -62,7 +62,7 @@ class RebaseAgent(BaseAgent): |
62 | 62 | def __init__(self) -> None: |
63 | 63 | super().__init__( |
64 | 64 | llm=ChatModel.from_name(os.getenv("CHAT_MODEL")), |
65 | | - tools=[ThinkTool(), ShellCommandTool(), DuckDuckGoSearchTool()], |
| 65 | + tools=[ThinkTool(), RunShellCommandTool(), DuckDuckGoSearchTool()], |
66 | 66 | memory=UnconstrainedMemory(), |
67 | 67 | requirements=[ |
68 | 68 | ConditionalRequirement(ThinkTool, force_after=Tool, consecutive_allowed=False), |
@@ -122,9 +122,9 @@ def prompt(self) -> str: |
122 | 122 | * Do not run the `centpkg new-sources` command for now (testing purposes), just write down the commands you would run. |
123 | 123 |
|
124 | 124 | IMPORTANT GUIDELINES: |
125 | | - - **Tool Usage**: You have ShellCommand tool available - use it directly! |
| 125 | + - **Tool Usage**: You have run_shell_command tool available - use it directly! |
126 | 126 | - **Command Execution Rules**: |
127 | | - - Use ShellCommand tool for ALL command execution |
| 127 | + - Use run_shell_command tool for ALL command execution |
128 | 128 | - If a command shows "no output" or empty STDOUT, that is a VALID result - do not retry |
129 | 129 | - Commands that succeed with no output are normal - report success |
130 | 130 | - **Git Configuration**: Always configure git user name and email before any git operations |
@@ -174,16 +174,20 @@ def prompt(self) -> str: |
174 | 174 | """ |
175 | 175 |
|
176 | 176 | async def run_with_schema(self, input: TInputSchema) -> TOutputSchema: |
177 | | - async with mcp_tools(os.getenv("MCP_GITLAB_URL")) as gitlab_tools: |
| 177 | + async with mcp_tools( |
| 178 | + os.getenv("MCP_GATEWAY_URL"), |
| 179 | + filter=lambda t: t |
| 180 | + in ("fork_repository", "open_merge_request", "push_to_remote_repository"), |
| 181 | + ) as gateway_tools: |
178 | 182 | tools = self._tools.copy() |
179 | 183 | try: |
180 | | - self._tools.extend(gitlab_tools) |
| 184 | + self._tools.extend(gateway_tools) |
181 | 185 | return await self._run_with_schema(input) |
182 | 186 | finally: |
183 | 187 | self._tools = tools |
184 | 188 | # disassociate removed tools from requirements |
185 | 189 | for requirement in self._requirements: |
186 | | - if requirement._source_tool in gitlab_tools: |
| 190 | + if requirement._source_tool in gateway_tools: |
187 | 191 | requirement._source_tool = None |
188 | 192 |
|
189 | 193 |
|
|
0 commit comments