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
This commit is contained in:
Eyejoker
2026-04-01 03:59:47 +09:00
parent 0bcfcb27fe
commit cb0d294941
18 changed files with 1309 additions and 422 deletions

View File

@@ -525,6 +525,30 @@ export function completePairedExecutionContext(args: {
: null;
if (hasNewChanges === true) {
if (task.round_trip_count >= ARBITER_DEADLOCK_THRESHOLD) {
if (isArbiterEnabled()) {
updatePairedTask(taskId, {
status: 'arbiter_requested',
arbiter_requested_at: now,
updated_at: now,
});
logger.info(
{ taskId, roundTrips: task.round_trip_count, hasNewChanges },
'Owner finalize DONE loop detected — requesting arbiter',
);
} else {
updatePairedTask(taskId, {
status: 'completed',
completion_reason: 'escalated',
updated_at: now,
});
logger.info(
{ taskId, roundTrips: task.round_trip_count, hasNewChanges },
'Owner finalize DONE loop detected — escalating to user',
);
}
return;
}
// Owner made changes after approval → needs re-review
logger.info(
{