Skip to content

fix: signal ask_user execution failures - #53

Open
MDGChamomile wants to merge 1 commit into
edlsh:mainfrom
MDGChamomile:fix/tool-error-contract
Open

fix: signal ask_user execution failures#53
MDGChamomile wants to merge 1 commit into
edlsh:mainfrom
MDGChamomile:fix/tool-error-contract

Conversation

@MDGChamomile

Copy link
Copy Markdown

Summary

  • throw for malformed options, unavailable UI, and UI execution failures
  • render thrown tool failures using Pi's renderer error context
  • update regression tests and the changelog

Why

Pi only marks a custom tool execution as failed when execute() throws. Returning an object with isError: true does not set the tool result error flag, so these three ask_user failure paths were emitted as successful executions.

See Pi's custom tool error contract.

Verification

  • tsc --noEmit --strict --skipLibCheck --module esnext --moduleResolution bundler --target es2022 index.ts
  • test sources type-check with Bun types
  • targeted runtime smoke checks for all three rejection paths, lifecycle cleanup, and error rendering
  • npm pack --dry-run

The full Bun test suite was not run locally because Bun is unavailable in this environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant