Commit Graph

78 Commits

Author SHA1 Message Date
ejclaw
9e152fac93 runner: narrow Claude task progress subagent mapping 2026-04-13 08:38:44 +09:00
ejclaw
561eee050e build: refresh Claude and Codex SDKs 2026-04-11 23:21:29 +09:00
ejclaw
88f8b3006c runtime: split ipc queue and runner helpers 2026-04-11 05:49:40 +09:00
ejclaw
f5c3393c32 runners: share protocol and reviewer policy 2026-04-11 05:07:05 +09:00
ejclaw
94d53e4cc3 build: unify bun quality gate 2026-04-11 04:47:16 +09:00
ejclaw
e88073f2f8 fix: block stale paired IPC and duplicate finalize turns 2026-04-11 04:18:43 +09:00
ejclaw
497e6dec74 refactor: decompose runtime coordination and runner internals (PR6) 2026-04-10 22:48:49 +09:00
ejclaw
0e016395c6 Prune package manager legacy artifacts 2026-04-08 07:12:54 +09:00
ejclaw
9640d51ff9 Remove unused root Claude guide 2026-04-08 06:46:52 +09:00
ejclaw
52a59a1eba Refresh verification runtime docs 2026-04-08 05:42:43 +09:00
ejclaw
edd5b45d99 Simplify verification runtime 2026-04-08 05:30:14 +09:00
ejclaw
4511ca5692 Clarify reviewer verification limits 2026-04-07 02:13:22 +09:00
ejclaw
cbb6bc97c7 Refactor paired execution flow boundaries 2026-04-07 00:45:17 +09:00
ejclaw
4650abbd10 Rename readonly reviewer runtime remnants 2026-04-06 17:27:16 +09:00
ejclaw
d75d26c23d Stabilize paired reviewer recovery and owner follow-up 2026-04-06 07:49:26 +09:00
ejclaw
994e957767 Enable unsafe host paired runtime 2026-04-06 02:40:15 +09:00
ejclaw
446b194e2c Automate worktree dependency installs 2026-04-05 22:34:16 +09:00
Eyejoker
da6e428650 Allow reviewer runtime with remote origins 2026-04-05 05:31:47 +09:00
Eyejoker
7f0fbd5811 Route IPC send_message by paired room role 2026-04-04 23:02:30 +09:00
Eyejoker
4dceb9e678 Fix readonly runtime build check 2026-04-04 22:02:55 +09:00
Eyejoker
04802166a6 Fix reviewer canonical repo mounts 2026-04-04 22:01:08 +09:00
Eyejoker
e9c400424d Add reviewer host evidence and verification shims 2026-04-04 20:51:24 +09:00
Eyejoker
3dd772c229 Refactor local memory and role-fixed runtime routing 2026-04-04 03:50:28 +09:00
Eyejoker
a955964522 feat: add memory selection and TTL decay 2026-04-01 00:48:40 +09:00
Eyejoker
c76126bd58 refactor: replace Memento MCP with local memory 2026-03-31 23:22:50 +09:00
Eyejoker
2070e0391f refactor: remove register_group legacy surface 2026-03-31 21:59:01 +09:00
Eyejoker
b9538e54bc feat: add room-level assignment write path 2026-03-31 21:21:57 +09:00
Eyejoker
4ac2b9066b fix: auto-retry Codex turn once on interrupted status
When the Codex SDK returns 'interrupted' (API-side timeout/disconnect),
retry the turn once before reporting failure. Prevents unnecessary
"요청을 완료하지 못했습니다" messages for transient issues.
2026-03-31 06:48:07 +09:00
Eyejoker
8360812e1d fix: align ContentBlock media_type with SDK 0.2.87 literal union type 2026-03-31 05:01:21 +09:00
Eyejoker
2753849343 chore: update Claude Agent SDK 0.2.87, Codex SDK 0.117.0 2026-03-31 04:47:42 +09:00
Eyejoker
0112f5a2d6 feat: migrate runtime from Node.js to Bun
- Replace better-sqlite3 with bun:sqlite (native, no native addon build)
- Change all spawn('node') to spawn('bun') for agent processes
- Update package.json scripts: node→bun, tsx→bun, npm→bun
- Add bun-types for tsc compatibility
- Add bun:sqlite→better-sqlite3 shim for vitest (tests run on Node.js)
- Update Dockerfile: install bun alongside Node.js (CLIs need Node)
- Update setup/platform.ts: getNodePath() resolves bun binary
- Remove better-sqlite3 from production dependencies (devDep only for tests)
2026-03-30 23:58:54 +09:00
Eyejoker
504be9e41a refactor: use tree hash + git diff for post-approval change detection
- Replace commit hash comparison with git tree hash (HEAD^{tree}) to
  avoid false re-review triggers on commit-only operations
