Skip to content

Add tool_instance_name parameter to enable multiple TOPP tool configurations - #303

Open
t0mdavid-m with Copilot wants to merge 7 commits into
mainfrom
copilot/enable-multiple-topp-invocations
Open

Add tool_instance_name parameter to enable multiple TOPP tool configurations#303
t0mdavid-m with Copilot wants to merge 7 commits into
mainfrom
copilot/enable-multiple-topp-invocations

Conversation

Copilot AI commented Jan 15, 2026

Copy link
Copy Markdown
Contributor

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

coderabbitai Bot commented Jan 15, 2026

Copy link
Copy Markdown

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 and others added 5 commits January 15, 2026 06:16
…parameter

Co-authored-by: t0mdavid-m <57191390+t0mdavid-m@users.noreply.github.com>
Co-authored-by: t0mdavid-m <57191390+t0mdavid-m@users.noreply.github.com>
Co-authored-by: t0mdavid-m <57191390+t0mdavid-m@users.noreply.github.com>
…a keys

Co-authored-by: t0mdavid-m <57191390+t0mdavid-m@users.noreply.github.com>
Co-authored-by: t0mdavid-m <57191390+t0mdavid-m@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix parameter error for multiple TOPP tool invocations Jan 15, 2026
Copilot AI requested a review from t0mdavid-m January 15, 2026 06:24
@hjn0415a

Copy link
Copy Markdown
Contributor

After adding the tool_instance_name parameter, there are no UI errors anymore, so it seems the issue has been resolved on the UI side. However, the analysis results are not coming out correctly, so I am currently looking into that.

@t0mdavid-m

Copy link
Copy Markdown
Member

Thanks! Is the parameter parsing working?

@t0mdavid-m
t0mdavid-m marked this pull request as ready for review March 14, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants