feat: replace session commands with a natural-language stop

Remove the /compact, /clear and /stop session commands. They were gated
to the main room or SESSION_COMMAND_ALLOWED_SENDERS, neither of which
exists in this deployment, so nobody could use them. The agent-runner
/compact passthrough goes with them.

Instead, a short human message whose whole intent is "stop" (그만, 멈춰,
중단해, 하지 마, 취소, stop, cancel, ...; see src/stop-intent.ts) stops the
room when it has something to stop: a running or queued run, an open
paired task, or unprocessed human messages before it. The message loop
then
- advances the room cursors past the stop message (memory + router_state)
- completes the open paired task as user_stopped, cancels its open turns
  and drops its execution lease
- closes stdin with a user-stop reason and kills the agent through the
  existing GroupQueue.closeStdin/killProcess
- replies "진행 중이던 작업을 중단했습니다." once
When nothing is running the message is handled as a normal message.

The user-stop close reason is treated like a human interruption, so the
killed paired turn releases its lease without counting a failure and
queues no follow-up, and the turn controller does not post the generic
failure text on top of the stop reply.

advanceLastAgentCursor no longer moves a cursor backwards, so a run that
finishes after the stop cannot rewind the cursor and re-dispatch the
stop message (the respawn seen when an agent was only killed).

Stale SESSION_COMMAND_* keys in .env are now ignored instead of failing
startup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Codex
2026-10-01 19:26:10 +09:00
parent fe7c5a7b23
commit ce4547daa6
40 changed files with 949 additions and 1084 deletions

View File

@@ -4,6 +4,10 @@
## [Unreleased]
### Added
- 자연어 작업 중단: 작업이 실행 중이거나 대기 중인 방에 "그만", "멈춰", "중단해", "취소", "stop" 같은 중단 의도만 담긴 짧은 메시지를 보내면 실행 중인 에이전트를 종료하고, 열린 paired task를 `user_stopped`로 닫고(남은 turn 취소·lease 해제), 중단 메시지까지 처리된 것으로 넘긴 뒤 "진행 중이던 작업을 중단했습니다."라고 답함. 다른 지시가 섞인 메시지는 중단으로 보지 않음
### Changed
- 기본 Claude 모델을 Claude Opus 5.5(`claude-opus-5-5`)로 상향. Opus 5.5는 Claude Code CLI 2.1.280 이상이 필요해 `@anthropic-ai/claude-agent-sdk`를 0.3.153 → 0.3.286(번들 CLI 2.1.286)으로 올림 (8b68885)
@@ -17,10 +21,12 @@
- 쓰이지 않던 export·고아 모듈(`src/dashboard.ts`, `src/dashboard-status-content.ts`, `src/restart-context-cli.ts`)과 `DELTA_HANDOFF_*` 설정
- macOS launchd·nohup(WSL) 설치 경로와 `launchd/`, 쓰이지 않던 `repo-tokens/` GitHub Action. 서비스 설치는 Linux systemd만 지원
- 루트에서 import하지 않던 `yaml`, `zod`, `@modelcontextprotocol/sdk` 의존성 (agent-runner는 자체 의존성 유지)
- `/compact`·`/clear`·`/stop` 세션 명령(main 방·관리자 전용이라 실제로 쓰이지 않음)과 `SESSION_COMMAND_ALLOWED_SENDERS` 설정, agent-runner의 `/compact` 처리. `.env`에 남아 있는 `SESSION_COMMAND_*` 값은 더 이상 시작을 막지 않고 무시됨
- 기본 비활성이던 주기적 Codex warm-up 루프와 `CODEX_WARMUP_ENABLED`/`CODEX_WARMUP_INTERVAL_MS`. 고정 슬롯 usage primer는 그대로 동작
### Fixed
- 메시지 처리 커서가 뒤로 감기지 않도록 함. 더 새로운 메시지를 이미 처리한 뒤 끝난 이전 실행이 커서를 되돌려 같은 메시지가 다시 실행되던 경로를 막음
- Codex 계정이 1개일 때 두 방이 동시에 Codex를 쓰면 두 번째 실행이 "Codex rotation pool unavailable"로 즉시 실패하고 리뷰가 조용히 생략되던 문제 수정. 잠금이 다른 실행에 잡혀 있으면 최대 15분 기다림 (30ba510)
- 이미 턴 소유권을 잃은 실행의 5초 진행 표시 타이머가 멈추지 않아, 실제로 작업 중인 방의 진행 메시지가 멈춘 것처럼 보이던 문제 수정 (69ae334)
- `work_dir`가 비어 있는 tribunal 방에서 실행 컨텍스트가 만들어지지 않아 작업 리비전이 얼고 10분 안의 후속 메시지가 버려지던 문제 수정. 자동 복구 경로가 동작하도록 함 (c7a8a43)