refactor: rename pty_process to cc_runner
The module has long since moved away from PTY technology, using claude -p with --output-format stream-json and --resume instead. Rename to cc_runner to accurately reflect what it does. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
a278ece348
commit
1b2bb8cdc2
@ -55,7 +55,7 @@ PhoneWork uses a **Router + Host Client** architecture that supports both single
|
|||||||
| `orchestrator/agent.py` | LangChain agent with per-user history + direct/smart mode + direct Q&A |
|
| `orchestrator/agent.py` | LangChain agent with per-user history + direct/smart mode + direct Q&A |
|
||||||
| `orchestrator/tools.py` | Tools: session management, shell, file ops, web search, scheduler, task status |
|
| `orchestrator/tools.py` | Tools: session management, shell, file ops, web search, scheduler, task status |
|
||||||
| `agent/manager.py` | Session registry with persistence, idle timeout, and auto-background tasks |
|
| `agent/manager.py` | Session registry with persistence, idle timeout, and auto-background tasks |
|
||||||
| `agent/pty_process.py` | Runs `claude -p` headlessly, manages session continuity via `--resume` |
|
| `agent/cc_runner.py` | Runs `claude -p` headlessly, manages session continuity via `--resume` |
|
||||||
| `agent/task_runner.py` | Background task runner with Feishu notifications |
|
| `agent/task_runner.py` | Background task runner with Feishu notifications |
|
||||||
| `agent/scheduler.py` | Reminder scheduler with persistence |
|
| `agent/scheduler.py` | Reminder scheduler with persistence |
|
||||||
| `agent/audit.py` | Audit log of all interactions |
|
| `agent/audit.py` | Audit log of all interactions |
|
||||||
|
|||||||
@ -315,7 +315,7 @@ SERVES_USERS:
|
|||||||
**What the host client runs:**
|
**What the host client runs:**
|
||||||
- Full `orchestrator/agent.py` (mailboy LLM, tool loop, per-user history, active session)
|
- Full `orchestrator/agent.py` (mailboy LLM, tool loop, per-user history, active session)
|
||||||
- Full `orchestrator/tools.py` (CC, shell, file ops, web, scheduler — all local)
|
- Full `orchestrator/tools.py` (CC, shell, file ops, web, scheduler — all local)
|
||||||
- `agent/manager.py`, `agent/pty_process.py`, `agent/task_runner.py` — unchanged
|
- `agent/manager.py`, `agent/cc_runner.py`, `agent/task_runner.py` — unchanged
|
||||||
|
|
||||||
Task completion flow:
|
Task completion flow:
|
||||||
- Background task finishes → host client pushes `TaskComplete` to router
|
- Background task finishes → host client pushes `TaskComplete` to router
|
||||||
@ -495,7 +495,7 @@ PhoneWork/
|
|||||||
│
|
│
|
||||||
├── agent/ # Part of host client (local execution)
|
├── agent/ # Part of host client (local execution)
|
||||||
│ ├── manager.py # Session registry
|
│ ├── manager.py # Session registry
|
||||||
│ ├── pty_process.py # Claude Code runner
|
│ ├── cc_runner.py # Claude Code runner
|
||||||
│ ├── task_runner.py # Background tasks
|
│ ├── task_runner.py # Background tasks
|
||||||
│ ├── scheduler.py # Reminders
|
│ ├── scheduler.py # Reminders
|
||||||
│ └── audit.py # Audit log
|
│ └── audit.py # Audit log
|
||||||
|
|||||||
@ -10,7 +10,7 @@ from dataclasses import dataclass, field, asdict
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import Dict, List, Optional
|
from typing import Dict, List, Optional
|
||||||
|
|
||||||
from agent.pty_process import run_claude, DEFAULT_PERMISSION_MODE, VALID_PERMISSION_MODES
|
from agent.cc_runner import run_claude, DEFAULT_PERMISSION_MODE, VALID_PERMISSION_MODES
|
||||||
from agent.audit import log_interaction
|
from agent.audit import log_interaction
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|||||||
@ -12,7 +12,7 @@ from typing import Optional, Tuple
|
|||||||
from agent.manager import manager
|
from agent.manager import manager
|
||||||
from agent.scheduler import scheduler
|
from agent.scheduler import scheduler
|
||||||
from agent.task_runner import task_runner
|
from agent.task_runner import task_runner
|
||||||
from agent.pty_process import VALID_PERMISSION_MODES, DEFAULT_PERMISSION_MODE
|
from agent.cc_runner import VALID_PERMISSION_MODES, DEFAULT_PERMISSION_MODE
|
||||||
from orchestrator.agent import agent
|
from orchestrator.agent import agent
|
||||||
from orchestrator.tools import set_current_user, get_current_chat
|
from orchestrator.tools import set_current_user, get_current_chat
|
||||||
|
|
||||||
|
|||||||
@ -51,7 +51,7 @@ def mock_run_claude():
|
|||||||
Default return value is a short CC-style output string.
|
Default return value is a short CC-style output string.
|
||||||
"""
|
"""
|
||||||
mock = AsyncMock(return_value="Claude Code: task complete.")
|
mock = AsyncMock(return_value="Claude Code: task complete.")
|
||||||
with patch("agent.pty_process.run_claude", mock), \
|
with patch("agent.cc_runner.run_claude", mock), \
|
||||||
patch("agent.manager.run_claude", mock):
|
patch("agent.manager.run_claude", mock):
|
||||||
yield mock
|
yield mock
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user