refactor(coding-agent): simplify AgentSession

This commit is contained in:
Mario Zechner 2026-01-24 01:38:58 +01:00
parent 254c00b788
commit f9eb190ef9
5 changed files with 33 additions and 51 deletions

View file

@ -347,7 +347,7 @@ export class InteractiveMode {
this.skillCommands.clear();
const skillCommandList: SlashCommand[] = [];
if (this.settingsManager.getEnableSkillCommands()) {
for (const skill of this.session.skills) {
for (const skill of this.session.resourceLoader.getSkills().skills) {
const commandName = `skill:${skill.name}`;
this.skillCommands.set(commandName, skill.filePath);
skillCommandList.push({ name: commandName, description: skill.description });
@ -839,7 +839,7 @@ export class InteractiveMode {
this.chatContainer.addChild(new Spacer(1));
}
const skills = this.session.skills;
const skills = this.session.resourceLoader.getSkills().skills;
if (skills.length > 0) {
const skillPaths = skills.map((s) => s.filePath);
const groups = this.groupPathsBySource(skillPaths, metadata);
@ -848,7 +848,7 @@ export class InteractiveMode {
this.chatContainer.addChild(new Spacer(1));
}
const skillDiagnostics = this.session.skillWarnings;
const skillDiagnostics = this.session.resourceLoader.getSkills().diagnostics;
if (skillDiagnostics.length > 0) {
const warningLines = this.formatDiagnostics(skillDiagnostics, metadata);
this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Skill conflicts]")}\n${warningLines}`, 0, 0));