140 Commits

Author SHA1 Message Date
Codex
0f0f698fb4 fix(paired): deliver escalation notices that were silently dropped
When a paired task escalated to the user after a reviewer final, the
"⚠️ 자동 해결 불가" mention was emitted after the turn had already
published its final and released its attempt. MessageTurnController
dropped it ("Discarding late agent output after terminal final") and the
ownership guard would have suppressed it anyway, so rooms looked stalled
right after the reviewer's reply (javis_bot 2026-11-11 14:11, 15:28).

- Mark host post-completion notices (escalation, reviewer-unavailable
  answer) and send them as a fresh message past both guards and the
  reviewer direct-terminal skip.
- Reviewer prompt: NEEDS_CONTEXT is only for questions the user must
  answer; ask the owner for evidence with DONE_WITH_CONCERNS.
- run_verification: load the helper and verifier from the EJClaw install
  instead of the repo under review (was "Module not found" outside
  EJClaw), and run the helper outside the repo so its .env is not read
  by EJClaw's config loader.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:45:50 +09:00
Codex
c6afd7ccb8 feat(ipc): merge consecutive send_message updates into one live message
Repeated send_message progress updates each posted a new Discord message,
so a long run left a stack of separate status posts. While the role's
previous send_message is still the newest message in the chat, append the
new text to it by editing it (rendered like a fresh send). A message from
anyone in between, a status verdict, an attachment, or the 2000-char limit
starts a new message; a failed edit falls back to sending a new one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 14:14:16 +09:00
Codex
3f2e364c73 fix: stop silent Claude 401 stalls and token-family revocations
- Refreshing the OAuth token revokes the old access token, and agents hold it
  in CLAUDE_CODE_OAUTH_TOKEN (Claude Code keeps env tokens on 401). Refresh
  early only while no run is active; keep the 1h hard deadline.
- forceRefreshToken (after a 401) now probes /api/oauth/profile: a revoked
  token keeps its expiresAt, so it was handed back unchanged forever. A
  rejected token is refreshed; if that fails, re-login is flagged at once and
  held until a different token appears.
- Classify "OAuth access token has been revoked" as auth-expired. When the
  login is gone, close the paired task and tell the room to re-login instead
  of looping owner/arbiter retries with suppressed output.
- Only suppress the CLI's own short 401 banner, not an answer quoting it
  (a sketchup-app TASK_DONE report was swallowed this way).
- Runner denies Bash commands that copy or write .credentials.json: a CLI test
  against a copied login refreshed the real token family on 2026-11-02 and
  logged out every room.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 10:45:21 +09:00
Codex
fdfdd384bf fix: mark untranslated fallbacks and drop English progress text
- When the Korean rewrite errors, the stream ends before it arrives, or a
  final must go out without a result event, append a Korean notice to the
  English text instead of sending it bare (content is kept: dropping a
  NEEDS_CONTEXT question would be worse than English).
- A still-English rewrite is sent unchanged: the nudge tells the model to
  repeat only when the user explicitly asked for English.
- Intermediate progress text cannot be rewritten mid-turn, so English
  progress (>= 20 Latin letters, Hangul < 10%) is dropped before it is
  flushed by tool_progress / tool results / the result event.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 02:11:42 +09:00
Codex
98011e282b fix: rewrite English final answers in Korean before delivery
A sketchup-app turn spent on English login pages (Trimble/Edge) ended
with an English NEEDS_CONTEXT answer. The Korean rule was only a prompt
line, the answer went straight to the user (no reviewer gate), and it was
carried forward into the next task, so the next turn answered in English
too.

- Claude runner: when a final answer is mostly English (Hangul < 10% of
  Latin letters, >= 150 letters, code/links/boilerplate ignored), ask the
  same session once to rewrite it in Korean and emit only the rewrite.
  Falls back to the original on error or early stream end; disabled when
  AGENT_LANGUAGE is set to a non-Korean language.
- Let handleResultMessage settle the buffered final text instead of
  pre-flushing it as progress, so the English draft never surfaces.
- Platform prompt: explicit "Reply language" section; owner rule no longer
  says "unless the user wrote in another language".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 02:07:17 +09:00
Codex
e3308eb119 feat: give owner runs a headless chrome-devtools MCP
Adds chrome-devtools-mcp 1.11.0 to the Claude runner so the owner (or a
single-mode room) can open pages, click/fill, take screenshots and read
console/network errors. Reviewer, arbiter and read-only runtimes do not
get it. Chrome runs headless with an isolated temp profile under TMPDIR,
Google usage statistics and CrUX lookups are off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 12:25:04 +09:00
Codex
1167023a13 fix: cap inline prompt documents, raise Discord upload cap to 10 MiB
joke-app finalize failed with "Prompt is too long (~1.18M tokens)": the
runner inlined a 162-page, 8.3 MB PDF as a base64 document block for every
[Document: ...] reference, and the prompt referenced it twice.

