Skip to content

feat: a product whose CLI has no run says so; the diagram then offers no Run - #128

Open
endrix wants to merge 2 commits into
mainfrom
feat/run-driver-opt-out
Open

endrix wants to merge 2 commits into
mainfrom
feat/run-driver-opt-out

Conversation

@endrix

@endrix endrix commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Phase 5 of the declutter plan, third step. Cut from main; independent of the other open PRs. Expected overlap: #124 moves DiagramClientBehavior into @dialogram/shared; whichever lands second carries the new runDriver field across (one line, plus the ProductClientBehavior omit list).

The defect

The toolkit registered CliRunDriver for every sidecar product, and tool-palette-header-controls.ts added Run and Stop ("Run workflow") to every diagram's palette header. Where nothing runs the diagram, the buttons still did something:

  • ndf-ide: its CLI has no run (subcommands: build, check, show, trace, query, report, diff, impact, export, id, fix, diagram, pto-release, coverage, dependencies, allocate), and its profile says "Run driver: there is none". Run invoked ndf run <doc>.md --out-dir wf-out --keep-intermediates ....
  • chisel-ide, the library-mode mlir-viewer, read-only profiles: no run driver at all; Run invoked a command nothing registered.

sv and vhdl are not affected: hdl-sidecar's hdl run "simulates a unit through its testbench; the platform's run driver calls this". (The declutter review had listed them as runless; that was wrong.)

The change

  • SidecarProfileInput.cliRuns?: boolean, default true. false builds no run driver, no resume_failed_run chat tool, and no resumeAtStep.
  • The host derives clientBehavior.runDriver from DiagramProfile.runDriver being present, next to chatBackend, and derives resumeAtStep with it (true only when the product claims it and a driver exists); a product's own values are overwritten.
  • The palette header adds Run, Stop and the edge toggle ("what the run put on the edges") only when runHeaderControls() says so (runDriver !== false), and the property panel shows the Agent Tools switches, whose set/getAgentToolConfig only the driver registers, only when offersRun(). A webview the host did not describe keeps them as before. "Rerun from here" and the stepper's resume follow the derived resumeAtStep.

ndf-ide then sets cliRuns: false and drops its runWorkflow command contribution and eight run settings, in its own PR once this lands (its profile cannot name the field before it exists). Dropping the run setting keys and command ids from its profile also needs #120, which makes them optional.

Tests

Toolkit: runDriver: false gives no driver, no resume tool, no resumeAtStep. Host: the derived flag follows the profile and overrides a product's value; the pinned webview HTML gains "runDriver":false. Client: offersRun() follows the flag and defaults to offering; the header asks it before adding either button. The twin test lists the new derived field.

Typecheck 5/5, neutrality 5/5, client 364, extension-core 333, extension build green.

From the review

Taken: resumeAtStep derived with the driver (a hand-built profile could offer "Rerun from here" with nothing to run it); the edge toggle and the Agent Tools switches gated with Run and Stop; the input renamed cliRuns so it no longer shares a name with the profile's factory; the driver closure built only when it runs; a pure runHeaderControls() tested instead of a regex over the source (the client tests have no DOM, and adding one would add dependencies); the host's derived-behaviour tests in one file. Corrected: the changelog no longer claims read-only toolkit profiles lose Run (none exists in-tree; a read-only one keeps the default like any other). Left for #120: the run setting keys are still required on main.

https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv

… no Run

Phase 5 of the declutter plan, third step. The toolkit registered the
CLI run driver for every sidecar product, and the palette header showed
Run and Stop for every diagram. In ndf, whose CLI has no `run`, Run
invoked `ndf run <doc> --out-dir wf-out ...`; in chisel-ide, the
library-mode mlir-viewer and read-only profiles it invoked a command
nothing registered.

SidecarProfileInput.runDriver: false registers no driver and offers no
resume. The host derives clientBehavior.runDriver from the profile, as
it does chatBackend, and the header adds Run and Stop only when it is
not false. sv and vhdl keep their driver: `hdl run` simulates through
it.

Claude-Session: https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv
The host derives resumeAtStep with runDriver, so a hand-built profile
that claims resuming but has no driver offers no "Rerun from here" and
no stepper resume, both of which call runWorkflow. The edge toggle (what
a run puts on the edges) and the Agent Tools switches, whose two
commands only the run driver registers, go with Run and Stop. The input
flag is cliRuns, so it no longer shares a name with the profile's run
driver factory; the toolkit builds the driver only when the CLI runs.
The header's choice is one pure function the test checks, instead of a
regex over the source; the derived-behaviour host tests share one file.

Claude-Session: https://claude.ai/code/session_01EToj6RJRMSSHQiqGNMU9wv
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.

1 participant