Skip to content

@tool(run_again=False): a tool whose form is not shown again after a completed run - #177

Merged
guijacquemet merged 2 commits into
mainfrom
claude/laughing-wright-s6cht3
Dec 4, 2026
Merged

guijacquemet merged 2 commits into
mainfrom
claude/laughing-wright-s6cht3

Conversation

@guijacquemet

Copy link
Copy Markdown
Contributor

Why

In Fiji, a tool's form comes back after each run started from the menu (LabConstrictor-Fiji issue #58). That's useful for quick tools, but after a long training (CAREamics N2V/CARE) a tester read the dialog reopening as something going wrong.

What

  • @tool("...", run_again=False): after a run that completes, a host that brings the form back (Fiji) doesn't show it again.
  • The schema carries "run_again": false only when it is set. A missing key keeps today's behaviour, so existing apps and older hosts are unaffected. A non-bool value raises TypeError.
  • check prints [form not shown again after a run] beside such a tool.
  • Docs: a MANIFEST.md "Behaviour" row, an AUTHORING.md recipe, a HOST_FEATURES.md row (napari and QuPath keep their form open, so there's nothing for them to do), and the PROTOCOL.md schema.
  • The example app's "Check this installation" uses it.
  • Test: test_introspection.test_run_again_false_is_in_the_schema_and_true_is_left_out.

Checks run

  • black --check ., ruff check ., scripts/check_annotations.py and vulture pass.
  • mypy reports 4 errors, in files this PR doesn't touch; the same 4 appear without the change.
  • Full unittest suite (local container): 4 failures (packaging wheel, compat matrix, hardening runtime path, a roundtrip-noise test). The same tests fail without this change, so they come from the container, not from the diff.

Related

  • Fiji honours it: CellMigrationLab/LabConstrictor-Fiji, branch claude/laughing-wright-s6cht3.
  • CAREamics training tools use it, with a fallback for older Tools.

No feature id was added: a host doesn't need to require it, because a missing key is the default.


Generated by Claude Code

…back after a completed run

For a tool seldom run twice in a row (a long training, a one-off check), Fiji
no longer shows its form again after a run that completed. The schema carries
"run_again": false only when set; a missing key keeps today's behaviour, so
older hosts and schemas are unaffected. napari and QuPath keep their form open
and have nothing to do. Documented in MANIFEST, AUTHORING, HOST_FEATURES and
PROTOCOL; `check` prints it; the example app uses it; a unit test covers it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AoUT3RtgWWsiVVarX
@guijacquemet
guijacquemet merged commit 8ae6d1b into main Dec 4, 2026
8 checks passed
@guijacquemet
guijacquemet deleted the claude/laughing-wright-s6cht3 branch December 4, 2026 09:00
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.

2 participants