Format files touched by reviewer runtime cleanup
This commit is contained in:
@@ -105,10 +105,7 @@ vi.mock('child_process', async () => {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
import {
|
import { runAgentProcess, AgentOutput } from './agent-runner.js';
|
||||||
runAgentProcess,
|
|
||||||
AgentOutput,
|
|
||||||
} from './agent-runner.js';
|
|
||||||
import * as agentRunnerEnvironment from './agent-runner-environment.js';
|
import * as agentRunnerEnvironment from './agent-runner-environment.js';
|
||||||
import type { RegisteredGroup } from './types.js';
|
import type { RegisteredGroup } from './types.js';
|
||||||
|
|
||||||
@@ -681,5 +678,4 @@ OUROBOROS_LLM_BACKEND = "codex"
|
|||||||
expect.objectContaining({ newSessionId: 'stale-session' }),
|
expect.objectContaining({ newSessionId: 'stale-session' }),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -71,7 +71,10 @@ import { Channel, NewMessage, RegisteredGroup } from './types.js';
|
|||||||
import { logger } from './logger.js';
|
import { logger } from './logger.js';
|
||||||
import { normalizeStoredSeqCursor } from './message-cursor.js';
|
import { normalizeStoredSeqCursor } from './message-cursor.js';
|
||||||
import { initCodexTokenRotation } from './codex-token-rotation.js';
|
import { initCodexTokenRotation } from './codex-token-rotation.js';
|
||||||
import { hasAvailableClaudeToken, initTokenRotation } from './token-rotation.js';
|
import {
|
||||||
|
hasAvailableClaudeToken,
|
||||||
|
initTokenRotation,
|
||||||
|
} from './token-rotation.js';
|
||||||
|
|
||||||
function isTerminalStatusMessage(text: string): boolean {
|
function isTerminalStatusMessage(text: string): boolean {
|
||||||
const trimmed = text.trimStart();
|
const trimmed = text.trimStart();
|
||||||
|
|||||||
@@ -1697,7 +1697,9 @@ describe('runAgentForGroup Claude rotation', () => {
|
|||||||
vi.mocked(agentRunner.runAgentProcess)
|
vi.mocked(agentRunner.runAgentProcess)
|
||||||
.mockImplementationOnce(async (_group, input) => {
|
.mockImplementationOnce(async (_group, input) => {
|
||||||
expect(input.sessionId).toBe('stale-session-id');
|
expect(input.sessionId).toBe('stale-session-id');
|
||||||
throw new Error('No conversation found with session ID: stale-session-id');
|
throw new Error(
|
||||||
|
'No conversation found with session ID: stale-session-id',
|
||||||
|
);
|
||||||
})
|
})
|
||||||
.mockImplementationOnce(async (_group, input, _onProcess, onOutput) => {
|
.mockImplementationOnce(async (_group, input, _onProcess, onOutput) => {
|
||||||
expect(input.sessionId).toBeUndefined();
|
expect(input.sessionId).toBeUndefined();
|
||||||
|
|||||||
@@ -480,7 +480,8 @@ export async function runAgentForGroup(
|
|||||||
sawVisibleOutput: false,
|
sawVisibleOutput: false,
|
||||||
sawSuccessNullResultWithoutOutput: false,
|
sawSuccessNullResultWithoutOutput: false,
|
||||||
};
|
};
|
||||||
const attemptSessionId = provider === 'claude' ? currentSessionId : undefined;
|
const attemptSessionId =
|
||||||
|
provider === 'claude' ? currentSessionId : undefined;
|
||||||
|
|
||||||
const wrappedOnOutput = onOutput
|
const wrappedOnOutput = onOutput
|
||||||
? async (output: AgentOutput) => {
|
? async (output: AgentOutput) => {
|
||||||
|
|||||||
@@ -1880,7 +1880,9 @@ describe('createMessageRuntime', () => {
|
|||||||
]);
|
]);
|
||||||
vi.mocked(agentRunner.runAgentProcess).mockImplementation(
|
vi.mocked(agentRunner.runAgentProcess).mockImplementation(
|
||||||
async (_group, input, _onProcess, onOutput) => {
|
async (_group, input, _onProcess, onOutput) => {
|
||||||
expect(input.prompt).toContain('paired_turn_outputs 에 저장된 reviewer 요약');
|
expect(input.prompt).toContain(
|
||||||
|
'paired_turn_outputs 에 저장된 reviewer 요약',
|
||||||
|
);
|
||||||
expect(input.prompt).not.toContain('리뷰어 디스코드 출력 원문');
|
expect(input.prompt).not.toContain('리뷰어 디스코드 출력 원문');
|
||||||
await onOutput?.({
|
await onOutput?.({
|
||||||
status: 'success',
|
status: 'success',
|
||||||
@@ -1925,7 +1927,10 @@ describe('createMessageRuntime', () => {
|
|||||||
|
|
||||||
expect(result).toBe(true);
|
expect(result).toBe(true);
|
||||||
expect(agentRunner.runAgentProcess).toHaveBeenCalledTimes(1);
|
expect(agentRunner.runAgentProcess).toHaveBeenCalledTimes(1);
|
||||||
expect(channel.sendMessage).toHaveBeenCalledWith(chatJid, 'owner follow-up ok');
|
expect(channel.sendMessage).toHaveBeenCalledWith(
|
||||||
|
chatJid,
|
||||||
|
'owner follow-up ok',
|
||||||
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('reuses the shared arbiter prompt builder for pending arbiter turns', async () => {
|
it('reuses the shared arbiter prompt builder for pending arbiter turns', async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user