mirror of
https://github.com/stablyai/orca.git
synced 2026-10-21 16:03:26 +00:00
fix(native-chat): keep Claude option controls idle
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
|
||||
import { getAgentSessionOptionCatalog } from '../../../src/shared/agent-session-option-catalog'
|
||||
import type { AgentSessionOptionsResult } from '../../../src/shared/agent-session-wire'
|
||||
import type {
|
||||
AgentSessionOptionResult,
|
||||
AgentSessionOptionsResult
|
||||
} from '../../../src/shared/agent-session-wire'
|
||||
import type { SessionOptionValue } from '../../../src/shared/native-chat-session-options'
|
||||
import {
|
||||
applyStructuredAgentSessionOptions,
|
||||
@@ -9,7 +12,6 @@ import {
|
||||
createStructuredAgentSessionOptionState,
|
||||
structuredAgentSessionOptionSnapshot
|
||||
} from '../../../src/shared/structured-agent-session-options'
|
||||
import type { AgentSessionOptionResult } from '../../../src/shared/agent-session-wire'
|
||||
import type { RpcClient } from '../transport/rpc-client'
|
||||
import type { MobileStructuredAgent } from './mobile-structured-session-create'
|
||||
import type { MobileNativeChatSessionOptionsController } from './use-mobile-native-chat-session-options'
|
||||
|
||||
@@ -173,6 +173,15 @@ describe('Claude structured journal translation', () => {
|
||||
})
|
||||
})
|
||||
|
||||
it('ignores empty user frames emitted by control-only requests', () => {
|
||||
const state = sinkState()
|
||||
const translator = createClaudeJournalTranslator({ sink: state.sink })
|
||||
|
||||
translator.handle(message('user', 'control-only', []))
|
||||
|
||||
expect(state.items).toEqual([])
|
||||
})
|
||||
|
||||
it('creates addressable approval and multi-question cards and cancels them durably', () => {
|
||||
const state = sinkState()
|
||||
const bindings: unknown[][] = []
|
||||
|
||||
@@ -195,7 +195,11 @@ export function createClaudeJournalTranslator(
|
||||
})
|
||||
changed = true
|
||||
}
|
||||
if (envelope.role === 'user' && message.parent_tool_use_id === null) {
|
||||
if (
|
||||
envelope.role === 'user' &&
|
||||
envelope.content.length > 0 &&
|
||||
message.parent_tool_use_id === null
|
||||
) {
|
||||
if (currentTurn) {
|
||||
publishLifecycle(currentTurn.sessionId, currentTurn.turnId, false)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user