Skip to content

Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.

Merge pull request #290 from nosliwhtes/fix/past-session-recall

Salman Qureshi775cb1cd4033
diff --cc src/core/agent.ts
index 4ee22f0c,a547e408..17e24cd8
--- a/src/core/agent.ts
+++ b/src/core/agent.ts
@@@ -3230,14 -3226,6 +3236,11 @@@ export class Agent
this.markProgress();
}
- this.capabilities.setChannelContext(msg.channelId, msg.channelType);
- this.capabilities.permissions.setCurrentChannelType(msg.channelType);
- this.capabilities.permissions.setCurrentSenderRole(msg.senderRole);
+ const toolDiscovery = new ToolDiscovery(
+ () => this.programmingMode.isPlan() ? this.capabilities.getPlanTools() : this.capabilities.getTools(),
+ this.config.toolDiscovery?.enabled === true,
+ );
+
const providerContextId = msg.sessionId ?? (typeof msg.metadata?.sessionId === 'string' ? msg.metadata.sessionId : msg.channelId);
const channelOverride = this.channelProviderOverrides.get(providerContextId);
const fallbackIterator = channelOverride
diff --cc src/sessions/repository.ts
index 14f24c47,f60520c5..c6b48400
--- a/src/sessions/repository.ts
+++ b/src/sessions/repository.ts
@@@ -71,8 -71,13 +71,15 @@@ export class SessionResolutionError ext
}
}
+export class SessionTitleError extends Error {}
+
+ export class SessionReadError extends Error {
+ constructor(message: string, readonly bytesRead: number, readonly fileSize?: number) {
+ super(message);
+ this.name = 'SessionReadError';
+ }
+ }
+
export class SessionRepository {
readonly rootDir: string;
private readonly indexPath: string;