Skip to content

fix(flows): update stale on_error:route dry-run test for tinyflows 0.5.1 validation (B14)#4664

Merged
graycyrus merged 1 commit into
tinyhumansai:mainfrom
graycyrus:fix/flows-dry-run-on-error-route-detection
Jul 7, 2026
Merged

fix(flows): update stale on_error:route dry-run test for tinyflows 0.5.1 validation (B14)#4664
graycyrus merged 1 commit into
tinyhumansai:mainfrom
graycyrus:fix/flows-dry-run-on-error-route-detection

Conversation

@graycyrus

@graycyrus graycyrus commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Why the coverage lane was red on every PR

flows::builder_tools::tests::dry_run_flags_tool_call_error_when_on_error_is_route has failed on clean main since #4608 bumped vendored tinyflows to 0.5.1 — reddening Rust Core Coverage → PR CI Gate on every open PR (repeatedly waved off as "pre-existing").

Root cause — a stale test, NOT an enforcement hole

tinyflows 0.5.1 (commit a6860bc) added a correct author-time rule: a node with on_error:"route" but no outgoing edge on its error port is rejected as an invalid graph (a route with nowhere to route is a dead end — tinyflows ships rejects/accepts_on_error_route_without/with_error_edge for it).

The test was written in #4586, before that rule, with an on_error:"route" node and no error-port edge. So validate_and_migrate_graph now rejects it up front and DryRunWorkflowTool maps the Err to ToolResult::error → the test's first assert!(!result.is_error) fails, never reaching the ok/node_errors assertions. The enforcement is fine (better, even).

Fix (test-only)

Give the test graph a real error-port destination — a no-op oh:noop recover sink + a from_port:"error" edge (the same convention as the neighboring dry_run_passes_when_tool_call_binds_to_upstream_tool_output). The graph is now valid → the dry-run runs → the missing required to arg is detected as intended (ok:false, node_errors:[post]). No production code changed.

Verification

flows:: 369 pass · tinyflows:: 95 pass · cargo check/fmt clean. This gets the coverage/PR-CI gate green again for all open PRs.

Summary by CodeRabbit

  • Tests
    • Expanded test coverage for routed error handling in dry-run flows.
    • Added a routed recovery path to validate behavior when a tool call sends errors to a follow-up step.
    • Clarified expected validation behavior for graphs that route errors without a valid outgoing error connection.

…5.1 validation (B14)

dry_run_flags_tool_call_error_when_on_error_is_route has failed on main since tinyhumansai#4608
bumped vendored tinyflows to 0.5.1, which pulled in a NEW author-time validation
(tinyflows a6860bc): a node with on_error:"route" but no outgoing edge on its `error`
port is rejected as an invalid graph before a run starts (a route with nowhere to
route is a dead end). The test was written in tinyhumansai#4586 — before that rule — with an
on_error:"route" node and no error-port edge, so validate_and_migrate_graph now
rejects it up front and DryRunWorkflowTool maps the Err to ToolResult::error, failing
the test's `assert!(!result.is_error)` before it ever reaches the ok/node_errors checks.

The new validation is correct + intentional (tinyflows has its own
rejects/accepts_on_error_route_without/with_error_edge tests) — so the fix is the TEST,
not the enforcement. Give the test graph a real error-port destination (a no-op
oh:noop `recover` sink + a from_port:"error" edge), matching
dry_run_passes_when_tool_call_binds_to_upstream_tool_output right above it. The graph
is now valid, the dry-run runs, and the missing required `to` arg is detected as
intended (ok:false, node_errors:[post]). No production code changed.

flows:: 369 pass; tinyflows:: 95 pass; cargo check/fmt clean. Unblocks the Rust Core
Coverage / PR CI Gate lane that this single test was reddening on every PR.
@graycyrus graycyrus requested a review from a team July 7, 2026 16:48
@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3154ce69-e290-45ae-9663-1ec90bdbc69b

📥 Commits

Reviewing files that changed from the base of the PR and between 67a6558 and 979cb11.

📒 Files selected for processing (1)
  • src/openhuman/flows/builder_tools_tests.rs

📝 Walkthrough

Walkthrough

A test graph in a Rust test file was updated to add a recover tool_call node and a routed edge from the post node's error port to recover, ensuring the test graph has a valid destination for routed errors. Inline comments were expanded accordingly.

Changes

Test fix for routed error handling

Layer / File(s) Summary
Add recover node and routed-error edge
src/openhuman/flows/builder_tools_tests.rs
Test graph JSON updated to add a recover tool_call node and an edge from post's error port to recover; inline comments expanded to explain why routed error graphs need this destination.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Possibly related PRs

Suggested labels: rust-core, bug

Poem

A rabbit hops through error's door,
Found post with nowhere to go before.
Now recover waits, a cozy den,
The routed path is whole again! 🐇
Hop, test, pass — repeat again~

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: updating a stale flows dry-run test for tinyflows 0.5.1 validation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

@coderabbitai coderabbitai Bot added bug rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure. labels Jul 7, 2026
@graycyrus graycyrus merged commit 7daa877 into tinyhumansai:main Jul 7, 2026
19 of 23 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in Team Openhuman Jul 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant