The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix: honor non-idempotent canonical busy control acknowledgements
Teknium01e4829cbaee
diff --git a/ui-tui/src/__tests__/busyQueueAdmission.test.tsx b/ui-tui/src/__tests__/busyQueueAdmission.test.tsxindex b5f2e4ee921..2ae32b4be70 100644--- a/ui-tui/src/__tests__/busyQueueAdmission.test.tsx+++ b/ui-tui/src/__tests__/busyQueueAdmission.test.tsx@@ -169,7 +169,7 @@ it('discards unknown execution with its generation, retaining the row on refusal} finally { h.cleanup() }})-it('preserves requested busy correction and generation through ambiguous retry without queue fallback', async () => {+it('never replays an ambiguous non-idempotent busy correction or falls back to queue', async () => {const h = mount('steer')try {h.request.mockImplementation(async (method, params) => { h.calls.push({ method, params }); throw new Error('invalid_params') })@@ -180,8 +180,9 @@ it('preserves requested busy correction and generation through ambiguous retry wawait expect.poll(() => h.queue.queueRef.current[0]?.failed).toBe(true)patchUiState({ busyInputMode: 'interrupt', info: { ...$uiState.get().info!, execution_generation: 2 } })h.submission.sendQueued(h.queue.dequeue(true)!)- await expect.poll(() => h.calls.length).toBe(2)- expect(h.calls[1]).toEqual({ method: 'session.steer', params: first })+ await new Promise(resolve => setImmediate(resolve))+ expect(h.calls).toEqual([{ method: 'session.steer', params: first }])+ expect(first).not.toHaveProperty('submission_id')expect(loadPendingInputs(captureDestination())[0]).toMatchObject({ controlMethod: 'session.steer', executionGeneration: 1 })} finally { h.cleanup() }})diff --git a/ui-tui/src/app/submissionCore.ts b/ui-tui/src/app/submissionCore.tsindex 1600c195cf4..63bfe15bbdb 100644--- a/ui-tui/src/app/submissionCore.ts+++ b/ui-tui/src/app/submissionCore.ts@@ -75,7 +75,7 @@ export function submitPrompt(opts.queueItem.settle?.(false)if (focused()) {- deps.sys('legacy delivery unconfirmed — check the session before sending a new input; retained input was not resent')+ deps.sys('delivery unconfirmed — check the session before sending a new input; retained input was not resent')patchUiState({ status: 'delivery unconfirmed' })}@@ -105,6 +105,8 @@ export function submitPrompt(if (item) {item.preparedText ??= submitText+ // Busy controls have no deduplication receipt: never replay after an ambiguous reply.+ if (item.controlMethod) { item.legacyAttempted = true }item.attachments ??= opts.attachments?.map(attachment => ({ ...attachment }))if (opts.behindTurn) { item.queued = true }@@ -113,15 +115,29 @@ export function submitPrompt(savePendingInput(item)}+ if (item?.controlMethod && item.attachments?.length) {+ item.settle?.(false)+ if (focused()) { deps.sys('busy corrections accept text only — image input retained; submit it with /queue') }+ return+ }+deps.gw.request<PromptSubmitResponse>(item?.controlMethod ?? 'prompt.submit', {session_id: sid,text: item?.preparedText ?? submitText,...((item?.attachments ?? opts.attachments)?.length ? { attachments: item?.attachments ?? opts.attachments } : {}),...(item?.controlMethod ? { execution_generation: item.executionGeneration } : {}),- ...(item ? { submission_id: item.submissionId, ...(item.controlMethod ? {} : { queued: item.queued !== false }) } : {})+ ...(item && !item.controlMethod ? { submission_id: item.submissionId, queued: item.queued !== false } : {})}).then(r => {+ if (item?.controlMethod) {+ const control = r as PromptSubmitResponse & { execution_generation?: number }+ const accepted = control.execution_generation === item.executionGeneration &&+ ['queued', 'redirected'].includes(control.status ?? '')+ item.settle?.(accepted)+ if (focused()) { deps.sys(accepted ? `correction ${control.status}` : 'correction rejected — input retained') }+ return+ }if (item) {const accepted =(r?.input_id ?? r?.admission_id) === item.submissionId &&