fix(native-chat): keep Claude option controls idle

This commit is contained in:
Brennan Benson
2026-08-12 18:24:50 -07:00
parent 15ebaa1d74
commit 90e3ead5cb
3 changed files with 18 additions and 3 deletions
@@ -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)
}