129 lines
3.7 KiB
Markdown
Executable File
129 lines
3.7 KiB
Markdown
Executable File
# 2026-04-04 项目记录 - bbav20311
|
|
|
|
## 项目信息
|
|
- **项目**: bbav20311 (BotanicalBaseAgent)
|
|
- **路径**: `/home/xia-lab/wutx/00test/bbav20311`
|
|
- **记录时间**: 2026-04-04
|
|
|
|
---
|
|
|
|
## 今日修订内容
|
|
|
|
### 1. 前端停止执行按钮 ✅
|
|
|
|
**需求**: 添加停止执行按钮,用户可随时取消正在运行的分析
|
|
|
|
**修改文件**: `/home/xia-lab/wutx/00test/bbav20311/apps/web/vue3/index.html`
|
|
|
|
**修改内容**:
|
|
- 左侧控制面板:执行按钮下方添加红色"⏹ 停止执行"按钮(执行时显示)
|
|
- 右侧结果面板:执行状态卡片添加"⏹ 停止"按钮
|
|
- 新增数据变量:`isExecuting`, `isStopping`, `currentTaskId`
|
|
- 新增方法:`stopExecution()` - 调用 `/api/agent/cancel/{task_id}` 停止任务
|
|
|
|
**按钮显示逻辑**:
|
|
```html
|
|
<!-- 执行按钮 -->
|
|
<el-button :disabled="!selectedStage || isExecuting" :loading="isExecuting">
|
|
{{ isExecuting ? '⏳ 执行中...' : '🚀 执行分析' }}
|
|
</el-button>
|
|
|
|
<!-- 停止按钮 -->
|
|
<el-button v-if="isExecuting" type="danger" @click="stopExecution">
|
|
{{ isStopping ? '⏹ 正在停止...' : '⏹ 停止执行' }}
|
|
</el-button>
|
|
```
|
|
|
|
---
|
|
|
|
### 2. RNA-seq 文件检测修复 ✅
|
|
|
|
**问题**: Agent执行时(对话框输入)找不到 `samples.yaml`,但手动执行可以
|
|
|
|
**原因**:
|
|
- 对话框执行时 `session_id` 是 "session_xxx" 格式,不是 "job_xxx" 格式
|
|
- 原代码只查找最新的 job_ 目录,没有考虑配置文件位置
|
|
|
|
**修改文件**: `/home/xia-lab/wutx/00test/bbav20311/gfa_core/mas/core/orchestrator.py`
|
|
|
|
**修复内容**:
|
|
1. 新增辅助方法 `_get_input_dir()`:
|
|
```python
|
|
def _get_input_dir(self, session_id: str, stage_name: str = "") -> tuple[Path, str]:
|
|
"""获取输入目录,优先查找包含samples.yaml的job目录"""
|
|
```
|
|
|
|
2. 应用到以下方法:
|
|
- `_execute_rnaseq_qc` (RNA-QC)
|
|
- `_execute_rnaseq_align` (RNA-ALN)
|
|
- `_execute_rnaseq_quant` (RNA-QUAN)
|
|
- `_execute_rnaseq_de` (RNA-DE)
|
|
- `_execute_rnaseq_enrich` (RNA-ENRICH)
|
|
- `_execute_kaks` (KaKs)
|
|
|
|
**查找逻辑**:
|
|
- 如果 `session_id` 不是 job_ 开头,查找所有 job_ 目录
|
|
- 优先选择包含 `samples.yaml` 或 `group_sample.yaml` 的目录
|
|
- 如果没有配置文件,使用最新的 job 目录
|
|
|
|
---
|
|
|
|
### 3. RNA-seq 缓存结果问题修复 ✅
|
|
|
|
**问题**: 对话框执行15秒就返回"完成",但实际执行需要15分钟
|
|
|
|
**原因**:
|
|
- 代码逻辑 `if has_results` 只要结果文件存在就返回成功
|
|
- 之前执行的结果文件还在,系统直接返回缓存结果
|
|
|
|
**修改文件**: `/home/xia-lab/wutx/00test/bbav20311/gfa_core/mas/core/orchestrator.py`
|
|
|
|
**修复内容**:
|
|
|
|
1. **严格的成功判断**:
|
|
```python
|
|
# 修改前:只要结果文件存在就算成功
|
|
if has_results:
|
|
|
|
# 修改后:必须执行成功且结果文件存在
|
|
execution_success = (result.returncode == 0) and has_results
|
|
if execution_success:
|
|
```
|
|
|
|
2. **结果文件时效检查**:
|
|
```python
|
|
# 如果结果文件超过24小时,删除旧结果重新执行
|
|
if age_hours > 24:
|
|
shutil.rmtree(qc_dir)
|
|
qc_dir.mkdir(parents=True, exist_ok=True)
|
|
```
|
|
|
|
---
|
|
|
|
## 修改文件清单
|
|
|
|
| 文件路径 | 修改类型 | 说明 |
|
|
|---------|---------|------|
|
|
| `apps/web/vue3/index.html` | 修改 | 添加停止执行按钮、状态管理 |
|
|
| `gfa_core/mas/core/orchestrator.py` | 修改 | 添加`_get_input_dir()`方法、修复RNA-seq执行逻辑、修复缓存问题 |
|
|
|
|
---
|
|
|
|
## 待验证
|
|
|
|
- [ ] 停止按钮在前端正确显示
|
|
- [ ] 点击停止按钮能正确取消任务
|
|
- [ ] 对话框执行RNA-seq能正确找到samples.yaml
|
|
- [ ] RNA-seq执行时间符合预期(约15分钟)
|
|
|
|
---
|
|
|
|
## 相关记录
|
|
|
|
- 昨日记录: `memory/2026-04-03.md` - Celery集成修订
|
|
- 项目索引: `MEMORY.md`
|
|
|
|
---
|
|
|
|
*记录时间: 2026-04-04 22:57*
|