fix(tools): ignore exec node param when no nodes are connected#474
fix(tools): ignore exec node param when no nodes are connected#474
Conversation
Models (especially weaker ones like Qwen3-Coder) hallucinate values for the `node` parameter even when it is hidden from the tool schema, causing repeated "node not found" errors before eventually passing null. Two defensive changes: - Filter empty/whitespace-only node strings so `""` is treated as absent - Guard node routing behind `has_connected_nodes()` so hallucinated node values silently fall through to local execution when no nodes exist Entire-Checkpoint: c2261f950302
Greptile SummaryThis PR fixes model hallucination of the Key changes:
Confidence Score: 4/5
Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[execute called] --> B[Extract model_node from params\nfilter empty/whitespace]
B --> C{node_provider\npresent?}
C -- No --> H[node_ref = None]
C -- Yes --> D{has_connected_nodes?}
D -- Yes --> E[node_ref = model_node\nOR default_node]
D -- No --> F{default_node\nconfigured?}
F -- Yes --> G[Return error:\ndefault node unavailable]
F -- No --> I{model_node\npresent?}
I -- Yes --> J[debug log: ignoring\nmodel-supplied node]
I -- No --> H
J --> H
E --> K{node_ref\nresolved?}
H --> L[Local / sandbox execution]
K -- resolve_node_id returns Some --> M[Remote node execution]
K -- resolve_node_id returns None --> N[Return error:\nnode not found]
Reviews (2): Last reviewed commit: "fix(tools): error on configured default_..." | Re-trigger Greptile |
Merging this PR will not alter performance
Comparing Footnotes
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
…ilent fallthrough Address review feedback: distinguish model-hallucinated node values (silently ignored) from admin-configured default_node (errors clearly when no nodes are connected). Add test for the default_node case. Entire-Checkpoint: 8b5b14566dc7
Summary
Fixes #427 — models (especially weaker ones like Qwen3-Coder) hallucinate values for the
nodeparameter on theexectool even when it's hidden from the schema, causing repeated "node not found" errors before eventually passingnull.nodestrings so""or" "are treated as absenthas_connected_nodes()so hallucinated node values silently fall through to local execution when no nodes existValidation
Completed
cargo +nightly-2025-11-30 fmt --all -- --checkcargo +nightly-2025-11-30 clippy -p moltis-tools --all-targets -- -D warningscargo test -p moltis-tools -- exec::tests(35 tests pass)Remaining
./scripts/local-validate.shcargo testManual QA
nodeparam (e.g. Qwen3-Coder-Next-FP8)