Commit Graph

672 Commits

Author SHA1 Message Date
Eyejoker
3dd772c229 Refactor local memory and role-fixed runtime routing 2026-04-04 03:50:28 +09:00
Eyejoker
74ff662026 feat: mount owner session directory read-only in reviewer container
Allows reviewer to verify runtime state files (cron state, configs)
that the owner references by absolute host path. Mounted at the same
host path so absolute path references work inside the container.
2026-04-01 13:47:34 +09:00
Eyejoker
59cf931b82 fix: copy arbiter AGENTS.md to reviewer session for container mount
Container's /home/node/.claude always mounts the reviewer session dir.
When arbiter runs codex in the same container, CODEX_HOME reads from
reviewer session's .codex/. Copy arbiter AGENTS.md there so codex gets
arbiter prompts instead of reviewer prompts.
2026-04-01 13:34:46 +09:00
Eyejoker
fad3ce3bdf fix: inject role prompts into AGENTS.md for codex container reviewer
prepareContainerSessionEnvironment now writes AGENTS.md (with platform
+ paired-room prompts) to a session-local .codex/ dir alongside auth
credentials from host. CODEX_HOME points to this dir so codex-runner
gets role-appropriate prompts instead of empty instructions.
2026-04-01 06:00:26 +09:00
Eyejoker
671eb18252 fix: route reviewer failover through reviewer bot, not arbiter bot
Reviewer handoff channel was based on target_agent_type (codex →
discord-review/arbiter bot). Now uses REVIEWER_AGENT_TYPE like the
normal reviewer path — role determines the bot, not the fallback type.
2026-04-01 05:37:56 +09:00
Eyejoker
bfd781c552 fix: skip role model override on failover handoffs
When forcedAgentType is set (failover), the role's configured model
(e.g. claude-opus-4-6 for reviewer) was injected as CODEX_MODEL,
causing codex SDK to reject it. Now model overrides are only injected
for the primary agent type, not failover runs.
2026-04-01 05:31:02 +09:00
Eyejoker
9b71bc5878 debug: log container runner selection 2026-04-01 05:25:47 +09:00
Eyejoker
df6298f340 fix: exclude model env from container creation, inject per-exec only
Model/effort keys (CLAUDE_MODEL, CODEX_MODEL, etc.) are now excluded
from docker run creation args and only injected at docker exec time
matching the active agent type. Removes the empty-value override hack.
2026-04-01 05:22:20 +09:00
Eyejoker
a648a08bf0 fix: clear CLAUDE_MODEL env on codex container exec
Container-level env has CLAUDE_MODEL baked in from creation.
Explicitly clear it on docker exec when running codex agent
to prevent 'model not supported with ChatGPT account' errors.
2026-04-01 05:20:55 +09:00
Eyejoker
7c9050ba9f fix: only inject matching model env vars for container agent type
When codex runs in container, skip CLAUDE_MODEL/EFFORT to prevent
'claude-opus-4-6 not supported with ChatGPT account' errors.
2026-04-01 05:18:10 +09:00
Eyejoker
5420fa2ee8 fix: handoff to codex on persistent session failure
When Claude reviewer hits retryable session failure twice, hand off
to codex instead of silently failing. Adds 'session-failure' to
AgentTriggerReason and shouldHandoffToCodex check.
2026-04-01 05:15:24 +09:00
Eyejoker
f4410be779 fix: show only fallback model when failover is active 2026-04-01 05:04:04 +09:00
Eyejoker
5a109e3717 feat: show fallback model in status dashboard
When global failover is active, claude-code roles now display
the fallback model inline: `claude-opus-4-6 (fallback → codex)`
2026-04-01 05:03:29 +09:00
Eyejoker
6e81bdc215 fix: mount codex OAuth credentials into reviewer container
Mount host's ~/.codex (read-only) into container so codex-runner
can authenticate via ChatGPT OAuth. Set CODEX_HOME env on exec.
2026-04-01 05:01:44 +09:00
Eyejoker
404cbd6b04 feat: support codex runner in reviewer container
- Build both agent-runner and codex-runner into container image
- Select runner path based on group.agentType at docker exec time
- Update README to role-centric overview, generic MoA references
- Add MoA reference opinions guidance to arbiter prompt
2026-04-01 04:50:05 +09:00
Eyejoker
73156bf375 fix: only count final-phase output as visible for handoff decisions
Progress messages (phase: 'progress') were setting sawVisibleOutput=true,
which blocked failover handoffs when Claude usage was exhausted. Now only
final-phase output counts as visible, allowing reviewer handoff to codex
even after progress messages were shown.
2026-04-01 04:18:15 +09:00
Eyejoker
cb0d294941 feat: honor handoff agent type + local memory store
- fix: pass forcedRole/forcedAgentType through handoff execution chain
  so reviewer failover actually runs codex instead of retrying Claude
