agentscope-ai / agentscope-ai/QwenPaw

[Bug]: /mission command causes Console to freeze completely

Abierto
#4,454 4 comentarios 0 reacciones 1 asignado Reclamado por @rayrayraykk Ver en GitHub
bug
Lenguaje dominante
TypeScript
Estrellas
35k
Forks
3.1k
Merge medio
1 d 13 h
PR fusionados (30 d)
228

Descripción

## QwenPaw Version

v1.1.7

---

## Description

执行 `/mission` 指令后,QwenPaw Console 界面会完全卡死(freeze),无法正常对话或发送新消息。进程仍在运行但界面无响应。即使清空 `~/.copaw/workspaces/default/missions/` 目录并重置 session,问题仍然会发生。

**Related PR(s):** None

**Security considerations:** 无安全风险,仅功能不可用

---

## Component(s) Affected

- [x] Core / Backend (app, agents, config, providers, utils, local_models)
- [x] Console (frontend web UI)
- [ ] Channels (DingTalk, Feishu, QQ, Discord, iMessage, etc.)
- [ ] Skills
- [ ] CLI
- [ ] Documentation (website)
- [ ] Tests
- [ ] CI/CD
- [x] Scripts / Deploy

---

## Environment

- **QwenPaw version:** Latest (May 2026) - via `qwenpaw --version` to verify
- **OS:** macOS Darwin 24.6.0 (arm64)
- **Install method:** pip / one-line install
- **Python version:** 3.12

---

## Steps to Reproduce

1. Start QwenPaw Console at `http://localhost:8088`
2. In any active conversation (main workspace or new session), type `/mission` command
3. Observe the console interface behavior

---

## Actual vs Expected

- **Actual:**
- Console interface freezes completely within seconds after `/mission` command
- No error messages displayed in UI
- Cannot send/receive new messages
- Process still running (`ps aux | grep qwenpaw` shows PID active)
- Session file remains unchanged but frozen state persists
- Requires manual intervention: reset session JSON + restart QwenPaw app to recover

- **Expected:**
- Should gracefully load missions from `~/.copaw/workspaces/default/missions/` if files exist
- If missions directory is empty or contains no valid mission files, should display "No missions available" message
- Should not crash or freeze the entire console interface

---

## Logs / Screenshots

**No visible errors in browser console or UI.**
Process status check confirms it's running but stuck:

```bash
# Command output when issue occurs
$ ps aux | grep "qwenpaw app" | grep -v grep
idominic 726 8.1 3.5 412764576 293616 ?? S 14:04PM 0:14.53 /Library/Frameworks/Python.framework/Versions/3.12/Resources/Python.app/Contents/MacOS/Python /Library/Frameworks/Python.framework/Versions/3.12/bin/qwenpaw app --host 0.0.0.0
```

**Recommended debugging:** Add logging when loading missions:

```python
# In mission loading code (if accessible):
try:
with open('~/.copaw/workspaces/default/missions/', 'r') as f:
# ... existing code
except Exception as e:
print(f"[MISSION] Error loading: {e}", file=sys.stderr)
raise # or return friendly error message to frontend
```

---

## Additional Notes

### Workaround (已验证有效)

```bash
# Step 1: Clear missions directory completely
rm -rf ~/.copaw/workspaces/default/missions/
mkdir -p ~/.copaw/workspaces/default/missions/

# Step 2: Backup and reset session
cp ~/.copaw/workspaces/default/sessions/console/console--default_console--main_hub.json \
~/Desktop/session-backup-$(date +%Y%m%d%H%M).json

# Step 3: Clear session messages (Python one-liner)
python3 -c "import json; f=open('~/.copaw/workspaces/default/sessions/console/console--default_console--main_hub.json','r+'); d=json.load(f); d['messages']=[]; f.seek(0); json.dump(d,f,indent=2)"

# Step 4: Restart QwenPaw
kill $(ps aux | grep "qwenpaw app" | grep -v grep | awk '{print $2}')
qwenpaw app
```

### Questions for Maintainers

#### 1. Is the Mission feature required?

如果 Mission 是必需功能:
- 是否需要特定的配置文件才能正常运行?
- 文档中是否说明了正确的使用方式和配置方法?
- 是否有示例 mission 文件可以参考?

如果 Mission 是可选功能:
- 是否可以默认禁用此功能?
- 是否有计划移除该功能?
- 是否有配置开关可以关闭它?

#### 2. Recommended Alternative for Task Management?

We currently manage tasks without using the official Mission feature, with a fully functional custom system:

| Function | Our Current Solution |
|----------|---------------------|
| Task Creation | `task_registry.py create_task()` → `task_registry.json` |
| Task Tracking | Custom API endpoints (`/api/tasks/*`) |
| Task Approval | Agent coordination + Git pre-commit hooks |
| Dashboard Display | Custom Dashboard (port 8765) reads JSON directly |

**Our questions:**
- Is there an official recommended alternative for task management?
- Does our current approach align with QwenPaw best practices?
- Should we integrate with the Mission feature or continue using task_registry?
- Will the Mission feature be maintained/refactured in future releases?

### System State When Issue Occurs

```
~/.copaw/workspaces/default/
├── missions/ ← Empty (only .DS_Store exists)
├── sessions/console/ ← Frozen state stored here
│ └── console--default_console--main_hub.json
├── task_registry.json ← Works perfectly (not affected)
└── dispatcher.py ← Custom routing logic
```

The mission directory being empty triggers this bug, which suggests it's a null-check missing in the code.

### Severity Assessment

- **User Impact:** High - Console becomes completely unusable until manual recovery
- **Data Loss Risk:** Low - Only session state affected, actual data (task_registry.json, memory files) preserved
- **Recovery Complexity:** Medium - Requires manual terminal commands to fix
- **Priority:** 🔴 High (should be addressed before general release)

---

*Reported by: @idominic (CoPaw Team)*
*Date: 2026-05-17T14:30+08:00*
*System: macOS Arm64*

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.