fix(tui): reserve /runtime and block local tool-loop fallback

This commit is contained in:
William Valentin
2026-02-24 10:41:33 -08:00
parent 2e192ef407
commit c44bc387b7
5 changed files with 73 additions and 0 deletions
+23
View File
@@ -403,6 +403,29 @@ describe('MinimalTui backend command', () => {
}
});
it('prints guidance when /runtime is invoked in TUI mode', async () => {
const mockSession = {
id: 'test',
getHistory: () => [],
addMessage: vi.fn(),
clear: vi.fn(),
replaceHistory: vi.fn(),
};
const logSpy = vi.spyOn(console, 'log').mockImplementation(() => {});
try {
const tui = new MinimalTui({
session: asSession(mockSession),
modelClient: asModelClient({}),
systemPrompt: 'test',
});
await minimalTuiPrivates(tui).handleCommand({ type: 'runtime', input: 'status' });
expect(logSpy).toHaveBeenCalledWith(expect.stringContaining('Runtime backend mode command is not available in this TUI mode.'));
} finally {
logSpy.mockRestore();
}
});
it('collects multiline input from /paste and sends as one message', async () => {
const mockSession = {
id: 'test',