Skip to content

Commit e6ae881

Browse files
committed
dispatch correct UI when skipping model call
1 parent 544a585 commit e6ae881

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

app/src/components/AgentCard/ActiveAgentView.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const StateTicker: React.FC<{ status: AgentLiveStatus }> = ({ status }) => {
2626
case 'CAPTURING': return { icon: <Eye className="w-5 h-5 animate-subtle-pulse" />, text: 'Capturing Inputs...', color: 'text-cyan-600' };
2727
case 'THINKING': return { icon: <Activity className="w-5 h-5" />, text: 'Model is thinking...', color: 'text-purple-600' };
2828
case 'RESPONDING': return { icon: <Activity className="w-5 h-5 animate-pulse" />, text: 'Model is responding...', color: 'text-blue-600' };
29-
case 'SKIPPED': return { icon: <Clock className="w-5 h-5" />, text: 'No Change, Skipped Iteration...', color: 'text-orange-500' };
29+
case 'SKIPPED': return { icon: <Clock className="w-5 h-5" />, text: 'Skipped Model Call, Waiting...', color: 'text-orange-500' };
3030
case 'WAITING': return { icon: <Clock className="w-5 h-5" />, text: 'Waiting for next cycle...', color: 'text-gray-500' };
3131
default: return { icon: <div />, text: 'Idle', color: 'text-gray-400' };
3232
}

app/src/utils/main_loop.ts

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ export async function executeAgentIteration(agentId: string): Promise<void> {
274274
// Log based on source
275275
if (fromCache) {
276276
Logger.info(agentId, `Using cached response - no significant change detected`, {
277-
logType: 'iteration-cached-response',
277+
logType: 'iteration-response',
278278
iterationId,
279279
content: { usingCache: true }
280280
});
@@ -290,12 +290,24 @@ export async function executeAgentIteration(agentId: string): Promise<void> {
290290
if (isAgentLoopRunning(agentId)) {
291291
recordingManager.handleEndOfLoop();
292292
}
293-
Logger.info(agentId, `Iteration completed`, {
294-
logType: 'iteration-end',
295-
iterationId,
296-
content: { success: true, cached: fromCache }
297-
});
298-
} catch (postProcessError) {
293+
294+
// Dispach to UI that we skipped the model call and completed iteration
295+
if (fromCache){
296+
Logger.info(agentId, `Iteration completed - no significant change detected`, {
297+
logType: 'iteration-skipped',
298+
iterationId,
299+
content: { success: true, cached: fromCache }
300+
});
301+
}
302+
// Dispach we completed with model call
303+
else{
304+
Logger.info(agentId, `Iteration completed`, {
305+
logType: 'iteration-end',
306+
iterationId,
307+
content: { success: true, cached: fromCache }
308+
});
309+
}
310+
} catch (postProcessError) {
299311
Logger.error(agentId, `Error in postProcess: ${postProcessError}`, { iterationId, error: postProcessError });
300312

301313
// Error path - still clean up but log failure

0 commit comments

Comments
 (0)