Skip to content

v1.3.5

Choose a tag to compare

@cryxnet cryxnet released this 16 Oct 12:30
· 14 commits to main since this release

A patch release. Upgrade with pip install -U promptise.

Highlights: a code-action run that cannot fit its tool-call budget now raises CodeActionBudgetError instead of answering from partial data, and the model is no longer told the cap in a way that makes it cut its own work short; MCP server audit entries carry the error code the client received (ACCESS_DENIED vs AUTHENTICATION_ERROR and so on). Read Changed before upgrading.

Fixed

  • Code-action: a max_tool_calls too small for the job gave a wrong answer, not an error -- the prompt said "the program may make at most N function calls ... so plan the calls you need", so models counted their own calls and stopped early (if calls >= 50: break, orders = orders[:49]): the program never reached the cap, exited cleanly, and its partial result was the answer (3 of 46 benchmark programs did this at the default budget). And after a program did reach the cap, the repair asked for "a program that needs at most N calls", so the model wrote one that read only the first N records, which succeeded (5 of 5 runs of the guide's max_tool_calls=20 demo answered wrong, none raised). The prompt now says each program has a call cap but not its value, and tells the model never to skip, sample or truncate records, never to count its calls, and to let ToolBudgetExceeded raise; the error a refused call raises in the program no longer gives the value either. The repair after a budget hit asks for a program that does the whole job with fewer calls (batch tools, no repeated fetches) or the reply CANNOT_FINISH_WITHIN_CALL_CAP. That reply, or a budget hit with no repair left, raises the new CodeActionBudgetError (see Changed). An answer from a program written after a budget hit is logged at WARNING. Promptise still cannot tell whether a program that stays within the cap read all the data; the guide says so.
  • Audit log: a role or guard denial was recorded as an authentication failure -- a guard denial raises AuthenticationError with code="ACCESS_DENIED", and the client got ACCESS_DENIED, but AuditMiddleware recorded only error: "AuthenticationError: ...", so a verified caller without the role read exactly like a failed login, and anyone counting failed logins with error.startswith("AuthenticationError") counted every denial. An entry for a call that raised an MCPError now also has error_code, the code the client received (ACCESS_DENIED, AUTHENTICATION_ERROR, VALIDATION_ERROR, RATE_LIMIT_EXCEEDED, TOOL_ERROR, ...). error is unchanged. error_code is inside the HMAC chain; logs written by earlier versions have no error_code, still verify, and a 1.3.5 server continues their chain. The audit docs now also say that with require_auth=True, a request with a missing or invalid token is rejected with 401 by the HTTP gate before the MCP layer, so it is only in the HTTP access log, never in the audit log (by design, unchanged).

Changed

  • New CodeActionBudgetError (promptise.engine) -- a code-action run that cannot do the job within max_tool_calls raises it, with max_tool_calls, attempts and report. It is a GraphExecutionError, so existing handlers still catch it; budget failures that raised a plain GraphExecutionError in 1.3.4 raise this subclass. The code-action prompt and repair message changed (see Fixed): a model that would have answered from part of the data now ends the run with this error.

Full changelog: https://github.com/promptise-com/Foundry/blob/main/CHANGELOG.md