Skip to content

fix(provider): support optional System One boolean criteria - #11062

Merged
Soulter merged 1 commit into
AstrBotDevs:masterfrom
mothieras:fix/10920-system-one-criteria
Nov 18, 2026
Merged

Soulter merged 1 commit into
AstrBotDevs:masterfrom
mothieras:fix/10920-system-one-criteria

Conversation

@mothieras

@mothieras mothieras commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #10920.

The System One–compatible endpoint reported in #10920 requires both true and false in noul.criteria. AstrBot's connection test omits criteria, so the endpoint returns HTTP 400.

Modifications

  • Add optional criteria to DecisionBooleanQuestion. The System One adapter validates the supplied keys and descriptions before adding them to the request.
  • Send both criteria keys in the built-in connection test.
  • Add regression tests for the connection test and for boolean requests with one or both criteria keys.

The optional argument follows the maintainer's feedback on #10930.

Screenshots or test results

$ uv run --no-sync pytest -q tests/test_decision_provider.py --tb=short
37 passed, 1 warning in 3.11s

The connection-test regression reproduced HTTP 400 on the base revision using httpx.MockTransport. It passes with the patch. Ruff lint, the repository-wide format check, and git diff --check also passed.

Summary by Sourcery

Support optional boolean criteria in System One decision requests and include both outcomes in provider connection tests.

New Features:

  • Support optional true/false criteria for boolean decision questions sent to System One-compatible providers.

Bug Fixes:

  • Include both boolean criteria in the built-in provider connection test so endpoints requiring them no longer reject the request.

Tests:

  • Add regression coverage for connection tests and caller-supplied boolean criteria.

Allow callers to provide noul criteria and include both outcome keys in the connection test for System One-compatible endpoints that require them.

Verified with all 37 tests in tests/test_decision_provider.py.

Fixes AstrBotDevs#10920

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!

Linked issues

#10920 [Bug] 决策模型协议 SystemOne 的 noul 类型请求未兼容标准格式 · 1 of 2 met

# Requirement Status Notes
1 Include the required true/false criteria in noul requests. 🟡 Partly met Callers can supply criteria, but requests without them still omit the field; for example, DecisionService.yes_no constructs a boolean question without criteria.
2 Make the provider connection test work with endpoints that require criteria. ✅ Met The connection test now sends both true and false criteria.

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@Soulter Soulter moved this to In Progress in AstrBot Roadmap Nov 9, 2026
@Soulter
Soulter merged commit ef5a83f into AstrBotDevs:master Nov 18, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from In Progress to Done in AstrBot Roadmap Nov 18, 2026
@mothieras
mothieras deleted the fix/10920-system-one-criteria branch November 23, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Bug] 决策模型协议 SystemOne 的 noul 类型请求未兼容标准格式

2 participants