fix(prompt-gate): harden internal prompt dispatch

This commit is contained in:
YeonGyu-Kim
2026-05-19 16:02:18 +09:00
parent 6c63372ef9
commit 1492bffd20
49 changed files with 1488 additions and 141 deletions
@@ -0,0 +1,27 @@
import { describe, expect, test } from "bun:test"
import { isAmbiguousPromptDispatchFailure } from "./prompt-failure-classifier"
describe("prompt failure classifier", () => {
test("#given prompt dispatch reports a generic JSON parse error #when classifying ambiguity #then it treats the dispatch as possibly accepted", () => {
// given
const error = new Error("JSON Parse error: Unexpected end of JSON input")
// when
const ambiguous = isAmbiguousPromptDispatchFailure(error)
// then
expect(ambiguous).toBe(true)
})
test("#given prompt dispatch timeout casing varies #when classifying ambiguity #then it treats the dispatch as possibly accepted", () => {
// given
const error = "PromptAsync Timed Out after 30000ms"
// when
const ambiguous = isAmbiguousPromptDispatchFailure(error)
// then
expect(ambiguous).toBe(true)
})
})