Commit Graph

653 Commits

Author SHA1 Message Date
Eyejoker
9e091df6f6 fix: scan all Codex limits for max 5h/7d, persist d7 reset times
- Iterate all rate limits per account instead of just display[0]
- Track and persist 7-day reset time separately (resetD7At)
- Show both 5h and 7d cached usage for inactive Codex accounts
2026-03-24 01:28:48 +09:00
Eyejoker
c7a3a56386 feat: scan all Codex accounts on startup + hourly, cache 5h/7d usage
- Scan all Codex accounts by spawning app-server with each auth dir
- Cache primary (5h) and secondary (7d) usage per account
- Show cached usage + reset remaining time on dashboard
- Persist d7 usage in rotation state file
- formatResetRemaining: "Xh Ym 후" / "N일 후" format
- Remove isRateLimited guard for cached display
2026-03-24 01:25:02 +09:00
Eyejoker
60dab43a3f feat: parse retry-after from errors, cache codex usage per account
- Parse "try again at" time from rate-limit errors instead of
  fixed 1-hour cooldown, with 3-min buffer after reset
- Pass error message to rotateToken/rotateCodexToken for parsing
- Cache usage % and reset time per Codex account for dashboard
- Persist cached usage in rotation state file across restarts
- Show rate-limited Codex accounts with cached 100% + reset time
- Fix dashboard text indicators (*!/space) for monospace alignment
2026-03-24 01:16:54 +09:00
Eyejoker
2e6fc4a08e fix: add warn log for usage content build failures 2026-03-23 23:18:47 +09:00
Eyejoker
7401626356 feat: persist rotation state across restarts, fix dashboard alignment
- Save currentIndex + rateLimits to JSON file in DATA_DIR
- Restore on startup so rotation survives service restarts
- Replace emoji indicators with text (*/!) for monospace alignment
- Dynamic column width based on longest name
- Show Codex accounts with plan type on dashboard
2026-03-23 23:16:54 +09:00
Eyejoker
30be180f4b fix: codex rate-limit retry immediately instead of next request 2026-03-23 23:07:35 +09:00
Eyejoker
816b0a39cc feat: Codex account rotation + fix rate-limit detection
- New codex-token-rotation module: rotates between multiple
  ~/.codex-accounts/{n}/auth.json on rate-limit
- Copies active account auth to session dir before each spawn
- Fix detectFallbackTrigger to match "usage limit" / "hit your limit"
- Fix streamed error detection: remove claude-only guard so codex
  rate-limit errors are caught even when output.status is "success"
