proxy: extend /running endpoint with additional process data (#474)

Extend the /running endpoint to return more details about running
processes beyond just model and state.

- add cmd field to show the command being executed
- add proxy field to show the proxy URL
- add ttl (UnloadAfter) for automatic unloading configuration
- add name and description for model metadata
- update tests to verify new fields are returned correctly

fixes #471
This commit is contained in:
Benson Wong
2026-01-19 17:37:00 -08:00
committed by GitHub
parent 14207f8492
commit 205efd40a1
2 changed files with 19 additions and 4 deletions
+5
View File
@@ -930,6 +930,11 @@ func (pm *ProxyManager) listRunningProcessesHandler(context *gin.Context) {
runningProcesses = append(runningProcesses, gin.H{
"model": process.ID,
"state": process.state,
"cmd": process.config.Cmd,
"proxy": process.config.Proxy,
"ttl": process.config.UnloadAfter,
"name": process.config.Name,
"description": process.config.Description,
})
}
}
+10
View File
@@ -674,6 +674,11 @@ func TestProxyManager_RunningEndpoint(t *testing.T) {
Running []struct {
Model string `json:"model"`
State string `json:"state"`
Cmd string `json:"cmd"`
Proxy string `json:"proxy"`
TTL int `json:"ttl"`
Name string `json:"name"`
Description string `json:"description"`
} `json:"running"`
}
@@ -721,6 +726,11 @@ func TestProxyManager_RunningEndpoint(t *testing.T) {
// Is the model loaded?
assert.Equal(t, "ready", response.Running[0].State)
// Verify extended fields are present
assert.NotEmpty(t, response.Running[0].Cmd, "cmd should be populated")
assert.NotEmpty(t, response.Running[0].Proxy, "proxy should be populated")
assert.Equal(t, 0, response.Running[0].TTL, "ttl should default to 0")
})
}