From ce230db275cb36685598997287801570ae538781 Mon Sep 17 00:00:00 2001 From: Erik Kotsiuba Date: Tue, 11 Aug 2026 22:58:27 +0200 Subject: [PATCH] fix: surface unanswered ask_user questions --- docs/contract.md | 2 +- src/result-format.ts | 10 ++++++ tests/result.test.ts | 78 ++++++++++++++++++++++++++++++++++++++++++-- 3 files changed, 87 insertions(+), 3 deletions(-) diff --git a/docs/contract.md b/docs/contract.md index d8ea07f..2b45f00 100644 --- a/docs/contract.md +++ b/docs/contract.md @@ -165,7 +165,7 @@ This document defines the stable external behavior. It does not explain internal - semantically invalid payloads that reach tool execution return `error.kind === "invalid_input"` with structured `issues` and a transcript-friendly `Invalid ask_user payload:` message; their rendered status is `Invalid tool payload` - payloads missing schema-required fields fail Pi's schema validation before tool execution and use Pi's standard tool-error result without structured `details` - `mode: "submit"` is normal completion; `mode: "elaborate"` means the user asked the agent to continue with follow-up clarification based on notes -- unanswered questions are omitted from `answers` +- unanswered questions are omitted from `answers`, but non-cancelled submitted result text includes `