refactor: Enhance GenerationJobManager with In-Memory Implementations

- Introduced InMemoryJobStore, InMemoryEventTransport, and InMemoryContentState for improved job management and event handling.
- Updated GenerationJobManager to utilize these new implementations, allowing for better separation of concerns and easier maintenance.
- Enhanced job metadata handling to support user messages and response IDs for resumable functionality.
- Improved cleanup and state management processes to prevent memory leaks and ensure efficient resource usage.
This commit is contained in:
Danny Avila 2025-12-12 02:16:24 -05:00
parent 9eec76ee0c
commit 3a0c1476da
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
14 changed files with 892 additions and 321 deletions

View file

@ -6,7 +6,6 @@ export interface StreamStatusResponse {
active: boolean;
streamId?: string;
status?: 'running' | 'complete' | 'error' | 'aborted';
chunkCount?: number;
aggregatedContent?: Array<{ type: string; text?: string }>;
createdAt?: number;
resumeState?: Agents.ResumeState;

View file

@ -62,7 +62,7 @@ function buildSubmissionFromResumeState(
content: (resumeState.aggregatedContent as TMessage['content']) ?? [],
isCreatedByUser: false,
role: 'assistant',
sender: existingResponseMessage?.sender,
sender: existingResponseMessage?.sender ?? resumeState.sender,
model: existingResponseMessage?.model,
} as TMessage;