Skip to content

Commit 6356ca4

Browse files
committed
[abAction]: cleaned up some more ab logs. persist askGPT logs in local space.
1 parent ea675ea commit 6356ca4

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

src/ab/abAction/ab/action/ask/abConversationHistoryClear.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,7 @@ assert(ab.links.utils.isBot(historyStorageBot), `[${tags.system}.${tagName}] his
44

55
setTagMask(historyStorageBot, 'abConversationHistory', null, historyStorageBot.space);
66

7-
const name = thisBot.abAskHelperGetAgentName({ askContext: { abBot: historyStorageBot} });
8-
ab.links.utils.abLog({ name, message: 'Conversation history cleared.' });
7+
const agentName = thisBot.abAskHelperGetAgentName({ askContext: { abBot: historyStorageBot} });
8+
const username = await ab.links.console.getUserName();
9+
10+
ab.links.utils.abLog({ name: agentName, message: `${username} has cleared my conversation history.`, space: 'shared' });

src/ab/abAction/ab/action/ask/askGPT.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ function buildUserMessage(message?: string, extra: Record<string, any> = {}): st
7878
if (callDepth === 0 && hasInquiry && agentMode === 'plan' && !todoBot) {
7979
await thisBot.abAskHelperCreateUserRequestTodo({ askContext });
8080

81-
const name = thisBot.abAskHelperGetAgentName({ askContext });
82-
ab.links.utils.abLog({ name, message: `Created a user request todo for "${originalUserInquiryLabel}"` });
81+
const agentName = thisBot.abAskHelperGetAgentName({ askContext });
82+
const username = await ab.links.console.getUserName();
83+
ab.links.utils.abLog({ name: agentName, message: `${username} created a user request todo for "${originalUserInquiryLabel}"`, space: 'shared' });
8384

8485
return;
8586
}
@@ -88,13 +89,13 @@ const MAX_CALL_DEPTH = 10; // Prevent infinite loops — if the agent calls askG
8889

8990
if (callDepth >= MAX_CALL_DEPTH) {
9091
const name = thisBot.abAskHelperGetAgentName({ askContext });
91-
ab.links.utils.abLog({ name, message: 'AI call depth limit reached', logType: 'error' });
92+
ab.links.utils.abLog({ name, message: 'AI call depth limit reached', logType: 'error', space: 'local' });
9293
return;
9394
}
9495

9596
if (callDepth === 0) {
9697
const name = thisBot.abAskHelperGetAgentName({ askContext });
97-
ab.links.utils.abLog({ name, message: `thinking...` });
98+
ab.links.utils.abLog({ name, message: `thinking...`, space: 'local' });
9899
ab.links.manifestation.abBotChat({ bot: abBot, message: `thinking...` });
99100
}
100101

@@ -191,7 +192,7 @@ for (const fc of functionCalls) {
191192

192193
if (!toolHost) {
193194
const name = thisBot.abAskHelperGetAgentName({ askContext });
194-
ab.links.utils.abLog({ name, message: `Unknown function call from AI: ${name}`, logType: 'error' });
195+
ab.links.utils.abLog({ name, message: `Unknown function call from AI: ${name}`, logType: 'error', space: 'local' });
195196
continue;
196197
}
197198

0 commit comments

Comments
 (0)