-
Notifications
You must be signed in to change notification settings - Fork 156
Open
Labels
bugSomething isn't workingSomething isn't workingcliChanges that impact CLI functionalityChanges that impact CLI functionality
Description
Bug description
Running thv stop on a workload started by thv run --foreground causes the workload to be removed from thv list --all results.
This is perceived as a bug, because stop is effectively acting as rm.
Steps to reproduce
thv run --foreground --name fetch-foreground fetch- In another shell:
thv stop fetch-foreground - Observe
thv list --alldoes not containfetch-foreground
Expected behavior
There are multiple acceptable behaviors:
thv stopcannot be run on foreground workloadsthv stopdoes not remove the state for the foreground workload, but stops it. In other words,thv list --allcontainsfetch-foregroundand it is in astoppedstatus.
Actual behavior
thv stop behaves like thv rm when executed against foreground workloads.
Environment (if relevant)
- OS/version: Mac Version 15.4.1
- ToolHive version: v0.6.11-42-g2b6a4a76
Additional context
This PR contains significant prior art: #2927 (review)
The problem is the --foreground process acts as the owner of the workload and will always remove the workload when it exits. This can be seen in the logs below:

Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingcliChanges that impact CLI functionalityChanges that impact CLI functionality