fix(coding-agent): add entry renderers for session entries

This commit is contained in:
Mario Zechner
2026-07-01 11:00:14 +02:00
parent 8c9436407c
commit ba10b60b51
18 changed files with 507 additions and 158 deletions
@@ -86,7 +86,7 @@ import type { BashExecutionMessage, CustomMessage } from "./messages.ts";
import type { ModelRegistry } from "./model-registry.ts";
import { expandPromptTemplate, type PromptTemplate } from "./prompt-templates.ts";
import type { ResourceExtensionPaths, ResourceLoader } from "./resource-loader.ts";
import type { BranchSummaryEntry, CompactionEntry, SessionManager } from "./session-manager.ts";
import type { BranchSummaryEntry, CompactionEntry, SessionEntry, SessionManager } from "./session-manager.ts";
import { CURRENT_SESSION_VERSION, getLatestCompactionEntry, type SessionHeader } from "./session-manager.ts";
import type { SettingsManager } from "./settings-manager.ts";
import type { SlashCommandInfo } from "./slash-commands.ts";
@@ -137,6 +137,7 @@ export type AgentSessionEvent =
followUp: readonly string[];
}
| { type: "compaction_start"; reason: "manual" | "threshold" | "overflow" }
| { type: "entry_appended"; entry: SessionEntry }
| { type: "session_info_changed"; name: string | undefined }
| { type: "thinking_level_changed"; level: ThinkingLevel }
| {
@@ -2262,7 +2263,11 @@ export class AgentSession {
});
},
appendEntry: (customType, data) => {
this.sessionManager.appendCustomEntry(customType, data);
const entryId = this.sessionManager.appendCustomEntry(customType, data);
const entry = this.sessionManager.getEntry(entryId);
if (entry) {
this._emit({ type: "entry_appended", entry });
}
},
setSessionName: (name) => {
this.setSessionName(name);