tidy triggers

This commit is contained in:
Your Name
2026-04-07 21:58:53 +00:00
parent 1383200054
commit e548cd6b0e
6 changed files with 12 additions and 13 deletions
@@ -262,12 +262,12 @@ describe('PipelineOrchestrator (Component)', () => {
expect(result).toStrictEqual(episodes);
});
it('automatically binds to budget_exceeded trigger via EventBus', () => {
it('automatically binds to retained_exceeded trigger via EventBus', () => {
const config = createConfig([
{
name: 'PressureRelief',
execution: 'background',
triggers: ['budget_exceeded'],
triggers: ['retained_exceeded'],
processors: [
{ processorId: 'DummyAsyncProcessor' } as unknown as ProcessorConfig,
],
@@ -70,7 +70,7 @@ export class PipelineOrchestrator {
// If needed, we will pass it via event bus.
}, trigger.intervalMs);
this.activeTimers.push(timer);
} else if (trigger === 'budget_exceeded') {
} else if (trigger === 'retained_exceeded') {
this.eventBus.onConsolidationNeeded((event) => {
const state: ContextAccountingState = {
currentTokens: 0,
@@ -83,7 +83,7 @@ export class PipelineOrchestrator {
};
void this.executePipelineAsync(pipeline, event.episodes, state);
});
} else if (trigger === 'on_turn') {
} else if (trigger === 'new_message') {
this.eventBus.onChunkReceived((event) => {
const state: ContextAccountingState = {
currentTokens: 0,
@@ -18,7 +18,7 @@ export const defaultSidecarProfile: SidecarConfig = {
pipelines: [
{
name: 'Immediate Sanitization',
triggers: ['on_turn'],
triggers: ['new_message'],
execution: 'blocking',
processors: [
{
@@ -30,7 +30,7 @@ export const defaultSidecarProfile: SidecarConfig = {
},
{
name: 'Deep Background Compression',
triggers: [{ type: 'timer', intervalMs: 5000 }, 'budget_exceeded'],
triggers: [{ type: 'timer', intervalMs: 5000 }, 'retained_exceeded'],
execution: 'background',
processors: [
{
+1 -1
View File
@@ -48,7 +48,7 @@ export function getSidecarConfigSchema(registry: ProcessorRegistry) {
anyOf: [
{
type: 'string',
enum: ['on_turn', 'post_turn', 'budget_exceeded'],
enum: ['new_message', 'retained_exceeded', 'gc_backstop'],
},
{
type: 'object',
+2 -3
View File
@@ -33,9 +33,8 @@ export type ProcessorConfig =
};
export type PipelineTrigger =
| 'on_turn'
| 'post_turn'
| 'budget_exceeded'
| 'new_message'
| 'retained_exceeded'
| 'gc_backstop'
| { type: 'timer'; intervalMs: number };
@@ -35,9 +35,9 @@ describe('System Lifecycle Golden Tests', () => {
budget: { maxTokens: 4000, retainedTokens: 2000 }, // Extremely tight limits
pipelines: [
{
name: 'Pressure Relief', // Emits from eventBus 'budget_exceeded'
name: 'Pressure Relief', // Emits from eventBus 'retained_exceeded'
execution: 'background',
triggers: ['budget_exceeded'],
triggers: ['retained_exceeded'],
processors: [
{ processorId: 'BlobDegradationProcessor' },
{
@@ -50,7 +50,7 @@ describe('System Lifecycle Golden Tests', () => {
{
name: 'Immediate Sanitization', // The magic string the projector is hardcoded to use
execution: 'blocking',
triggers: ['budget_exceeded'],
triggers: ['retained_exceeded'],
processors: [
{ processorId: 'EmergencyTruncationProcessor', options: {} },
],