Files
orca/src/shared/structured-agent-session-owed-work.ts
T
Brennan Benson bb44f74d00 Keep native chat /clear in the same conversation (#26579)
* Keep clear in the same chat and reset its provider context

* Derive clear pauses only from journal membership and cover older rewind clients

* Point queued command rewind test at the structured hook

* Group queue consume errors and rewind replay assertions
2026-10-08 16:00:29 -07:00

20 lines
981 B
TypeScript

import type { AgentJournalRenderItem, AgentJournalSubmission } from './agent-session-journal-types'
import { activeStructuredAgentSessionTurnId } from './structured-agent-session-live-turn'
import { isStructuredAgentSessionMainAgentWorking } from './structured-agent-session-main-agent-working'
import { agentSessionCurrentContextRows } from './agent-session-context-clear'
/** A running turn or an unanswered send: what a `working` status means, and what an `attention`
* status hides beneath its pending prompt. The main-agent rule, read from the journal's items. */
export function owesStructuredAgentSessionWork(
items: readonly AgentJournalRenderItem[],
submissions: readonly AgentJournalSubmission[],
currentFence?: number | null
): boolean {
const current = agentSessionCurrentContextRows(items, submissions)
return isStructuredAgentSessionMainAgentWorking(
activeStructuredAgentSessionTurnId(current.items),
current.submissions,
currentFence
)
}