v2.0.2
Co-Authored-By: Vincent Guilloux <vincent.guilloux@mistral.ai> Co-Authored-By: Clément Siriex <clement.sirieix@mistral.ai> Co-Authored-By: Kim-Adeline Miguel <kimadeline.miguel@mistral.ai>
This commit is contained in:
parent
bd3497b1c0
commit
9809cfc831
32 changed files with 622 additions and 305 deletions
|
|
@ -65,7 +65,7 @@ from vibe.acp.utils import (
|
|||
from vibe.core.agent_loop import AgentLoop
|
||||
from vibe.core.agents.models import BuiltinAgentName
|
||||
from vibe.core.autocompletion.path_prompt_adapter import render_path_prompt
|
||||
from vibe.core.config import MissingAPIKeyError, VibeConfig, load_api_keys_from_env
|
||||
from vibe.core.config import MissingAPIKeyError, VibeConfig, load_dotenv_values
|
||||
from vibe.core.tools.base import BaseToolConfig, ToolPermission
|
||||
from vibe.core.types import (
|
||||
ApprovalResponse,
|
||||
|
|
@ -176,7 +176,7 @@ class VibeAcpAgentLoop(AcpAgent):
|
|||
mcp_servers: list[HttpMcpServer | SseMcpServer | McpServerStdio],
|
||||
**kwargs: Any,
|
||||
) -> NewSessionResponse:
|
||||
load_api_keys_from_env()
|
||||
load_dotenv_values()
|
||||
os.chdir(cwd)
|
||||
|
||||
try:
|
||||
|
|
|
|||
|
|
@ -3,10 +3,8 @@ from __future__ import annotations
|
|||
import asyncio
|
||||
from collections.abc import AsyncGenerator
|
||||
from pathlib import Path
|
||||
import shlex
|
||||
|
||||
from acp.schema import (
|
||||
EnvVariable,
|
||||
TerminalToolCallContent,
|
||||
ToolCallProgress,
|
||||
ToolCallStart,
|
||||
|
|
@ -40,14 +38,11 @@ class Bash(CoreBashTool, BaseAcpTool[AcpBashState]):
|
|||
|
||||
timeout = args.timeout or self.config.default_timeout
|
||||
max_bytes = self.config.max_output_bytes
|
||||
env, command, cmd_args = self._parse_command(args.command)
|
||||
|
||||
try:
|
||||
terminal_handle = await client.create_terminal(
|
||||
session_id=session_id,
|
||||
command=command,
|
||||
args=cmd_args,
|
||||
env=env,
|
||||
command=args.command,
|
||||
cwd=str(Path.cwd()),
|
||||
output_byte_limit=max_bytes,
|
||||
)
|
||||
|
|
@ -84,25 +79,6 @@ class Bash(CoreBashTool, BaseAcpTool[AcpBashState]):
|
|||
except Exception as e:
|
||||
logger.error(f"Failed to release terminal: {e!r}")
|
||||
|
||||
def _parse_command(
|
||||
self, command_str: str
|
||||
) -> tuple[list[EnvVariable], str, list[str]]:
|
||||
parts = shlex.split(command_str)
|
||||
env: list[EnvVariable] = []
|
||||
command: str = ""
|
||||
args: list[str] = []
|
||||
|
||||
for part in parts:
|
||||
if "=" in part and not command:
|
||||
key, value = part.split("=", 1)
|
||||
env.append(EnvVariable(name=key, value=value))
|
||||
elif not command:
|
||||
command = part
|
||||
else:
|
||||
args.append(part)
|
||||
|
||||
return env, command, args
|
||||
|
||||
@classmethod
|
||||
def get_summary(cls, args: BashArgs) -> str:
|
||||
summary = f"{args.command}"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue