Skip to content
dsh.fish
Bundle

dsh-subagent-model-visibility

DeepSeek Harness plugin that shows the actual provider/model used by each subagent inside native tool-call rows and the native subagent catalog.

Source
AGSQ11
License
MIT
Updated
Updated 2 days ago

Readme

# dsh-subagent-model-visibility

A small DeepSeek Harness plugin that shows the **actual provider/model used by a subagent** directly inside the existing native subagent tool-call row.

It does not guess from the configured model. The host observes the child's real `llm/stream` `GenerateOptions`, so the displayed route reflects the model that actually received the request after DSH routing/retry/failover logic.

## What it looks like

### Native subagent dropdown

The session-header subagent catalog is decorated in place. Every visible child row gets a third line beneath DSH's own title/summary showing the **actual model currently serving that child session**:

![DSH subagent dropdown showing the actual slave model for each running subagent](screens/slave-models.png)

```text
Implement ATR position sizing & risk limits
…existing DSH summary…
Slave: claude-opus-5
```

`Slave` is the **actual current model observed on the child session's `llm/stream` route**. If Phoenix or another router reroutes that child, the line updates live. Duplicate task labels are safe because the enhancer maps the native tree back to DSH's authoritative catalog order/session ids rather than matching display text.

### Native subagent tool call

The existing tool-call row is also augmented:

```text
Tool call · subagent · Implement ATR position sizing & risk limits

  MODEL  brainz / claude-opus-4.7   · 2 model requests · subagent: spawn

OUT
started subagent 616c26ce-...
```

If a subagent changes routes during recovery:

```text
MODEL  brainz / qwen3-coder   · 3 routes · 4 model requests
```

Hover the model line to see the route history and request counts.

## How it works

1. `tools/execute` is wrapped with Node `AsyncLocalStorage` to associate one native DSH tool call with the `subagent/start` event it creates, safely even with concurrent tool calls.
2. `subagent/start` records the child session id and the DSH subagent transport (`spawn`, `fork`, ACP, etc.).
3. `llm/stream` observes actual child requests by `sessionId` and records the final provider/model dispatched to the LLM runtime.
4. `subagent/end` records the terminal state.
5. The Web client uses DSH's stable `[data-chat-call-id]` row identity and adds a compact model line inside the existing row. It updates live when the route changes.

The plugin does **not** modify prompts, model routing, tool arguments, tool results, or the subagent lifecycle.

## Install

From the folder containing the extracted plugin:

```powershell
dsh plugin --profile web add .\dsh-subagent-model-visibility
dsh web
```


## Configuration

```yaml
- id: subagent-model-visibility
  name: dsh-subagent-model-visibility
  config:
    retentionMs: 86400000
    maxEntries: 1000
    uiRefreshMs: 1000
```

- `retentionMs`: how long finished observations remain available to the UI.
- `maxEntries`: memory bound for observed subagent sessions.
- `uiRefreshMs`: browser refresh cadence for model/failover changes.

## Accuracy semantics

- **Actual model** means a provider/model pair observed on a real `ctx.llm.stream()` call whose `sessionId` is the subagent child.
- A newly started background child may briefly display **Resolving actual model…** before its first model request begins.
- If Phoenix or another router changes model, the badge changes to the latest route and exposes the route count/history.
- Remote subagent transports that do not issue their model request through the parent DSH `ctx.llm` cannot expose an authoritative underlying model; those remain at **Resolving actual model…** rather than inventing a value.
- Historical rows created before this plugin started cannot be reconstructed reliably and are intentionally left untouched.

## Privacy

The browser API contains only tool/child ids, transport name, provider/model route names, timestamps, request counts and terminal status. Prompts, model output, credentials, headers, filesystem paths and tool arguments are never included.

## License

MIT

Install

dsh plugin --profile web add github:AGSQ11/dsh-subagent-model-visibility#a41eb20cb98cf390b0bc1734f5a88381342d2334

Profile: web

Source