Skip to content

feat(model): ✨ Add reasoning content constrained capability - #146

Merged
jorben merged 3 commits into
masterfrom
fix/reasoning-content-constrained
Apr 28, 2026
Merged

feat(model): ✨ Add reasoning content constrained capability#146
jorben merged 3 commits into
masterfrom
fix/reasoning-content-constrained

Conversation

@jorben

@jorben jorben commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add reasoningContentConstrained model capability through settings and run model plan DTOs.
  • Pass constrained reasoning capability into runtime OpenAI-compatible model compatibility.
  • Update tiycore to 0.2.2-rc.26042811 and sync Cargo.lock.

Test Plan

  • cargo check --manifest-path src-tauri/Cargo.toml

🤖 Generated with TiyCode

@github-actions

github-actions Bot commented Apr 28, 2026

Copy link
Copy Markdown

AI Code Review Summary

PR: #146 (feat(model): ✨ Add reasoning content constrained capability)
Preferred language: English

Overall Assessment

No blocking issue was detected in the reviewed diff; keep focused regression testing before merge.

Major Findings by Severity

No major issues identified from the reviewed diff.

Actionable Suggestions

  • Add reasoning_content_constrained to the production Rust struct in src-tauri/src (likely under model/ or extensions/) with #[serde(default)] or Option type to match the TS optional field.
  • If tiycore 0.2.2-rc.26042811 has API changes, update callers accordingly.
  • Run cargo test --manifest-path src-tauri/Cargo.toml to confirm all tests pass with the new field and dependency version.

Potential Risks

  • Production Rust struct missing the new field leads to silent value loss in agent plan roles.
  • tiycore version bump introduces unreported API breakage.

Test Suggestions

  • Add a serialization round-trip test for RunModelPlanRoleDto in Rust to ensure the new field survives deserialization.
  • Add a test that sets reasoning_content_constrained to true/false in a plan role and verifies it is persisted and returned.

File-Level Coverage Notes

  • src-tauri/src/core/settings_manager.rs: The addition of reasoning_content_constrained override in catalog_capability_overrides is consistent with existing capability override logic and properly guarded by the flag. Test coverage is adequate.
  • src-tauri/src/core/agent_session_types.rs: The new optional field with serde(default) is a backward-compatible addition. No issues.
  • src-tauri/src/core/agent_session.rs: The compat propagation from role to builder correctly handles the new flag, defaulting to false when not set. The mutation of compat via 'mut' is safe and minimal.
  • src-tauri/src/core/agent_session_tests.rs: New test coverage is comprehensive, covering constrained, unconstrained, and unspecified cases. Test setup follows existing patterns.
  • src/modules/settings-center/model/run-model-plan.ts: ok (Added reasoningContentConstrained field to the role projection. The nullish coalescing (?? null) correctly handles undefined capability values.)
  • src/modules/settings-center/model/run-model-plan.test.ts: ok (Two new test cases cover: (1) override propagation and fallback to null for non-overridden model, and (2) default null when capability is undefined. Coverage is sufficient.)
  • src/modules/settings-center/model/types.ts: ok (Optional boolean field added to ProviderModelCapabilities. Backward-compatible change.)
  • src/shared/types/api.ts: No testing risks. The new field is optional and nullable; existing tests should not be affected by this interface-only change.
  • src-tauri/src/commands/thread.rs: Test fixture updated correctly to include the new field with None default.
  • src-tauri/src/commands/git.rs: Test fixture updated correctly. The new field is set to None, preserving existing test behavior.
  • src-tauri/Cargo.toml: Dependency version bump only. No testing impact at the unit level; integration tests should still pass with the updated tiycore version. (Ensure 'cargo test' passes after the version change.)

Inline Downgraded Items (processed but not inline)

  • None

Coverage Status

  • Target files: 11
  • Covered files: 11
  • Uncovered files: 0
  • No-patch/binary covered as file-level: 0
  • Findings with unknown confidence (N/A): 0

Uncovered list:

  • None

No-patch covered list:

  • None

Runtime/Budget

  • Rounds used: 1/4
  • Planned batches: 3
  • Executed batches: 3
  • Sub-agent runs: 4
  • Planner calls: 1
  • Reviewer calls: 4
  • Model calls: 5/64
  • Structured-output summary-only degradation: NO

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated PR review completed.

  • Findings kept: 4
  • Findings with unknown confidence: 0
  • Inline comments attempted: 4
  • Target files: 10
  • Covered files: 10
  • Uncovered files: 0
    See the summary comment for detailed analysis and coverage details.

}

if let Some(compat) = default_openai_compatible_compat(&role.provider_type) {
if let Some(mut compat) = default_openai_compatible_compat(&role.provider_type) {

This comment was marked as outdated.


if let Some(compat) = default_openai_compatible_compat(&role.provider_type) {
if let Some(mut compat) = default_openai_compatible_compat(&role.provider_type) {
if let Some(true) = role.reasoning_content_constrained {

This comment was marked as outdated.

overrides.insert("embedding".to_string(), serde_json::Value::Bool(true));
}

if model.reasoning_content_constrained {

This comment was marked as outdated.

maxOutputTokens: model.maxOutputTokens ?? null,
supportsImageInput: capabilities.vision,
supportsReasoning: capabilities.reasoning,
reasoningContentConstrained: capabilities.reasoningContentConstrained ?? null,

This comment was marked as outdated.

jorben added 2 commits April 28, 2026 13:03
…del resolution

Add support for the `reasoningContentConstrained` capability override, ensuring it is correctly propagated from model metadata through to the runtime model plan. This flag indicates whether a model's reasoning output is constrained (e.g., for compatible providers where the model handles reasoning natively).

- Introduced `catalog_capability_overrides` logic to include `reasoningContentConstrained` when set to true
- Updated `resolve_runtime_model_role` to set the compat flag based on model metadata
- Added corresponding frontend logic to propagate the override from capability overrides to the run plan
- Covered all paths with unit tests for Rust and TypeScript layers

Closes: #458

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated PR review completed.

  • Findings kept: 0
  • Findings with unknown confidence: 0
  • Inline comments attempted: 1
  • Target files: 11
  • Covered files: 11
  • Uncovered files: 0
    See the summary comment for detailed analysis and coverage details.

Comment thread src-tauri/Cargo.toml
@@ -54,7 +54,7 @@ keepawake = "0.6"
portable-pty = "0.9"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Automated review completed for this PR diff. No concrete inline issue was selected after aggregation.

@jorben
jorben merged commit 761e317 into master Apr 28, 2026
4 checks passed
@jorben
jorben deleted the fix/reasoning-content-constrained branch April 28, 2026 05:18
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