The Claude runner now inlines a document at most once per prompt, only
PDFs up to 20 pages / 10 MiB (512 KiB when the page count is unknown) with
at most 40 PDF pages per prompt, and text documents up to 256 KiB. Larger
ones become a path note telling the agent to use the Read tool.

The same PDF was also rejected as an outbound attachment by our local 8 MiB
cap, although Discord's default per-file limit is now 10 MiB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 13:26:58 +09:00
Codex
7f54c47e64 feat: let the owner skip review for change-free explanation answers
The owner may end a TASK_DONE answer with "리뷰 불필요: <reason>". The
host treats it as a request and honors it only when every guard holds:

- workspace content equals the task base (hasCodeChangesSinceRef), the
  working tree is clean, and HEAD did not move during the owner run
- the run used no file-mutating tool (Edit/Write/MultiEdit/NotebookEdit),
  no subagent (Agent/Task) and no state-changing or unknown MCP tool
- every Bash command is classified read-only by a conservative
  quote-aware classifier (src/bash-command-classifier.ts); anything
  unknown counts as mutating
- tool usage was reported and not truncated (agent-runner now reports
  tool names and Bash commands as toolUsage on its terminal output)
- the user did not ask for a review in this task

When honored the task completes as review_skipped with no reviewer or
finalize turn; the answer is delivered with the marker line removed and a
small "-# 검토 생략 …" note. Otherwise the marker is stripped and the
normal review runs. A bare "검토해줘"-style message right after a
review-skipped answer reopens that task for the reviewer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 20:36:53 +09:00
Codex
8c68577a24 refactor: replace the Claude→Codex failover with a usage-limit notice
When Claude hit a limit the run was handed to a Codex service
(codex-main/codex-review) through service_handoffs and a global owner
failover. That service does not exist in this deployment, so handoffs
stayed pending forever (2 rows since May) and the user got no answer.

Removed:
- handoff creation (message-agent-executor-handoff, paired-turn-fallback)
  and the delegated paired-execution path
- the pending-handoff poll/claim worker (message-runtime-handoffs) and the
  service_handoffs CRUD module (db/service-handoffs, db exports)
- global owner failover in service-routing, its recovery timer in index,
  the dashboard failover line, the codex-review failover prompt pack and
  prompts/codex-review-failover-platform.md
- failoverOwner in RoomRoleContext and the `failover=` ROOM_ROLE field
- OWNER_/REVIEWER_/ARBITER_FALLBACK_ENABLED and FAILOVER_MIN_DURATION_MS
- tests for the removed behaviour

Now, when a Claude run fails with a usage/rate limit (trigger reason
429 or usage-exhausted) the executor closes the open paired task as
completed/claude_usage_limit and sends the room one final notice:
"Claude 사용 한도에 도달했습니다. 21:40에 재개할 수 있습니다." The reset time
comes from the error text (CLI banner "resets 9:40pm (Asia/Seoul)", dated
banners, "try again at ...", ISO timestamps), else from the cached usage
API window at 100%, else "잠시 후 다시 시도해 주세요". Nothing retries
silently; the next user message starts a new task. Other Claude failures
(session failure, org access denied) now end as ordinary run errors.

The service_handoffs table, its columns on paired_turn_attempts and the
migrations stay untouched for the later migration squash; the runtime no
longer reads or writes them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 20:14:48 +09:00
Codex
f127ac7a2b refactor: remove the main room concept
No room has room_settings.is_main = 1, so every main-only path was dead,
and admin work is done from the host shell. Each room's agent may now
only act on its own room:

- IPC: messages/inbound injection only to the source room; schedule,
  update, pause, resume and cancel only for the source room's tasks;
  drop the assign_room and refresh_groups IPC tasks and the deps they
  needed (assignRoom/syncGroups/getAvailableGroups/writeGroupsSnapshot)
- DB/host evidence is always scoped to the source group folder
- runner MCP server: drop the assign_room tool, the target_group_jid
  parameters and the isMain flag; list_tasks shows only the room's tasks
- drop EJCLAW_IS_MAIN, RunnerInput.isMain and AgentInput.isMain; the
  global CLAUDE.md memory is now included for every room
