fix(flows): preserve literal tool-call markup in tool-less completions#4750
Conversation
…tion B) tinyhumansai#4727 straggler: tinyflows/caps.rs llm.complete now drives a crate ChatModel (create_chat_model_with_model_id + a create_chat_model_pinned rebuild for the node raw/BYOK override, tinyhumansai#4598) via ModelRequest/invoke, instead of create_chat_provider + provider.chat. Adds two reusable seam converters — chat_messages_to_model_messages (host history -> crate messages) and model_response_to_chat_response (crate response -> host {text, tool_calls, usage, reasoning_content}) — so the flows node's JSON output envelope is byte-identical. Core lib green; convert/factory/caps test modules clean. Claude-Session: https://claude.ai/code/session_018MnMVgnzxchtcs1DDUxTfF
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 37 seconds Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 16ae696494
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
# Conflicts: # src/openhuman/tinyflows/caps.rs
…atgpt-codex-connector on src/openhuman/tinyflows/caps.rs:550)
Summary
<tool_call>...</tool_call>examples in one-shot flow completions when no tools were advertised.mainsuperseded the ChatModel migration in feat(inference): Phase 3 P3-B — crate-native turn path + delete compatible*.rs [WIP] #4784.Problem
After the original ChatModel migration,
ProviderModelparsed tool-call markup from every text response. A tool-less flow prompt that legitimately requested a literal tool-call example therefore lost that text and surfaced a synthetic tool call instead.Solution
Text fallback parsing is now gated by whether
ModelRequest.toolsis non-empty. Native provider tool calls still take precedence. Regression tests cover both tool-less literal preservation and tool-enabled extraction.Submission Checklist
Validation
cargo fmt --manifest-path Cargo.toml -- --checkcargo check --manifest-path Cargo.tomlcargo check --manifest-path app/src-tauri/Cargo.tomlcargo test --manifest-path Cargo.toml --lib openhuman::tinyagents::model::g1_usage_testscargo test --manifest-path Cargo.toml --lib openhuman::tinyflows::caps::testsThe full unfiltered Rust suite is currently blocked by a pre-existing deterministic stack overflow in
openhuman::agent::harness::session::tests::turn_dispatches_spawn_subagent_through_full_path; the exact test fails identically when rerun alone.Impact