mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 00:02:31 +00:00
fix(mobile): retire refused cancel operation ids
This commit is contained in:
@@ -22,7 +22,7 @@ export type StructuredAgentSessionMutationCallResult<TValue> =
|
||||
| { status: 'accepted'; value: TValue }
|
||||
| { status: 'refused'; code: AgentSessionWireRefusalCode; message: string }
|
||||
| { status: 'failed'; message: string }
|
||||
| { status: 'unknown' }
|
||||
| { status: 'unknown'; hostReportedOperationUnknown?: boolean }
|
||||
|
||||
export type StructuredAgentSessionMutationResult<TValue> =
|
||||
| { status: 'accepted'; value: TValue; sameFence: boolean }
|
||||
@@ -169,7 +169,7 @@ export async function requestStructuredAgentSessionMutation<TValue>(args: {
|
||||
(method === 'agentSession.cancel' || method === 'agentSession.conversationCommand') &&
|
||||
result.refusal.code === 'agent_session_operation_unknown'
|
||||
) {
|
||||
return { status: 'unknown' }
|
||||
return { status: 'unknown', hostReportedOperationUnknown: true }
|
||||
}
|
||||
return result.ok
|
||||
? { status: 'accepted', value: result.value }
|
||||
|
||||
@@ -257,7 +257,7 @@ export function useMobileStructuredAgentSession(args: {
|
||||
fields,
|
||||
clientOperationId
|
||||
}).then((result) => {
|
||||
if (result.status !== 'unknown') {
|
||||
if (result.status !== 'unknown' || result.hostReportedOperationUnknown === true) {
|
||||
operationIdsRef.current.delete(key)
|
||||
}
|
||||
if (result.status === 'unknown') {
|
||||
|
||||
Reference in New Issue
Block a user