fix(tui): reserve /runtime and block local tool-loop fallback
This commit is contained in:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user