feat: simplify apply_tool_multiplex() using multiplex --flat mode - #869
Merged
Conversation
multiplex.py now provides a --flat mode (perftool-incubator/multiplex#111) purpose-built for consumers with no sets/include/cartesian-product concept. Tools always have exactly one implicit param set and, per schema/tool-params.json, never more than one value per param, so the previous wrap-into-sets-document/unwrap dance and the len(...) == 1 defensive check were ceremony around something structurally impossible. This writes the tool's flat params directly, invokes --flat, and reads the result back as-is -- filtering of disabled params and enforcement of exactly-one-combination now live inside multiplex.py itself. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
atheurer
approved these changes
Aug 17, 2026
atheurer
left a comment
Contributor
There was a problem hiding this comment.
Approved after thorough code review and local test suite verification (all 57 tests passed).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--flatmode (feat: repeatable-arg support, merge refactor, and --flat mode for tools multiplex#111, merged) is purpose-built for consumers with no sets/include/cartesian-product conceptschema/tool-params.json, never more than one value per param -- the previous wrap-into-sets-document/unwrap dance and thelen(...) == 1defensive check were ceremony around something structurally impossibleapply_tool_multiplex()now writes the tool's flat params directly, invokesmultiplex.py --flat, and reads the result back as-is; filtering of disabled params and enforcement of exactly-one-combination now live inside multiplex.py itselfTest plan
pytest tests/test_apply_tool_multiplex.py -v— 5 passed (rewritten for flat-mode shape; the now-impossibletest_more_than_one_combination_is_rejectedwas removed since that check moved into multiplex.py)pytest tests/— 57 passed, no regressions elsewhere🤖 Generated with Claude Code