Protect stdout and stderr so JavaScript code can't accidentally write to stdout corrupting ink rendering (#13247)

Bypassing rules as link checker failure is spurious.
This commit is contained in:
Jacob Richman
2025-11-20 10:44:02 -08:00
committed by GitHub
parent e20d282088
commit d1e35f8660
82 changed files with 1523 additions and 868 deletions
@@ -20,6 +20,7 @@ import {
import { promptIdContext } from '../../utils/promptIdContext.js';
import type { Content } from '@google/genai';
import type { ResolvedModelConfig } from '../../services/modelConfigService.js';
import { debugLogger } from '../../utils/debugLogger.js';
vi.mock('../../core/baseLlmClient.js');
vi.mock('../../utils/promptIdContext.js');
@@ -132,7 +133,7 @@ describe('ClassifierStrategy', () => {
it('should return null if the classifier API call fails', async () => {
const consoleWarnSpy = vi
.spyOn(console, 'warn')
.spyOn(debugLogger, 'warn')
.mockImplementation(() => {});
const testError = new Error('API Failure');
vi.mocked(mockBaseLlmClient.generateJson).mockRejectedValue(testError);
@@ -150,7 +151,7 @@ describe('ClassifierStrategy', () => {
it('should return null if the classifier returns a malformed JSON object', async () => {
const consoleWarnSpy = vi
.spyOn(console, 'warn')
.spyOn(debugLogger, 'warn')
.mockImplementation(() => {});
const malformedApiResponse = {
reasoning: 'This is a simple task.',
@@ -252,7 +253,7 @@ describe('ClassifierStrategy', () => {
it('should use a fallback promptId if not found in context', async () => {
const consoleWarnSpy = vi
.spyOn(console, 'warn')
.spyOn(debugLogger, 'warn')
.mockImplementation(() => {});
vi.mocked(promptIdContext.getStore).mockReturnValue(undefined);
const mockApiResponse = {