Skip to content

fix(classifier): avoid forcing unsupported temperature#2

Open
tank-bohr wants to merge 1 commit into
czottmann:mainfrom
tank-bohr:fix/classifier-provider-errors
Open

fix(classifier): avoid forcing unsupported temperature#2
tank-bohr wants to merge 1 commit into
czottmann:mainfrom
tank-bohr:fix/classifier-provider-errors

Conversation

@tank-bohr

Copy link
Copy Markdown

Problem

Classifier calls currently force temperature: 0. Providers that do not support the parameter, including OpenAI Codex, reject the request before classification:

Unsupported parameter: temperature

pi-ai represents this as an assistant response with stopReason: "error". The classifier then treats the empty response body as malformed JSON, retries the same request, and reports a misleading invalid-JSON failure.

Changes

  • Use the provider's default temperature unless a caller explicitly configures one.
  • Fail closed immediately on provider-reported completion errors.
  • Preserve the provider error message in classifier I/O logs and the user-facing block reason.
  • Update classifier-flow and observability documentation.
  • Cover default and explicit temperature behavior plus provider-reported errors.

Verification

  • npm run check
  • npm test (65 tests)
  • npm pack --dry-run
  • Live classifier call through openai-codex/gpt-5.6-sol with no temperature override returned a valid allow decision.

Let classifier providers use their default temperature unless a caller explicitly supplies one. Some providers, including OpenAI Codex, reject the parameter entirely.

Treat provider-reported completion errors as classifier failures instead of retrying them as malformed JSON, and retain the provider message in classifier I/O logs.
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