Repository navigation
fix(booking-copilot): repair one schema-rejected provider tool call (#33640) - #671
Merged
Merged
Conversation
…ma validation (#33640)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One bounded repair retry after a schema-shaped rejection
hotel-be#33640: a real UAT turn failed with
PLANNER_PROVIDER_RESPONSE_INVALIDafterschemaRejectedCallCount=1,schemaRepairedValid=false. The provider emitted a tool call whose arguments missed the declared schema and then stopped; the planner treated that as terminal and surfaced a user-visible alert (~1/5 turns).Change
scanDshToolDecisionEventsin the attempt loop.isSchemaShapeError), consume one of the existing three attempts to retry on the same session with a repair prompt:isPlannerSafetyError/ non-schema errors rethrow unchanged). No unbounded loop: at most one repair retry per turn; the third attempt still surfaces the typed provider error.schemaRejectedCallCountaccumulates per run,schemaRepairedValidis true when a decision is accepted after a rejection.Tests
booking_search_hotelscall, second run returns the repaired call → decision accepted,schemaRepairRuns=2.invalidCrossRunRuns=2); a still-invalid repaired payload still rejects (test now expectsplanner_booking_intent_required), so a schema error still cannot be laundered into a valid action without a valid repaired payload.npx tsx scripts/booking-copilot-dsh-planner-proof-tests.ts→BOOKING COPILOT DSH PLANNER PROOF ... OK.booking-copilot-gateway-chat-adapter-tests.ts→ OK.runtime,dsh-core) fail in this clean worktree because child processes cannot resolvets/node_modules/tsx/dist/cli.mjs(pnpm layout), not from this change.Residual
schemaRejectedCallCountin the metric.