Update project files
This commit is contained in:
+20
-2
@@ -1188,7 +1188,13 @@ export class AgentExecutor {
|
||||
|
||||
this.statusBarManager.updateStatus(AgentStatus.Executing);
|
||||
// Action tags are honored only from the visible final answer — never from hidden reasoning.
|
||||
// Snapshot history length so we can tell whether the actions injected any content for the
|
||||
// model to interpret: read_file / list_files / read_brain / read_sheet push system messages,
|
||||
// while run_command (no stdout captured) and file writes inject nothing. Only the former
|
||||
// warrant a follow-up LLM call.
|
||||
const historyLenBeforeActions = this.chatHistory.length;
|
||||
const report = await this.executeActions(cleanedVisible, rootPath, activeBrain);
|
||||
const actionsInjectedContext = this.chatHistory.length > historyLenBeforeActions;
|
||||
// Self-Reflector Phase C — 일반 채팅 경로에서도 코드 파일 생성 직후
|
||||
// syntax 체크 실행. 옵션 OFF면 통째로 skip.
|
||||
try {
|
||||
@@ -1263,8 +1269,13 @@ export class AgentExecutor {
|
||||
if (report.length > 0) {
|
||||
logInfo('Agent actions executed.', { loopDepth: loopDepth + 1, report });
|
||||
|
||||
// Continue loop if needed
|
||||
if (loopDepth < config.maxAutoSteps) {
|
||||
// A follow-up LLM call ("continuation") is only worth making when an action injected
|
||||
// content the model must interpret (read_file / list_files / read_brain / read_sheet).
|
||||
// Output-less actions — run_command (no stdout captured), file create/edit/delete —
|
||||
// give the continuation nothing to do, yet it would re-send the whole, often near-full,
|
||||
// context; on a weak/long-context local model that second call collapses to an empty
|
||||
// response. For those, confirm deterministically and stop. No second LLM call.
|
||||
if (actionsInjectedContext && loopDepth < config.maxAutoSteps) {
|
||||
const currentActionStr = report.join('|');
|
||||
const lastActionStr = this.context.workspaceState.get<string>('lastActionStr');
|
||||
|
||||
@@ -1283,6 +1294,13 @@ export class AgentExecutor {
|
||||
await new Promise(r => setTimeout(r, 800));
|
||||
if (this.isStaleRun(runId)) return;
|
||||
await this.handlePrompt(continuationPrompt, modelName, { ...options, loopDepth: loopDepth + 1, runId });
|
||||
} else if (!actionsInjectedContext) {
|
||||
// Output-less actions — confirm what actually ran (deterministic), no follow-up LLM call.
|
||||
logInfo('Actions produced no interpretable output — skipping continuation call.', { loopDepth, report });
|
||||
this.webview.postMessage({
|
||||
type: 'streamChunk',
|
||||
value: '\n\n---\n실행한 작업:\n' + report.map(r => `- ${r}`).join('\n'),
|
||||
});
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user