refactor: remove Mixture of Agents and Kimi usage
MOA_* was never configured, so enrichArbiterPromptWithMoa always returned the prompt unchanged and the Kimi usage fetch only produced an empty dashboard row. Remove src/moa.ts, src/kimi-usage.ts, the arbiter prompt enrichment, MoA config/schema, the Kimi row and MoA line in the Discord status dashboard, and the MOA_* / unused FALLBACK_* provider examples from the docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,16 +1,12 @@
|
||||
import { AgentOutput } from './agent-runner.js';
|
||||
import { GroupQueue } from './group-queue.js';
|
||||
import type { Logger } from 'pino';
|
||||
import type { AgentTriggerReason } from './agent-error-detection.js';
|
||||
import { getMoaConfig } from './config.js';
|
||||
import { createPairedExecutionLifecycle } from './message-agent-executor-paired.js';
|
||||
import type { PairedTurnIdentity } from './paired-turn-identity.js';
|
||||
import { executeMessageAgentAttemptLifecycle } from './message-agent-executor-lifecycle.js';
|
||||
import { runMessageAgentAttempt } from './message-agent-executor-attempt-runner.js';
|
||||
import { handoffMessageAgentExecutionToCodex } from './message-agent-executor-handoff.js';
|
||||
import { prepareMessageAgentExecutionTarget } from './message-agent-executor-target.js';
|
||||
import { collectMoaReferences, formatMoaReferencesForPrompt } from './moa.js';
|
||||
import { readArbiterPrompt } from './platform-prompts.js';
|
||||
import { shouldRetryFreshSessionOnAgentFailure } from './session-recovery.js';
|
||||
import type { AgentType, PairedRoomRole, RegisteredGroup } from './types.js';
|
||||
import {
|
||||
@@ -51,44 +47,6 @@ function clearAppliedCompactRefreshAfterSuccess(args: {
|
||||
});
|
||||
}
|
||||
|
||||
async function enrichArbiterPromptWithMoa(args: {
|
||||
prompt: string;
|
||||
enabled: boolean;
|
||||
log: Pick<Logger, 'info' | 'warn'>;
|
||||
}): Promise<string> {
|
||||
const moaConfig = getMoaConfig();
|
||||
if (!args.enabled || !moaConfig.enabled) return args.prompt;
|
||||
args.log.info(
|
||||
{ models: moaConfig.referenceModels.map((m) => m.name) },
|
||||
'MoA: collecting reference opinions before arbiter',
|
||||
);
|
||||
const systemPrompt =
|
||||
readArbiterPrompt(process.cwd()) || 'You are an arbiter.';
|
||||
try {
|
||||
const references = await collectMoaReferences({
|
||||
config: moaConfig,
|
||||
systemPrompt,
|
||||
contextPrompt: args.prompt,
|
||||
});
|
||||
const moaSection = formatMoaReferencesForPrompt(references);
|
||||
if (!moaSection) return args.prompt;
|
||||
args.log.info(
|
||||
{
|
||||
successCount: references.filter((r) => !r.error).length,
|
||||
totalCount: references.length,
|
||||
},
|
||||
'MoA: injected reference opinions into arbiter prompt',
|
||||
);
|
||||
return args.prompt + '\n' + moaSection;
|
||||
} catch (err) {
|
||||
args.log.warn(
|
||||
{ err, models: moaConfig.referenceModels.map((m) => m.name) },
|
||||
'MoA: failed to collect reference opinions; continuing without enrichment',
|
||||
);
|
||||
return args.prompt;
|
||||
}
|
||||
}
|
||||
|
||||
export interface MessageAgentExecutorDeps {
|
||||
assistantName: string;
|
||||
queue: Pick<GroupQueue, 'registerProcess' | 'enqueueMessageCheck'> &
|
||||
@@ -140,7 +98,6 @@ export async function runAgentForGroup(
|
||||
effectiveServiceId,
|
||||
effectiveAgentType,
|
||||
sessionFolder,
|
||||
arbiterMode,
|
||||
effectiveGroup,
|
||||
isClaudeCodeAgent,
|
||||
forceFreshClaudeReviewerSession,
|
||||
@@ -160,14 +117,8 @@ export async function runAgentForGroup(
|
||||
clearRoleSdkSessions();
|
||||
}
|
||||
|
||||
const moaEnrichedPrompt = await enrichArbiterPromptWithMoa({
|
||||
prompt,
|
||||
enabled: arbiterMode && Boolean(pairedExecutionContext),
|
||||
log,
|
||||
});
|
||||
|
||||
const { effectivePrompt, compactRefresh } = buildPromptWithCompactRefresh({
|
||||
prompt: moaEnrichedPrompt,
|
||||
prompt,
|
||||
sessionFolder,
|
||||
sessionId: currentSessionId,
|
||||
role: activeRole,
|
||||
|
||||
Reference in New Issue
Block a user