mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 16:02:32 +00:00
fix(activity): prevent monitoring turns from emitting working events
Monitoring turns should surface only via the 'monitoring' snapshot in the live state, not as separate working events that would contradict the snapshot signal.
This commit is contained in:
@@ -171,6 +171,9 @@ describe('buildActivityEvents', () => {
|
||||
|
||||
expect(result.liveAgentByPaneKey[PANE_KEY].state).toBe('monitoring')
|
||||
expect(threads[0].currentAgentState).toBe('monitoring')
|
||||
// A monitoring turn must not emit a `working` event that contradicts the live snapshot.
|
||||
expect(result.events).toHaveLength(0)
|
||||
expect(threads[0].latestEvent).toBeNull()
|
||||
expect(groups[0]).toMatchObject({
|
||||
key: 'monitoring',
|
||||
label: 'Monitoring background tasks',
|
||||
|
||||
@@ -97,8 +97,11 @@ export function buildPaneActivityEvents(args: PaneEventInputs): ActivityEvent[]
|
||||
)
|
||||
}
|
||||
|
||||
// Monitoring live turns surface only via the 'monitoring' snapshot, never as a working event.
|
||||
const currentState =
|
||||
args.liveState !== null || isHistoricalActivityState(args.entry.state) ? args.entry.state : null
|
||||
args.liveState === 'working' || isHistoricalActivityState(args.entry.state)
|
||||
? args.entry.state
|
||||
: null
|
||||
if (currentState === null || args.entry.sessionBoundary === true) {
|
||||
return events
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user