(overrides: Record<string, unknown> = {})
| 14 | } |
| 15 | |
| 16 | function makeBaseOptions(overrides: Record<string, unknown> = {}) { |
| 17 | return { |
| 18 | input: '/clear', |
| 19 | helpers: { |
| 20 | setCursorOffset: () => {}, |
| 21 | clearBuffer: () => {}, |
| 22 | }, |
| 23 | speculationAccept: undefined, |
| 24 | fromKeybinding: false, |
| 25 | inputMode: 'prompt', |
| 26 | isLoading: false, |
| 27 | commands: [makeCommand('clear')], |
| 28 | isCommandEnabled: () => true, |
| 29 | isRemoteMode: false, |
| 30 | pastedContents: {}, |
| 31 | queryGuardActive: false, |
| 32 | userType: undefined, |
| 33 | willowMode: 'off', |
| 34 | idleReturnDismissed: false, |
| 35 | skipIdleCheck: false, |
| 36 | lastQueryCompletionTimeMs: 5, |
| 37 | getTotalInputTokens: () => 42, |
| 38 | tokenThreshold: 100_000, |
| 39 | idleThresholdMinutes: 75, |
| 40 | expandPastedTextRefs: (input: string) => input, |
| 41 | parseBackgroundPRShortcutInput: () => null, |
| 42 | getInputValue: () => '/clear', |
| 43 | mainLoopModel: 'gpt-test', |
| 44 | stashedPrompt: undefined, |
| 45 | getMessageCount: () => 7, |
| 46 | cwd: '/repo', |
| 47 | readFileState: { current: {} }, |
| 48 | ideSelection: undefined, |
| 49 | abortController: null, |
| 50 | isExternalLoading: false, |
| 51 | streamMode: 'streaming', |
| 52 | hasInterruptibleToolInProgress: false, |
| 53 | querySource: 'repl', |
| 54 | nowProvider: () => 123, |
| 55 | ...overrides, |
| 56 | } as const |
| 57 | } |
| 58 | |
| 59 | describe('dispatchReplSubmit', () => { |
| 60 | test('short-circuits after a handled prelude', async () => { |
no test coverage detected