fix(ulw-loop): add fallback for Oracle verification session tracking

The verification_session_id was never reliably set because the
prompt-based attempt_id matching in tool-execute-after depends on
metadata.prompt surviving the delegate-task execution chain. When
this fails silently, the loop never detects Oracle's VERIFIED
emission.

Add a fallback: when exact attempt_id matching fails but oracle
agent + verification_pending state match, still set the session ID.
Add diagnostic logging to trace verification flow failures.
Add integration test covering the full verification chain.
This commit is contained in:
YeonGyu-Kim
2026-03-17 16:20:27 +09:00
parent 78dac0642e
commit 4bc7b1d27c
5 changed files with 220 additions and 44 deletions
+6
View File
@@ -79,6 +79,12 @@ export function createToolExecuteBeforeHandler(args: {
if (shouldInjectOracleVerification) {
const verificationAttemptId = randomUUID()
log("[tool-execute-before] Injecting ULW oracle verification attempt", {
sessionID: input.sessionID,
callID: input.callID,
verificationAttemptId,
loopSessionID: loopState.session_id,
})
writeState(ctx.directory, {
...loopState,
verification_attempt_id: verificationAttemptId,