- drop the available_groups.json snapshot (available-groups.ts), the
  inferred restart announcement that only went to the main room, and
  the unused Channel.syncGroups hook
- setup register: drop --is-main; deregister-room: drop the main-room
  refusal and --force, and fix its unknown[] binding type error
- remove the groups/main/ template

The room_settings.is_main column and migrations are untouched; new rows
get the column default (0) and nothing reads it anymore.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 19:37:29 +09:00
Codex
ce4547daa6 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>
2026-10-01 19:26:10 +09:00
Codex
1c0fbaf26a refactor: remove web dashboard, Android app and Glasses UI
WEB_DASHBOARD_ENABLED defaulted to false and was never set, so nothing
served the dashboard. Remove the server/routes, apps/dashboard,
apps/android, the dashboard-only settings modules (settings-store,
settings-store-moa, room-skill-settings, runtime-inventory,
codex-live-status, settings-effort), WEB_DASHBOARD_* config, the
web-dashboard-only startup mode, dashboard/android scripts and the
react/vite/playwright dependencies.

The Codex account refresh loop in settings-store is dropped with it: it
refreshed account index 0 through the shared ~/.codex/auth.json instead
of the isolated ~/.codex-accounts/0 used by the reviewer.

Host evidence loses the dashboard_dist / android_debug_apk artifact
kinds. The Discord status dashboard is unchanged. Room skill overrides
are still read from the DB by agent-runner.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 18:47:55 +09:00
Codex
a7f2e02699 chore: upgrade @openai/codex 0.133.0 -> 0.159.3
The reviewer's Codex app-server logged "failed to refresh available models:
failed to decode models response: unknown variant `max`" on every run: the
server now advertises a `max` reasoning effort the old CLI cannot parse. Each
failure also dumped the whole models payload (instruction templates included)
into the service journal.

The pin was misleading: codex-runner actually resolved an untracked stale
runners/codex-runner/node_modules/@openai/codex 0.124.0 from 2026-04-26 that
shadowed the root workspace copy, so earlier version bumps never reached the
runner. That nested copy (not in bun.lock, gitignored) was removed on the host
so the runner resolves the lockfile-managed root install.

End-to-end check through the real CodexAppServerClient with the reviewer's
account: thread start, turn, goal set/get, close and thread resume with context
retained all succeed, with 0 app-server errors (was 2 per run) and a simple
turn taking 5s instead of 49s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 14:25:36 +09:00
Codex
8b688853cc chore: upgrade claude-agent-sdk 0.3.153 -> 0.3.286 for Opus 5.5
Claude Opus 5.5 (claude-opus-5-5) is rejected by the bundled Claude Code CLI
2.1.153 with "does not support this model; version 2.1.280 or newer is
required". Bumping the SDK brings the bundled CLI to 2.1.286.

Verified end-to-end against EJClaw's own credentials through the real SDK and
binary: claude-opus-5-5 returned a normal completion after the upgrade (it
errored with the 400 before), and claude-opus-5 still works.