- Add rotation in both task-scheduler and message-agent-executor
2026-03-23 23:06:17 +09:00
Eyejoker
0b86f937f4 fix: read tokens from .env file, clean up debug logs
- token-rotation reads from readEnvFile() (systemd doesn't load .env)
- fetchAllClaudeUsage polling log demoted to debug level
- Remove verbose dashboard send/create logs
2026-03-23 22:41:07 +09:00
Eyejoker
83b25fb7bd feat: Claude usage API + multi-account dashboard display
- Replace expect/CLI hack with direct HTTP API call
  (GET api.anthropic.com/api/oauth/usage with OAuth token)
- Add fetchAllClaudeUsage() for per-token usage fetching
- Export getAllTokens() from token-rotation for usage queries
- Dashboard shows each account separately (Claude1, Claude2)
  with  for active token, 🚫 for rate-limited
2026-03-23 22:15:06 +09:00
Eyejoker
d378598f2e feat: Claude OAuth token rotation on rate-limit
- New token-rotation module: stores multiple tokens from
  CLAUDE_CODE_OAUTH_TOKENS env var (comma-separated)
- On rate-limit, rotates to next healthy token before falling
  back to Kimi provider
- Also fixes: intermediate text routes to progress message
  when no subagents active (prevents message flooding)
2026-03-23 22:01:06 +09:00
Eyejoker
2161b555ec fix: dedup intermediate/final, filter long descriptions, update SDKs
- Track lastIntermediateText to prevent duplicate Discord delivery
  when same text arrives as both intermediate and final
- Filter task_progress descriptions >80 chars (AI summaries)
- Mark completed subagents with  instead of removing
- Update claude-agent-sdk 0.2.76→0.2.81, codex 0.115→0.116
2026-03-23 20:16:54 +09:00
Eyejoker
21a6be84b4 feat: multi-agent progress tracking with per-subagent display
Track each subagent separately via agentId from SDK task events.
Single subagent shows detailed view with activity sub-lines,
multiple subagents show compact one-line-each format.
2026-03-23 19:46:08 +09:00
Eyejoker
8c98ad9faf fix: intermediate text as standalone messages, preserve progress
Add 'intermediate' phase for assistant text between tool calls.
These are sent as separate Discord messages without finalizing
or disrupting the active progress message.
2026-03-23 19:29:16 +09:00
Eyejoker
be9dfa64b0 fix: deduplicate progress at runner level, not host revert
Buffer intermediate assistant text in the runner. When result arrives
with matching text, discard the buffered progress instead of emitting
it. This prevents the duplicate from ever reaching Discord, eliminating
the flash-then-revert behavior.
2026-03-23 19:22:14 +09:00
Eyejoker
83df0e7dc1 fix: use task_started description as immediate heading, dedupe final
- Show subagent description from task_started immediately (no 30s wait)
- Remove AI summary (agentProgressSummaries) — task_started is sufficient
- Revert progress heading to previous when final text matches current
- Track previousProgressText in direct-update path
2026-03-23 19:20:23 +09:00
Eyejoker
a8a1c9b45a fix: throttle progress edits via 5s ticker, prevent Discord rate limit
- Remove per-tool-activity sync calls (was flooding Discord with edits)
- Ticker-only sync at 5s intervals for time + tool activity updates
- Summary updates heading directly when progress message exists
- Prevent duplicate progress message creation with progressCreating flag
2026-03-23 19:13:51 +09:00
Eyejoker
5112af6741 fix: progress ticker on tool-activity, last-line └, summary+description both shown
- Ensure progressTicker runs during tool-activity updates for time refresh
- Last activity line uses └ instead of ├
- Summary (📋) and description shown together when both present
- Description indented as sub-item under summary
2026-03-23 18:52:17 +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
ac11cb7df1 feat: show tool activity sub-lines in progress messages
Display subagent tool descriptions as sub-lines under the main
progress text, updating in-place via Discord message edit.
Shows up to 5 recent tool activities (e.g., "Reading index.ts").
2026-03-23 18:31:20 +09:00
Eyejoker
bf1453541f fix: buffer progress to prevent final-like text from showing
Progress updates are now buffered: each new progress flushes the
previous one. The latest pending progress is discarded when final
arrives with matching text, preventing duplicate display in Discord.
2026-03-23 18:23:46 +09:00
Eyejoker
08a560f144 fix: revert progress to previous text when final matches last progress
When the final result text is identical to the last progress update,
edit the progress message back to the previous progress text to avoid
showing the same content twice in Discord.
2026-03-23 18:06:17 +09:00
Eyejoker
0438d9113b fix: clean up progress tracking, fix subagent summary field handling
- Use system/task_progress subtype (not top-level type) for subagent events
- Extract intermediate assistant text between tool calls as progress
- Only show SDK-generated summaries for subagent progress (skip noisy per-tool updates)
- Truncate progress messages to Discord 2000 char limit
- Remove verbose debug logging from production
2026-03-23 17:59:49 +09:00
Eyejoker
77e79505eb feat: auto-suspend tasks on quota errors, add Claude progress tracking
- Auto-suspend tasks after 3 consecutive quota/auth errors with
  retry-after date parsing and Discord notification
- Add tool_progress and tool_use_summary streaming from Claude Agent SDK
- Prefix progress messages with invisible marker so bots ignore them
- Fix misleading provider label in codex service logs
2026-03-23 17:03:17 +09:00
Eyejoker
42d721a9ec fix claude turn teardown and start CI watchers immediately 2026-03-23 08:55:48 +09:00
Eyejoker
7100a13b39 style: normalize rebrand test formatting 2026-03-23 08:09:32 +09:00
Eyejoker
d28b6151a8 chore: rebrand runtime and docs to EJClaw 2026-03-23 08:09:15 +09:00
Eyejoker
d3833eb20d style: format agent runner imports 2026-03-23 07:31:26 +09:00
Eyejoker
f42234bc65 refactor: split runner env and slim dashboard facade 2026-03-23 07:30:55 +09:00
Eyejoker
50e8fd4d20 fix: reserve queue capacity for chat runs 2026-03-23 07:21:58 +09:00
Eyejoker
f5eae07657 fix: use resolved ipc dirs for recovery flow 2026-03-23 07:18:47 +09:00
Eyejoker
9def49f7fb fix: isolate watcher task runtimes 2026-03-23 07:16:07 +09:00
Eyejoker
867a6a80ef style: format extracted helpers 2026-03-23 07:00:22 +09:00
Eyejoker
a2db8f6c0e refactor: extract dashboard and task helpers 2026-03-23 06:59:59 +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
Eyejoker
ff1d2c76d4 style: format group queue test 2026-03-23 05:55:21 +09:00
Eyejoker
2c37103243 refactor: restore pre-v1 runtime follow-up flow 2026-03-23 05:54:48 +09:00
Eyejoker
77a7918063 fix: restore implicit follow-up continuation 2026-03-23 05:46:37 +09:00
Eyejoker
4df30a9b9b fix: keep ci watchers off the chat queue 2026-03-23 05:40:31 +09:00
Eyejoker
25b1d702dd style: format isolated task queue scheduling 2026-03-23 05:31:11 +09:00
Eyejoker
2eebe3c7f4 fix: prevent isolated watchers from blocking chat 2026-03-23 05:30:58 +09:00
Eyejoker
cad6ec309c style: format watcher elapsed helper 2026-03-23 05:23:12 +09:00
Eyejoker
127eacb564 fix: restore watcher elapsed status updates 2026-03-23 05:22:52 +09:00
Eyejoker
7c6019dea3 refactor: drop idle queue state 2026-03-23 04:57:13 +09:00
Eyejoker
02408aae8e refactor: make runners single-turn 2026-03-23 04:51:54 +09:00
Eyejoker
83d7bf3d51 feat: merge per-group codex config overlay 2026-03-23 04:20:55 +09:00
Eyejoker
f49d0f1732 fix: restore mentionless paired room bot flow 2026-03-23 04:18:44 +09:00