mirror of
https://github.com/stablyai/orca.git
synced 2026-10-23 00:03:52 +00:00
revert: drop the unmarked-echo warning
Measured on claude 2.1.237: interrupting a turn while a send is queued emits a top-level user frame carrying `[Request interrupted by user for tool use]` with no `isReplay` AND no `tool_use_result` - so it cleared every guard and made a perfectly healthy CLI log "sends will report delivery unconfirmed until the CLI stamps the marker". A false diagnosis. Worse, the one-shot latch is process-wide, so that one healthy interrupt permanently consumed the signal and a genuinely unmarked CLI could then never report itself. The warning was less than useless. Diagnosing this properly means warning only when a waiter actually times out having seen unmarked frames - more state in the function whose extra state has been the source of every defect in this review loop. The flag pin from the same round is the part that carries real weight; a real-binary assertion is the right complement and is recorded as follow-up. Found by the review loop on #15657.
This commit is contained in:
@@ -78,36 +78,11 @@ function isClaudeUserMessageReplay(message: Record<string, unknown>): boolean {
|
||||
return message.type === 'user' && message.parent_tool_use_id === null && message.isReplay === true
|
||||
}
|
||||
|
||||
let warnedAboutMissingReplayMarker = false
|
||||
|
||||
/** A CLI that echoes without the marker cannot be told apart at runtime from a
|
||||
* turn that simply had no boundary inside the ack budget: both just report
|
||||
* "delivery unconfirmed". Say it once so the cause is diagnosable. */
|
||||
function warnIfEchoLacksReplayMarker(message: Record<string, unknown>): void {
|
||||
if (
|
||||
warnedAboutMissingReplayMarker ||
|
||||
message.type !== 'user' ||
|
||||
message.parent_tool_use_id !== null ||
|
||||
message.isReplay !== undefined ||
|
||||
message.tool_use_result !== undefined
|
||||
) {
|
||||
return
|
||||
}
|
||||
warnedAboutMissingReplayMarker = true
|
||||
console.warn(
|
||||
'[claude-structured] user frame arrived without isReplay while a send was waiting; ' +
|
||||
'sends will report delivery unconfirmed until the CLI stamps the marker'
|
||||
)
|
||||
}
|
||||
|
||||
export function resolveClaudeReplayWaiter(
|
||||
session: ClaudeSession,
|
||||
message: Record<string, unknown>
|
||||
): void {
|
||||
const isUserReplay = isClaudeUserMessageReplay(message)
|
||||
if (!isUserReplay && session.dispatchWaiters.length > 0) {
|
||||
warnIfEchoLacksReplayMarker(message)
|
||||
}
|
||||
const isCompletedCommand = message.type === 'result'
|
||||
if (
|
||||
(!isUserReplay && !isCompletedCommand) ||
|
||||
|
||||
Reference in New Issue
Block a user