mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-07-11 02:20:48 -07:00
lint burn down
This commit is contained in:
@@ -7,6 +7,7 @@ import { describe, it, expect, beforeEach } from 'vitest';
|
||||
import { SidecarLoader } from './SidecarLoader.js';
|
||||
import { defaultSidecarProfile } from './profiles.js';
|
||||
import { InMemoryFileSystem } from '../system/InMemoryFileSystem.js';
|
||||
import type { Config } from 'src/config/config.js';
|
||||
|
||||
describe('SidecarLoader (Fake FS)', () => {
|
||||
let fileSystem: InMemoryFileSystem;
|
||||
@@ -17,7 +18,7 @@ describe('SidecarLoader (Fake FS)', () => {
|
||||
|
||||
const mockConfig = {
|
||||
getExperimentalContextSidecarConfig: () => '/path/to/sidecar.json'
|
||||
} as any;
|
||||
} as unknown as Config;
|
||||
|
||||
it('returns default profile if file does not exist', () => {
|
||||
const result = SidecarLoader.fromConfig(mockConfig, fileSystem);
|
||||
|
||||
@@ -39,7 +39,7 @@ export class PipelineOrchestrator {
|
||||
}
|
||||
// The Orchestrator injects standard dependencies required by processors
|
||||
// If a processor needs the eventBus (like Snapshot), it expects it via constructor.
|
||||
const instance = processorClass.create(this.env, procDef.options) as unknown as ContextProcessor;
|
||||
const instance = processorClass.create(this.env, procDef.options);
|
||||
this.instantiatedProcessors.set(procDef.processorId, instance);
|
||||
}
|
||||
}
|
||||
@@ -69,7 +69,7 @@ export class PipelineOrchestrator {
|
||||
deficitTokens: event.targetDeficit,
|
||||
protectedEpisodeIds: new Set()
|
||||
};
|
||||
this.executePipelineAsync(pipeline, event.episodes, state);
|
||||
void this.executePipelineAsync(pipeline, event.episodes, state);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -154,18 +154,30 @@ export class PipelineOrchestrator {
|
||||
else if (procDef.processorId.includes('Semantic')) vType = 'summary';
|
||||
|
||||
const ep = mutation.episode!;
|
||||
let fallbackText = '';
|
||||
if (ep.yield?.text) fallbackText = ep.yield.text;
|
||||
else if (ep.trigger?.type === 'USER_PROMPT') {
|
||||
const firstPart = ep.trigger.semanticParts?.[0];
|
||||
if (firstPart) {
|
||||
fallbackText = firstPart.type === 'text' ? (firstPart.presentation?.text || firstPart.text) : '';
|
||||
}
|
||||
}
|
||||
|
||||
this.eventBus.emitVariantReady({
|
||||
targetId: mutation.type === 'replaced' ? mutation.originalIds![0] : ep.id,
|
||||
variantId,
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-type-assertion
|
||||
variant: {
|
||||
variant: (vType === 'snapshot' ? {
|
||||
status: 'ready',
|
||||
type: vType,
|
||||
episode: vType === 'snapshot' ? ep : undefined,
|
||||
text: vType !== 'snapshot' ? (ep.yield?.text || (ep.trigger as any)?.semanticParts?.[0]?.presentation?.text || '') : undefined,
|
||||
type: 'snapshot',
|
||||
episode: ep,
|
||||
recoveredTokens: ep.yield?.metadata?.currentTokens || 10,
|
||||
replacedEpisodeIds: mutation.originalIds,
|
||||
} as any
|
||||
} : {
|
||||
status: 'ready',
|
||||
type: vType,
|
||||
text: fallbackText,
|
||||
recoveredTokens: ep.yield?.metadata?.currentTokens || 10,
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ import type { ContextEnvironment } from './environment.js';
|
||||
|
||||
|
||||
export interface ContextProcessorDef<
|
||||
TOptions extends Record<string, unknown> = any,
|
||||
TOptions extends Record<string, unknown> = Record<string, unknown>,
|
||||
> {
|
||||
readonly id: string;
|
||||
readonly schema?: object;
|
||||
|
||||
Reference in New Issue
Block a user