mirror of
https://github.com/stablyai/orca.git
synced 2026-10-23 00:03:52 +00:00
fix(agent-status): suppress stamped turn replays
This commit is contained in:
@@ -1277,7 +1277,7 @@ describe('agent completion coordinator', () => {
|
||||
)
|
||||
})
|
||||
|
||||
it('pairs a background all-clear with the turn it announced even after a working title blip', () => {
|
||||
it('does not replay a stamped turn or its all-clear after a working title blip', () => {
|
||||
const dispatchCompletion = vi.fn()
|
||||
const dispatchHookLifecycle = vi.fn()
|
||||
const coordinator = createAgentCompletionCoordinator({
|
||||
@@ -1308,6 +1308,15 @@ describe('agent completion coordinator', () => {
|
||||
vi.advanceTimersByTime(2_000)
|
||||
coordinator.observeTitleWorking()
|
||||
|
||||
coordinator.observeHookStatus({
|
||||
state: 'working',
|
||||
prompt: 'review the PR',
|
||||
agentType: 'claude',
|
||||
stateStartedAt: 1_700_000_000_000,
|
||||
turnCompletedAt: 1_700_000_005_000
|
||||
})
|
||||
expect(dispatchCompletion).toHaveBeenCalledTimes(1)
|
||||
|
||||
coordinator.observeHookStatus({
|
||||
state: 'done',
|
||||
prompt: 'review the PR',
|
||||
|
||||
@@ -832,7 +832,11 @@ export function createAgentCompletionCoordinator(
|
||||
: undefined
|
||||
if (turnCompletedAt !== undefined) {
|
||||
// Why: Claude's lead Stop already ended the turn; the pane stays `working` only for background inventory. Announce now, keep lifecycle on the reported working row.
|
||||
if (workingStatusObserved) {
|
||||
if (
|
||||
workingStatusObserved &&
|
||||
!turnCompletedAtAlreadyNotified(turnCompletedAt) &&
|
||||
lastCompletionIdentity?.lastTurnCompletedAtNotified !== turnCompletedAt
|
||||
) {
|
||||
const completionSnapshot: AgentCompletionStatusSnapshot = {
|
||||
...payload,
|
||||
state: 'done',
|
||||
|
||||
Reference in New Issue
Block a user