Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 15, 2026

Calling input_TOPP("IDFilter") multiple times caused widget key collisions in Streamlit session state, preventing the same tool from being used with different parameter configurations in a workflow.

Changes

  • StreamlitUI.input_TOPP(): Added optional tool_instance_name parameter

    • Generates unique widget keys using instance name instead of tool name
    • Displays instance identifier in UI (e.g., "IDFilter (IDFilter-strict)")
    • Stores _tool_name metadata for tool resolution
  • ParameterManager: Instance-aware parameter handling

    • _get_tool_name_from_instance(): Resolves actual tool name from instance or metadata
    • save_parameters(): Handles instance-specific parameter storage
    • get_topp_parameters(): Retrieves parameters by instance name
  • CommandExecutor.run_topp(): Added optional tool_instance_name parameter

    • Uses instance name for parameter lookup
    • Filters out metadata keys (prefix _) from command arguments

Usage

# Configure two instances with different thresholds
self.ui.input_TOPP("IDFilter", 
                   tool_instance_name="IDFilter-strict",
                   custom_defaults={"score:pep": 0.01})

self.ui.input_TOPP("IDFilter", 
                   tool_instance_name="IDFilter-lenient",
                   custom_defaults={"score:pep": 0.05})

# Execute with instance-specific parameters
self.executor.run_topp("IDFilter", {"in": files1, "out": out1}, 
                      tool_instance_name="IDFilter-strict")

self.executor.run_topp("IDFilter", {"in": files2, "out": out2},
                      tool_instance_name="IDFilter-lenient")

Backward compatible—omitting tool_instance_name maintains existing behavior.

Original prompt

This section details on the original issue you should resolve

<issue_title>Parameter error when using input_TOPP multiple times for the same TOPP tool.</issue_title>
<issue_description>Hi, I'm currently working on a DDA-TMT workflow, where IDFilter is used twice at different stages of the pipeline.
However, I ran into an issue in the parameter configuration UI:
calling input_TOPP("IDFilter") more than once causes a parameter-related error.
From the behavior, it seems that input_TOPP cannot be invoked multiple times
for the same TOPP tool within a single workflow configuration.

Is there a supported pattern for using the same TOPP tool multiple times with different parameters?

Image

</issue_description>

<agent_instructions>Please implement a non-breaking improvement to enable using TOPP tools with different configurations.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@coderabbitai
Copy link

coderabbitai bot commented Jan 15, 2026

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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

Copilot AI changed the title [WIP] Fix parameter error for multiple TOPP tool invocations Add tool_instance_name parameter to enable multiple TOPP tool configurations Jan 15, 2026
Copilot AI requested a review from t0mdavid-m January 15, 2026 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parameter error when using input_TOPP multiple times for the same TOPP tool.

2 participants