feat(split_out): support dotted paths so fan-out can reach nested arrays#4
Conversation
split_out did a single-level item.json.get(path), so it could not reach an array
nested inside a tool_call's {json,text,raw} envelope — e.g. GMAIL_FETCH_EMAILS
returns its list at data.messages, unreachable as a top-level key, so split emitted
a single null item and nulled the whole downstream fan-out.
resolve_dotted_path() now walks one object key per '.'-separated segment, so
path='json.data.messages' traverses envelope → tool result → the array. Backward
compatible: single-segment paths (path='items') are unchanged. Missing intermediate
key → Null (same as before). Bump 0.5.0 → 0.5.1.
📝 WalkthroughWalkthroughAdds a dotted-path resolution helper ( ChangesSplitOutNode Dotted Path Support
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/nodes/control_flow/split_out.rs (1)
13-32: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low valueFactor the dotted-path walk into one helper
There’s duplicated dotted-path traversal in
src/nodes/control_flow/split_out.rsandsrc/expr.rs::resolve_path. If these semantics should stay identical, extract a shared helper instead of maintaining two copies.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@src/nodes/control_flow/split_out.rs` around lines 13 - 32, The dotted-path traversal logic is duplicated between split_out’s resolve_dotted_path and expr::resolve_path, so update the code to use one shared helper for path walking. Extract the common dotted-path resolution behavior into a reusable function or utility, then have both split_out and expr::resolve_path call it so the semantics stay identical in one place. Keep the existing handling for single-segment keys, missing segments returning Null, and nested object traversal unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@src/nodes/control_flow/split_out.rs`:
- Around line 13-32: The dotted-path traversal logic is duplicated between
split_out’s resolve_dotted_path and expr::resolve_path, so update the code to
use one shared helper for path walking. Extract the common dotted-path
resolution behavior into a reusable function or utility, then have both
split_out and expr::resolve_path call it so the semantics stay identical in one
place. Keep the existing handling for single-segment keys, missing segments
returning Null, and nested object traversal unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a7bdfc89-d19d-4e12-b61e-b27f44bee9f3
📒 Files selected for processing (2)
Cargo.tomlsrc/nodes/control_flow/split_out.rs
…split_out) tinyhumansai/tinyflows#4 squash-merged; pin to the main commit instead of the feature-branch commit so CI resolves the submodule cleanly.
split_outdid a single-levelitem.json.get(path), so it couldn't reach an array nested inside atool_call's{json,text,raw}envelope — e.g.GMAIL_FETCH_EMAILSreturns its list atdata.messages, unreachable as a top-level key, so split emitted a singlenullitem and nulled the whole downstream fan-out.resolve_dotted_path()now walks one object key per.-separated segment, sopath="json.data.messages"traverses envelope → tool result → the array. Backward compatible: single-segment paths (path="items") unchanged; missing intermediate key →Null(as before). Bump 0.5.0 → 0.5.1.Consumed by OpenHuman's Workflows builder, which now grounds
split_out.pathin the tool's real nested output path.Summary by CodeRabbit
New Features
Bug Fixes
nullresult instead of failing or returning unexpected data.Chores
0.5.1.