@@ -11,9 +11,9 @@ import type {
1111import { readBool , readMetadataString , readNonNegativeInteger } from "@openclaw/acp-core/meta" ;
1212import type { AcpSessionStore } from "@openclaw/acp-core/session" ;
1313import type { AcpServerOptions } from "@openclaw/acp-core/types" ;
14- import { normalizeLowercaseStringOrEmpty as normalizedChatSendAckStatus } from "@openclaw/normalization-core/string-coerce" ;
1514import type { EventFrame } from "../../packages/gateway-protocol/src/index.js" ;
1615import type { GatewayClient } from "../gateway/client.js" ;
16+ import { normalizeTerminalChatSendAckStatus } from "../shared/chat-send-ack-status.js" ;
1717import { createDeferredCore , type Deferred } from "../shared/deferred.js" ;
1818import { shortenHomePath } from "../utils.js" ;
1919import { extractAttachmentsFromPrompt , extractTextFromPrompt } from "./event-mapper.js" ;
@@ -44,15 +44,6 @@ type AcpPendingPromptAdmission = {
4444 settled : Deferred ;
4545} ;
4646
47- function isTerminalChatSendAckFailure ( status : unknown ) : boolean {
48- const normalized = normalizedChatSendAckStatus ( status ) ;
49- return normalized === "timeout" || normalized === "error" ;
50- }
51-
52- function isTerminalChatSendAckSuccess ( status : unknown ) : boolean {
53- return normalizedChatSendAckStatus ( status ) === "ok" ;
54- }
55-
5647function isAdminScopeProvenanceRejection ( err : unknown ) : boolean {
5748 if ( ! ( err instanceof Error ) ) {
5849 return false ;
@@ -301,7 +292,7 @@ export class AcpTranslatorPromptStream {
301292 return true ;
302293 } ;
303294 const applyTerminalAck = async ( ack : ChatSendAck | undefined ) : Promise < boolean > => {
304- const status = normalizedChatSendAckStatus ( ack ?. status ) ;
295+ const status = normalizeTerminalChatSendAckStatus ( ack ?. status ) ;
305296 const pending = ( ) => this . getPendingPrompt ( params . sessionId , runId ) ;
306297 if ( status === "timeout" ) {
307298 const current = pending ( ) ;
@@ -331,7 +322,7 @@ export class AcpTranslatorPromptStream {
331322 }
332323 return true ;
333324 }
334- return isTerminalChatSendAckFailure ( status ) || isTerminalChatSendAckSuccess ( status ) ;
325+ return false ;
335326 } ;
336327
337328 const sendChat = async ( payload : Record < string , unknown > ) : Promise < boolean > => {
0 commit comments