The model switch itself lives in .env (untracked): CLAUDE_MODEL=claude-opus-5-5.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-10-01 14:09:41 +09:00
Codex
8349a020ce Add humanize-korean skill (bundled from im-not-ai, MIT)
Self-contained single-call Korean AI-tell humanizer skill for EJClaw's
runner-skill sync. Derived from epoko77-ai/im-not-ai @0ac1e84 (MIT):
adapted the codex single-call path to return the rewrite inline in chat,
bundled only the 3 rulebooks it reads, and made reference paths runtime
-neutral (Claude + Codex). Includes upstream LICENSE + NOTICE for MIT
attribution. No external/paid API — runs on the session model only.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-08-23 22:19:45 +09:00
Codex
f9b1e74838 fix(rooms): default new rooms to tribunal when room_mode is omitted
assign_room (MCP tool + host-side assignRoomInDatabase) and setup
register previously fell back to 'single' when no room_mode was given,
so newly added rooms silently lost the reviewer. Default to 'tribunal'
across the MCP zod schema, the IPC arg fallback, and the DB helper, and
update the ipc-auth expectation accordingly.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-19 00:00:20 +09:00
Eyejoker
f1679ac686 [codex] Remove Codex SDK canary runtime (#220)
* Revert "fix: drain sdk follow-up turns (#219)"

This reverts commit 807828e0ce.

* Revert "feat: feature-flag Codex SDK runner (#218)"

This reverts commit 879d16235f.
2026-06-03 19:10:53 +08:00
Eyejoker
879d16235f feat: feature-flag Codex SDK runner (#218)
Add optional @openai/codex-sdk exec-backed runner mode behind CODEX_RUNTIME=sdk, with CODEX_RUNTIME_SDK_ROLES canary limiting and app-server fallback for unsupported flows.
2026-06-03 15:31:06 +08:00
Eyejoker
22602da1ec fix: reduce global eslint warnings (#216) 2026-06-03 08:30:21 +08:00
Eyejoker
1ff6b3434f fix: ignore attachment syntax examples (#206) 2026-05-31 22:44:42 +09:00
Eyejoker
b6e7e060cc fix: load supported document attachments (#205) 2026-05-31 22:30:49 +09:00
Eyejoker
778ed9b94a fix: preserve paired input evidence context (#204) 2026-05-31 17:17:38 +09:00
Eyejoker
c0703836e1 fix: surface remaining paired evidence loss (#203) 2026-05-31 16:57:49 +09:00
Eyejoker
239c7ff1e6 fix: make paired evidence loss visible (#202) 2026-05-31 16:20:09 +09:00
Eyejoker
6eca648c47 fix: carry paired turn attachments into review context (#201) 2026-05-31 14:49:56 +09:00
Eyejoker
37b57b20bb refactor: centralize task runtime contracts (#199) 2026-05-30 01:56:41 +09:00
Eyejoker
1531482363 refactor: split Claude agent runner entrypoint (#200) 2026-05-30 01:47:41 +09:00
Eyejoker
35988d9797 fix: use workspace links for runner shared package (#198) 2026-05-30 00:30:31 +09:00
Eyejoker
46b5543cb5 refactor: centralize host evidence actions (#194) 2026-05-30 00:08:28 +09:00
Eyejoker
adf9c16b9a refactor: centralize paired room role normalization (#193) 2026-05-30 00:03:15 +09:00
Eyejoker
fb87e94c5a refactor: centralize EJClaw runtime env names (#192) 2026-05-29 22:00:15 +09:00
Eyejoker
0377935564 feat: add reviewer evidence presets (#184) 2026-05-29 05:38:31 +09:00
Eyejoker
6b51315eb1 chore: update Claude agent SDK 2026-05-29 03:56:19 +09:00
ejclaw
e8a9239971 feat: add GitHub step evidence presets 2026-05-28 17:07:30 +09:00
ejclaw
df6ec5f2b2 feat: add MEDIA outbound attachment directive 2026-05-26 17:26:20 +09:00
ejclaw
a6e1b8172c fix: route scheduled watcher output by room role 2026-05-26 04:17:59 +09:00
ejclaw
c4c590ec9b feat: add verification evidence presets 2026-05-26 02:04:04 +09:00
ejclaw
48ee682b3e feat: add repo evidence mcp tool 2026-05-26 01:20:14 +09:00
ejclaw
db5332e81a fix: refresh role rules after compaction 2026-05-25 22:57:52 +09:00
Eyejoker
763828e4f5 fix: load ejclaw mcp tools on claude first turn 2026-05-23 09:30:06 +09:00
Eyejoker
262534cac9 chore: upgrade claude agent sdk (#150) 2026-05-23 09:09:32 +09:00
Eyejoker
dd6cb3c220 chore: upgrade codex runner sdk (#149) 2026-05-23 09:07:30 +09:00
Eyejoker
d3c02265e5 Normalize agent attachment output (#122) 2026-05-02 19:50:32 +09:00
Eyejoker
9e45534de0 Support status-prefixed structured attachments
Support status-prefixed structured attachment output and keep visible verdict text.
2026-05-02 19:22:55 +09:00
Eyejoker
7576bcd3ff Update agent SDKs and add gated Codex goals support (#114)
* add gated codex goals support

* sync README SDK versions

* bump claude agent sdk

* add codex goals settings toggle
2026-05-02 01:42:04 +09:00
ejclaw
933db6fa1c fix agent-browser skill command examples 2026-04-29 21:26:33 +09:00
ejclaw
4dcd4037f1 chore: clear low-risk lint warnings 2026-04-29 13:31:11 +09:00
Eyejoker
8bb77ffaa3 Fix structured IPC envelope leakage
Normalize EJClaw structured send_message envelopes, preserve attachments, unwrap stored room payloads, and add regression tests.
2026-04-28 01:35:26 +09:00
Eyejoker
d52556fd28 fix: preserve structured attachment outputs (#17) 2026-04-25 14:41:46 +09:00
ejclaw
cd7e35a8b0 Parse fenced EJClaw output envelopes 2026-04-25 10:14:33 +09:00