Fix tool_instance_name resolution in save_parameters and support multiple TOPP tool instances#354
Draft
Fix tool_instance_name resolution in save_parameters and support multiple TOPP tool instances#354
Conversation
Copilot
AI
changed the title
[WIP] [Bug] Fix parameter loading failure in tool_instance_name implementation
Fix tool_instance_name resolution in save_parameters and support multiple TOPP tool instances
Mar 14, 2026
Resolves the issue where multiple instances of the same TOPP tool could not have independent custom defaults. The .ini file (keyed by tool name) only supported one set of defaults — the first instance's defaults were baked in and subsequent instances were silently ignored. Changes: - Add get_merged_params() to ParameterManager for centralized three-layer parameter resolution (ini defaults < _defaults < user overrides) - Replace .ini file mutation with _defaults seeding in params.json, keyed by tool instance name - Update save_parameters() to compare against _defaults when determining which values are non-default - Update run_topp() and non_default_params_summary() to use merged params - Resolve instance names to real tool names across save_parameters, input_TOPP, run_topp, and get_topp_parameters
2d23b57 to
5949251
Compare
The .ini file is no longer mutated with custom defaults — it stays pristine. All parameters (_defaults + user overrides) are already passed as CLI flags via get_merged_params(), making -ini redundant.
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.
save_parameterspasses tool instance names (e.g.,"IDFilter_step1") directly tocreate_ini, which tries to execute them as binaries and fails. The instance name needs to be resolved back to the real tool name ("IDFilter") before callingcreate_ini.Changes
StreamlitUI.input_TOPP— Addedtool_instance_nameparameter. Registersinstance_name → tool_namemapping inst.session_state["_topp_tool_instance_map"]. Uses instance name for session state keys, real tool name for ini operations.ParameterManager.save_parameters— Resolves instance names via the mapping before callingcreate_iniand loading ini files. Mapsini_keyback to real tool name format forparam.getValue()lookups. Stores params under instance name in JSON.CommandExecutor.run_topp— Addedtool_instance_nameparameter for JSON param lookup, keeping real tool name for the executable and ini path.ParameterManager.get_topp_parameters— Added optionaltool_instance_namefor instance-aware param retrieval.Usage
All parameters default to backward-compatible behavior when
tool_instance_nameis omitted.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.