Stabilize paired-room orchestration and Codex app-server flow

This commit is contained in:
Eyejoker
2026-03-19 02:57:14 +09:00
parent b710d4a33d
commit 779d57c392
32 changed files with 2517 additions and 185 deletions

View File

@@ -2,6 +2,7 @@ import { describe, it, expect, vi } from 'vitest';
import {
extractSessionCommand,
handleSessionCommand,
isSessionCommandControlMessage,
isSessionCommandAllowed,
} from './session-commands.js';
import type { NewMessage } from './types.js';
@@ -67,6 +68,28 @@ describe('isSessionCommandAllowed', () => {
});
});
describe('isSessionCommandControlMessage', () => {
it('matches clear confirmation output', () => {
expect(
isSessionCommandControlMessage(
'Current session cleared. The next message will start a new conversation.',
),
).toBe(true);
});
it('matches admin denial output', () => {
expect(
isSessionCommandControlMessage('Session commands require admin access.'),
).toBe(true);
});
it('does not match regular bot conversation', () => {
expect(isSessionCommandControlMessage('좋네요. 필요해지면 바로 말씀드리겠습니다.')).toBe(
false,
);
});
});
function makeMsg(
content: string,
overrides: Partial<NewMessage> = {},