Commit Graph

32 Commits

Author SHA1 Message Date
ejclaw
65dd82ba6b Route STEP_DONE through reviewer 2026-04-24 12:03:12 +09:00
ejclaw
87b1204323 Phase 0 — STEP_DONE/TASK_DONE split + owner-follow-up integration smoke 2026-04-23 13:07:01 +09:00
ejclaw
8fff703f84 test/runtime: align executor specs and bundled cli resolution 2026-04-20 13:33:13 +09:00
ejclaw
a59813dee6 feat: support room-level reviewer and arbiter agent selection 2026-04-15 23:47:46 +09:00
ejclaw
2ab3bddc0e Recover Codex compaction failures in paired owner flow 2026-04-15 03:11:14 +09:00
ejclaw
1e46b05b03 fix: stabilize paired runtime turn identity 2026-04-09 16:31:01 +09:00
ejclaw
000e672ca8 style: apply prettier formatting 2026-04-09 13:55:59 +09:00
ejclaw
0f994ab2ce fix: harden paired runtime turn coordination 2026-04-09 13:52:42 +09:00
ejclaw
d996d5ff10 Move paired handoff enqueue into backend 2026-04-08 10:09:23 +09:00
ejclaw
0f751af151 Stabilize paired follow-up routing 2026-04-08 03:50:06 +09:00
ejclaw
f9d9c2af6d Refactor paired runtime orchestration 2026-04-07 23:45:53 +09:00
ejclaw
f24d9ee117 Route fresh review-ready input to owner 2026-04-07 19:05:18 +09:00
ejclaw
75066f345d Deduplicate paired reviewer handoffs 2026-04-07 08:07:25 +09:00
ejclaw
f7aeac99c8 Format routing simplification files 2026-04-06 22:45:04 +09:00
ejclaw
b62eebc25b Simplify paired turn routing and prompt builders 2026-04-06 22:44:38 +09:00
Eyejoker
509e4c24a3 refactor: cut over room mode from paired legacy 2026-03-31 14:47:59 +09:00
Eyejoker
bfe164dece style: format role plan runtime imports 2026-03-31 09:41:40 +09:00
Eyejoker
7f8a361f24 refactor: wire role agent plan into runtime 2026-03-31 09:41:40 +09:00
Eyejoker
60408cc1fa fix: arbiter session collision — separate session folder + always fresh session
- resolveSessionFolder now always returns unique folder for arbiter
  (prevents sharing session with owner when both use same agent type)
- Arbiter sessionId forced to undefined to prevent resume attempts
2026-03-31 04:26:48 +09:00
Eyejoker
3e2954ebcf refactor: extract resolveEffectiveAgentType/resolveSessionFolder as SSOT, deduplicate CONTAINER_IMAGE 2026-03-30 23:44:49 +09:00
Eyejoker
d3df67e08c chore: remove dead code (pairedCursorKey, unused ARBITER_AGENT_TYPE import) 2026-03-30 22:59:18 +09:00
Eyejoker
14d70f345a refactor: extract resolveActiveRole() as single source of status→role mapping
resolveCursorKey and resolveChannel both duplicated the same
taskStatus→role switch. Now resolveActiveRole() is the single
mapping, and both functions derive from it.
2026-03-30 22:58:00 +09:00
Eyejoker
7ad40276d9 refactor: centralize cursor key resolution with resolveCursorKey()
Replace all manual cursor key construction (hardcoded chatJid:reviewer,
chatJid:arbiter, pairedCursorKey, 3-way ternary) with a single
resolveCursorKey(chatJid, taskStatus) function.

- Removed pairedCursorKey import (no longer needed)
- Removed loopIsReviewerTurn, loopIsArbiterTurn intermediate variables
- All cursor key logic now flows through one function that maps
  task status to the correct role-specific key
2026-03-30 22:54:35 +09:00
Eyejoker
b209061006 fix: use separate cursors for owner and reviewer in paired rooms
Root cause: owner and reviewer shared the same message cursor. When
the owner's turn completed, the cursor advanced past the owner's
message. The reviewer's turn then only saw messages after that cursor,
missing the owner's response entirely.

Now paired rooms use role-aware cursor keys (chatJid for owner,
chatJid:reviewer for reviewer). Each role advances only its own
cursor, so the reviewer always sees the owner's latest messages
and vice versa.
2026-03-30 20:23:16 +09:00
Eyejoker
16d20fe627 feat: paired review system overhaul — unified service, configurable agents, silent output removal
- Remove UNIFIED_MODE legacy: single service manages all 3 Discord bots
- Add OWNER_AGENT_TYPE / REVIEWER_AGENT_TYPE env vars for configurable agent selection
- Fix Discord channel routing: reviewer output goes through correct bot (discord/discord-review)
- Fix channel name assignment: explicit names prevent agentTypeFilter collision
- Remove silent output suppression system: harness-level protections replace prompt workarounds
- Add reviewer approval detection: DONE marker on first line stops ping-pong
- Include user's original message in reviewer prompt for context
- Fix round_trip_count auto-reset on new user message
- Fix session ID conflict: reviewer doesn't reuse owner's session
- Fix pending progress text flush in runner on close sentinel
- Promote buffered intermediate text to final result when result event has no text
- Remove legacy files: .env.codex.example, .env.codex-review.example, migrate-unify.cjs
- Update CLAUDE.md: server-side build deployment, unified architecture docs
2026-03-29 20:50:32 +09:00
Eyejoker
8a4d83e2c1 fix: let both bots see each other's messages in paired rooms for natural ping-pong 2026-03-29 19:22:01 +09:00
Eyejoker
6268ee64ed fix: prevent bot ping-pong in implicit continuation window
Exclude is_bot_message from implicit continuation trigger check.
Previously, bot A's response would trigger bot B's continuation
window, causing infinite back-and-forth responses.

Also: tool activity sub-lines use description over summary,
and max activities reduced to 2.
2026-03-23 18:44:43 +09:00
Eyejoker
866d4970f3 fix: ignore watcher status control messages 2026-03-23 06:45:04 +09:00
Eyejoker
2ab7aedcce style: format extracted runtime helpers 2026-03-23 06:39:47 +09:00
Eyejoker
898c77fcfc refactor: consolidate runtime helpers 2026-03-23 06:39:26 +09:00
Eyejoker
c733217074 style: format runtime helpers 2026-03-23 06:17:41 +09:00
Eyejoker
d4b19ab950 refactor: split message runtime state 2026-03-23 06:17:17 +09:00