- Use git diff --quiet for actual file change detection
- Update source_ref on failed reviewer execution with done verdict
- Add tests for empty-commit finalize and code-change re-review
- Document Codex reviewer bash mutation gap in reviewer-runtime
2026-03-29 23:24:48 +09:00
Eyejoker
787c05a561 fix: /compact masked by room role header in both runners
prependRoomRoleHeader was called BEFORE /compact detection, turning
"/compact" into "[PAIRED ROOM: owner]\n/compact" which failed the
exact match check. Now session commands are detected first.
2026-03-29 21:14:04 +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
05c06fc467 feat: graceful agent abort on SIGTERM via AbortController
When /stop sends SIGTERM, the runner now calls AbortController.abort()
on the Claude SDK query, allowing graceful cleanup of in-flight API
requests before the process exits. Falls back to SIGKILL after 5s.
2026-03-29 18:47:26 +09:00
Eyejoker
dad6f50937 feat: enforce paired reviewer gate verdicts 2026-03-29 06:03:45 +09:00
Eyejoker
eee09e8b7c fix: clean reviewer snapshots and scope git guard 2026-03-28 21:34:06 +09:00
Eyejoker
e7f49d77da feat: add paired review workspace flow 2026-03-28 21:14:25 +09:00
Eyejoker
79a8a2639e feat: add structured room role metadata 2026-03-28 19:30:32 +09:00
Eyejoker
fe6314108c feat: add structured silent output contract 2026-03-28 05:56:58 +09:00
Eyejoker
7b63ba859d fix: deduplicate CI watchers and remove task ID from watcher prompts
Prevent duplicate CI completion notifications in paired rooms by checking
for existing active watchers with the same channel+provider+metadata before
creating a new one. Remove Task ID from watcher prompt construction to
avoid router secret redaction (task- IDs contain sk- pattern), passing
EJCLAW_RUNTIME_TASK_ID via env var instead and making cancel_task
auto-resolve when task_id is omitted.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-26 20:57:59 +09:00
Eyejoker
f51f282eb1 chore: update agent-runner package-lock.json
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-25 22:31:57 +09:00
Eyejoker
33fcf9c788 feat: add host-driven GitHub Actions CI watcher (Level 3)
Replace LLM-per-tick polling with direct `gh api` calls for GitHub
Actions watchers. New `ci_provider` discriminator column routes tasks
to either the host-driven path (zero LLM tokens) or the existing
generic LLM path. GitHub watchers poll at 15s intervals (min 10s)
via `checkGitHubActionsRun()` in the scheduler, with completion
messages sent directly to chat on terminal state.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-25 22:31:42 +09:00
Eyejoker
24d93d5c78 fix: fail fast on missing host IPC dir for task runtimes 2026-03-25 21:40:34 +09:00
Eyejoker
5620301024 fix: pass EJCLAW_HOST_IPC_DIR to MCP server env for both runners
Watcher tasks get task-scoped IPC dirs (data/ipc/{group}/tasks/{taskId}/),
but the MCP server used HOST_IPC_DIR to write IPC files. Without
EJCLAW_HOST_IPC_DIR, it fell back to the task-scoped path, writing
cancel_task/send_message files to nested dirs the IPC watcher never scans.

This caused 11 zombie watchers stuck in infinite loops — self-cancel
calls silently failed with ~4000 stranded IPC files accumulating.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-25 21:05:22 +09:00
Eyejoker
5ea3439c5f refactor: extract shared utilities, protocol constants, and retry loop
Phase 3: provider-retry.ts — shared Claude rotation loop (SSOT)
  - retryClaudeWithRotation extracted from message-agent-executor + task-scheduler
  - ~200 lines of duplicated retry logic removed

Phase 4: types.ts — AgentOutputPhase + VisiblePhase unified
Phase 5: types.ts — AgentConfig extended with claudeThinking/claudeThinkingBudget

Utilities (utils.ts):
  - getErrorMessage: 14 occurrences of instanceof Error pattern → 1 function
  - readJsonFile/writeJsonFile: 19 occurrences of JSON+fs pattern → 2 functions
  - fetchWithTimeout: 3 occurrences of AbortController pattern → 1 function
  - formatElapsedKorean: deduplicated from task-watch-status + message-turn-controller

Protocol (agent-protocol.ts):
  - OUTPUT_START/END_MARKER centralized (runners keep local copies with SSOT reference)
  - IMAGE_TAG_RE, IPC constants documented

Runner: show "대화 요약 중..." progress message during auto-compact

Net: -137 lines, 354/354 tests passing
2026-03-25 04:59:49 +09:00
Eyejoker
b9f98fcc19 feat: log token count on auto-compact trigger
Log pre_tokens and trigger type from compact_boundary message
in both main query loop and /compact slash command path.
2026-03-25 04:01:48 +09:00
Eyejoker
0724914a43 merge: integrate remote token rotation + memory pipeline
Merge remote main (token rotation, usage API, dashboard fixes)
with local memory pipeline changes. Smart quote encoding fixed.
Test alignment pending.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 03:53:15 +09:00
Eyejoker
3467e245d5 feat: auto memory pipeline — host-driven Memento recall/reflect
Add automatic memory integration so EJClaw host directly calls Memento
MCP for recall at session start and reflect on compact, removing
reliance on agent voluntary tool use.

Stage 1: New sessions get room memory briefing injected into system
prompt (CLAUDE.md / AGENTS.md) via host-side MCP client.

Stage 2: PreCompact hook automatically calls reflect + remember to
persist session summaries as room-memory fragments.

Also restores missing source files (token-rotation, codex-token-rotation,
claude-usage exports) to fix full build from source.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-24 03:48:36 +09:00
Eyejoker
ee65330e66 fix: rollback codex SDK to 0.115.0 (0.116.0 causes stuck turns) 2026-03-23 20:38:30 +09:00