chore(electrobun): add detailed RPC message listener debug logging
This commit is contained in:
parent
5315dc6176
commit
5ac80a4d00
1 changed files with 14 additions and 1 deletions
|
|
@ -196,6 +196,15 @@ function ensureListeners() {
|
|||
listenersRegistered = true;
|
||||
console.log('[agent-store] Registering RPC listeners');
|
||||
|
||||
// DEBUG: Test if addMessageListener actually works
|
||||
console.log('[agent-store] typeof addMessageListener:', typeof appRpc.addMessageListener);
|
||||
appRpc.addMessageListener('agent.status', (payload: unknown) => {
|
||||
console.log('[agent-store] *** RECEIVED agent.status ***', payload);
|
||||
});
|
||||
appRpc.addMessageListener('agent.cost', (payload: unknown) => {
|
||||
console.log('[agent-store] *** RECEIVED agent.cost ***', payload);
|
||||
});
|
||||
|
||||
// agent.message — raw messages from sidecar, converted to display format
|
||||
appRpc.addMessageListener('agent.message', (payload: {
|
||||
sessionId: string;
|
||||
|
|
@ -207,8 +216,12 @@ function ensureListeners() {
|
|||
timestamp: number;
|
||||
}>;
|
||||
}) => {
|
||||
console.log('[agent-store] *** RECEIVED agent.message ***', payload.sessionId, payload.messages?.length, 'msgs');
|
||||
const session = sessions[payload.sessionId];
|
||||
if (!session) return;
|
||||
if (!session) {
|
||||
console.warn('[agent-store] No session found for', payload.sessionId);
|
||||
return;
|
||||
}
|
||||
|
||||
const converted: AgentMessage[] = [];
|
||||
for (const raw of payload.messages) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue