Update Astra: v2.80.19 - Refactoring Sidebar, LM Studio integration, and new tests

This commit is contained in:
g1nation
2026-05-08 23:14:47 +09:00
parent d083177d95
commit 5ffb472d22
28 changed files with 3125 additions and 1797 deletions
+21 -2
View File
@@ -53,6 +53,14 @@ export interface ChatMessage {
type HistoryChangeListener = (history: ChatMessage[]) => void | Promise<void>;
export interface AgentExecutorOptions {
/** Hooks fired around any LLM streaming run so external systems (LM Studio idle eject) can pause/resume. */
onStreamLifecycle?: {
start: () => void;
end: () => void;
};
}
// --- Agent Roles & Workflows ---
export type AgentRole = 'planner' | 'researcher' | 'writer';
type LocalProjectIntent = 'review-evaluation' | 'knowledge-creation' | 'implementation' | 'documentation' | 'thinking' | 'general';
@@ -86,9 +94,13 @@ export class AgentExecutor {
private retrievalOrchestrator: RetrievalOrchestrator;
private currentTaskId: string = 'default_session';
private readonly options: AgentExecutorOptions;
constructor(
private context: vscode.ExtensionContext
private context: vscode.ExtensionContext,
options: AgentExecutorOptions = {}
) {
this.options = options;
this.transactionManager = new TransactionManager();
this.sessionManager = new SessionManager(this.context);
this.statusBarManager = new StatusBarManager();
@@ -454,7 +466,10 @@ export class AgentExecutor {
const reader = response.body?.getReader();
if (!reader) throw new Error("Response body is not readable.");
if (loopDepth === 0) this.webview.postMessage({ type: 'streamStart' });
if (loopDepth === 0) {
this.webview.postMessage({ type: 'streamStart' });
this.options.onStreamLifecycle?.start();
}
let buffer = '';
const decoder = new TextDecoder();
@@ -618,6 +633,7 @@ export class AgentExecutor {
}
if (loopDepth === 0 && !this.isStaleRun(runId)) {
this.webview.postMessage({ type: 'streamEnd' });
this.options.onStreamLifecycle?.end();
}
}
}
@@ -634,6 +650,7 @@ export class AgentExecutor {
this.statusBarManager.updateStatus(AgentStatus.Thinking, 'Multi-Agent Workflow Running');
this.webview.postMessage({ type: 'streamStart' });
this.options.onStreamLifecycle?.start();
try {
let brainContext = 'No specific context available';
@@ -693,6 +710,8 @@ export class AgentExecutor {
value: `### ${friendly.title}\n\n**상태:** ${friendly.message}\n\n**해결 방법:** ${friendly.action}`
});
this.statusBarManager.updateStatus(AgentStatus.Idle, 'Error occurred');
} finally {
this.options.onStreamLifecycle?.end();
}
}