- fix: preserve intended_role in service handoff records
- feat: replace Memento MCP with local SQLite memory store
- feat: add memory selection with TTL decay
2026-04-01 03:59:47 +09:00
Eyejoker
ca58e8c8eb fix: honor handoff agent type during failover 2026-04-01 03:13:05 +09:00
Eyejoker
60f360b5ea fix: preserve handoff roles during failover 2026-04-01 02:54:35 +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
42ed5ef113 feat: add local SQLite memory store 2026-03-31 23:22:46 +09:00
Eyejoker
e730fea230 refactor: prefer room_settings over registered_groups in runtime reads 2026-03-31 22:35:50 +09:00
Eyejoker
1f1842773e refactor: internalize setRegisteredGroup export 2026-03-31 22:35:50 +09:00
Eyejoker
c590fdaaa3 refactor: prefer room_settings over registered_groups in runtime reads 2026-03-31 22:27:36 +09:00
Eyejoker
35a59218d5 refactor: internalize setRegisteredGroup export 2026-03-31 22:27:17 +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
1fccc37fe8 refactor: read default room owner from room settings 2026-03-31 20:48:30 +09:00
Eyejoker
fc4eaefeda feat: backfill room-level settings snapshot 2026-03-31 20:39:45 +09:00
Eyejoker
0a41d9ea3b refactor: remove paired room legacy helper 2026-03-31 20:18:37 +09:00
Eyejoker
141898f764 refactor: scope runtime log context 2026-03-31 17:23:43 +09:00
Eyejoker
509e4c24a3 refactor: cut over room mode from paired legacy 2026-03-31 14:47:59 +09:00
Eyejoker
f04e5d06b3 test: align paired prompt expectation with AGENT_LANGUAGE 2026-03-31 14:13:43 +09:00
Eyejoker
2107e033b7 Merge branch 'codex/room-mode-paired-source' 2026-03-31 14:12:44 +09:00
Eyejoker
356cf2fa99 style: apply prettier formatting 2026-03-31 14:02:01 +09:00
Eyejoker
1c87616c44 fix: support same-service tribunal runtime 2026-03-31 14:01:31 +09:00
Eyejoker
757e33c58e fix: prevent DONE↔DONE infinite loop and add AGENT_LANGUAGE setting
- Fix source_ref mismatch: update to workspace HEAD on first owner run
  so change detection compares against the correct repo
- Treat hasNewChanges === null as "no changes" at finalize to prevent
  infinite re-review when source_ref is unresolvable
- Add AGENT_LANGUAGE env var: when set, appends language instruction to
  all paired room prompts (owner, reviewer, arbiter)
2026-03-31 13:55:41 +09:00
Eyejoker
47d532e869 fix: sync refreshed OAuth tokens to process.env for container exec
Token refresh updated internal array and .env file but not process.env,
so docker exec -e kept injecting the stale startup token. Now syncs
to process.env after refresh. Container kill on refresh is no longer
needed since docker exec picks up the latest token each turn.
2026-03-31 13:34:23 +09:00
Eyejoker
236f7c2fea fix: gate paired runtime on dual registrations 2026-03-31 12:14:24 +09:00
Eyejoker
89335ab005 refactor: drive paired routing from room mode 2026-03-31 12:10:00 +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
a39dad4c8c refactor: add role agent plan ssot 2026-03-31 09:41:40 +09:00
Eyejoker
dd28ac6223 fix: fallback to proceed on unrecognized arbiter verdict
Previously unknown verdicts caused arbiter_escalated (task terminated).
Now falls back to proceed so the loop continues — a parse failure
should not kill the task.
2026-03-31 09:03:20 +09:00
Eyejoker
94184c137d fix: parse arbiter verdict with optional VERDICT: prefix
Codex arbiter sometimes outputs "VERDICT: PROCEED" instead of
"PROCEED". The regex now handles optional "VERDICT:" prefix,
preventing unknown verdict → false arbiter_escalated.
2026-03-31 08:51:01 +09:00
Eyejoker
33dd8ea54a style: format room mode helpers 2026-03-31 08:15:47 +09:00
Eyejoker
99fe4243bf refactor: add explicit room mode ssot helpers 2026-03-31 08:15:47 +09:00
Eyejoker
4aef48f3ba fix: fallback to default arbiter_service_id in explicit channel leases
Explicit leases created by failover didn't include arbiter_service_id,
causing arbiter verdict to never be saved (pairedExecutionContext was
undefined). Now falls back to ARBITER_SERVICE_ID from config when the
stored lease has null arbiter_service_id.
2026-03-31 07:45:52 +09:00
Eyejoker
aad1e93df5 refactor: separate scheduler tick execution path 2026-03-31 07:26:21 +09:00