From f475c07ba06b3ae900808e03ce0a35267b5beec7 Mon Sep 17 00:00:00 2001 From: Hongyu Shi Date: Wed, 27 Aug 2025 17:26:16 +0800 Subject: [PATCH 1/3] =?UTF-8?q?fix(deploy):=20=E4=BC=98=E5=8C=96=E8=BF=9B?= =?UTF-8?q?=E7=A8=8B=E8=BE=93=E5=87=BA=E8=AF=BB=E5=8F=96=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E5=9B=BA=E5=AE=9A=E8=B6=85=E6=97=B6?= =?UTF-8?q?=E9=98=BB=E5=A1=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hongyu Shi --- src/app/deployment/service.py | 51 ++++++++--------------------------- 1 file changed, 11 insertions(+), 40 deletions(-) diff --git a/src/app/deployment/service.py b/src/app/deployment/service.py index 3c4b3f7..7a6bf59 100644 --- a/src/app/deployment/service.py +++ b/src/app/deployment/service.py @@ -420,30 +420,11 @@ class DeploymentService: # 读取安装输出 output_lines = [] if process.stdout: - while True: - try: - # 使用超时读取,避免长时间阻塞 - line = await asyncio.wait_for( - process.stdout.readline(), - timeout=0.1, # 100ms 超时 - ) - except TimeoutError: - # 超时时让出控制权给 UI 事件循环 - await asyncio.sleep(0) - continue - - if not line: - break - - decoded_line = line.decode("utf-8", errors="ignore").strip() - if decoded_line: - output_lines.append(decoded_line) - if progress_callback: - temp_state.add_log(f"安装: {decoded_line}") - progress_callback(temp_state) - - # 每次读取后让出控制权 - await asyncio.sleep(0) + async for line in self._read_process_output_lines(process): + output_lines.append(line) + if progress_callback: + temp_state.add_log(f"安装: {line}") + progress_callback(temp_state) # 等待进程结束 return_code = await process.wait() @@ -578,7 +559,7 @@ class DeploymentService: try: # 读取输出 - async for line in self._read_process_output(): + async for line in self._read_process_output_lines(self._process): self.state.add_log(line) if progress_callback: progress_callback(self.state) @@ -787,24 +768,14 @@ class DeploymentService: msg = f"写入 config.toml 文件失败: {error_msg}" raise RuntimeError(msg) - async def _read_process_output(self) -> AsyncGenerator[str, None]: - """读取进程输出""" - if not self._process or not self._process.stdout: + async def _read_process_output_lines(self, process: asyncio.subprocess.Process) -> AsyncGenerator[str, None]: + """读取进程输出行""" + if not process.stdout: return - while True: + while not process.stdout.at_eof(): try: - # 使用超时读取,避免长时间阻塞 - try: - line = await asyncio.wait_for( - self._process.stdout.readline(), - timeout=0.1, # 100ms 超时 - ) - except TimeoutError: - # 超时时让出控制权给 UI 事件循环 - await asyncio.sleep(0) - continue - + line = await process.stdout.readline() if not line: break -- Gitee From c95afba54f7063d1617b40c13f228d4020fb1109 Mon Sep 17 00:00:00 2001 From: Hongyu Shi Date: Thu, 28 Aug 2025 11:21:38 +0800 Subject: [PATCH 2/3] =?UTF-8?q?chore(log):=20=E9=81=B5=E4=BB=8E=E7=BB=9F?= =?UTF-8?q?=E4=B8=80=E7=9A=84=E6=97=A5=E5=BF=97=E7=BA=A7=E5=88=AB=EF=BC=8C?= =?UTF-8?q?=E5=AE=8C=E6=95=B4=E8=AE=B0=E5=BD=95=E6=89=80=E6=9C=89=E6=97=A5?= =?UTF-8?q?=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hongyu Shi --- src/log/manager.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/log/manager.py b/src/log/manager.py index 6831494..f0fa867 100644 --- a/src/log/manager.py +++ b/src/log/manager.py @@ -133,10 +133,6 @@ class LogManager: handlers=handlers, ) - # 为 httpx 设置更高的日志级别以减少噪音 - logging.getLogger("httpx").setLevel(logging.WARNING) - logging.getLogger("openai").setLevel(logging.WARNING) - def _parse_log_file_date(self, log_file: Path) -> datetime | None: """解析日志文件名中的日期""" try: -- Gitee From 06af9f727c8e2c76e4b240eb7cace4de5237f0b7 Mon Sep 17 00:00:00 2001 From: Hongyu Shi Date: Thu, 28 Aug 2025 16:41:55 +0800 Subject: [PATCH 3/3] =?UTF-8?q?chore:=20=E5=8D=87=E7=BA=A7=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E8=87=B3=201.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Hongyu Shi --- distribution/linux/euler-copilot-shell.spec | 7 ++++++- setup.py | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/distribution/linux/euler-copilot-shell.spec b/distribution/linux/euler-copilot-shell.spec index 83bab27..c1f8d01 100644 --- a/distribution/linux/euler-copilot-shell.spec +++ b/distribution/linux/euler-copilot-shell.spec @@ -3,7 +3,7 @@ %global debug_package %{nil} Name: euler-copilot-shell -Version: 0.10.0 +Version: 1.0.0 Release: 1%{?dist} Summary: openEuler Intelligence 智能命令行工具集 License: MulanPSL-2.0 @@ -99,6 +99,11 @@ ln -sf /usr/lib/openeuler-intelligence/scripts/deploy %{buildroot}%{_bindir}/ope %{_bindir}/openeuler-intelligence-installer %changelog +* Thu Aug 28 2025 openEuler - 1.0.0-1 +- 新增 openEuler Intelligence 部署功能 TUI +- 新增选择默认 Agent 功能 +- 版本号升级至 1.0.0 + * Wed Aug 13 2025 openEuler - 0.10.0-1 - 重构为子包形式:openeuler-intelligence-cli 和 openeuler-intelligence-installer - openeuler-intelligence-cli 替换原 euler-copilot-shell 包 diff --git a/setup.py b/setup.py index 0fd4721..5fec4d7 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ from setuptools import find_packages, setup setup( name="oi-cli", - version="0.10.0", + version="1.0.0", description="智能 Shell 命令行工具", author="openEuler", author_email="contact@openeuler.org", -- Gitee