Skip to content

fix(flows): preserve literal tool-call markup in tool-less completions#4750

Merged
senamakel merged 4 commits into
tinyhumansai:mainfrom
senamakel:feat/flows-completion-chatmodel
Jul 14, 2026
Merged

fix(flows): preserve literal tool-call markup in tool-less completions#4750
senamakel merged 4 commits into
tinyhumansai:mainfrom
senamakel:feat/flows-completion-chatmodel

Conversation

@senamakel

@senamakel senamakel commented Jul 9, 2026

Copy link
Copy Markdown
Member

Summary

Problem

After the original ChatModel migration, ProviderModel parsed 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.tools is 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 -- --check
  • cargo check --manifest-path Cargo.toml
  • cargo check --manifest-path app/src-tauri/Cargo.toml
  • cargo test --manifest-path Cargo.toml --lib openhuman::tinyagents::model::g1_usage_tests
  • cargo test --manifest-path Cargo.toml --lib openhuman::tinyflows::caps::tests
  • Pre-push: Prettier, ESLint, TypeScript compile, Tauri Rust check

The 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

  • Platforms: core behavior used by desktop/web/CLI flow execution.
  • Behavior: tool-less completions retain literal markup; tool-enabled completions continue extracting calls.
  • Compatibility: no persistence or RPC schema changes.

…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
@senamakel senamakel requested a review from a team July 9, 2026 15:26
@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 37 seconds

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: b13fd43e-37c8-4ab2-8b9c-9364b46d4503

📥 Commits

Reviewing files that changed from the base of the PR and between e0a7b66 and dd2dee7.

📒 Files selected for processing (1)
  • src/openhuman/tinyagents/model.rs

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment thread src/openhuman/tinyflows/caps.rs Outdated
@senamakel senamakel self-assigned this Jul 14, 2026
@senamakel senamakel changed the title refactor(flows): migrate agent-node completion to crate ChatModel (#4727) fix(flows): preserve literal tool-call markup in tool-less completions Jul 14, 2026
@senamakel senamakel merged commit bc6e494 into tinyhumansai:main Jul 14, 2026
24 of 26 checks passed
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