@thready-web/dsh-bot-plugin 0.1.0-beta.1 → 0.1.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -37,6 +37,37 @@ In `cordis.patch.yml` every new entry must be wrapped in `- insert:`:
37
37
 
38
38
  Start the host with `dsh --profile <name> --host 127.0.0.1 --port <port> --no-open` after the patch lists these entries. The official client is `/`. The workbench is `/dsh-bot/`. From the `dsh-plugins` repository, `npx dsh-bot` writes that patch and starts the process.
39
39
 
40
+ ## Main-session budget
41
+
42
+ A bot main session may do the work itself (bash, write, ...) or hand it to a worker with `foundations_dispatch`. The host keeps a runaway guard on each main turn:
43
+
44
+ | Field | Default | Meaning |
45
+ | --- | --- | --- |
46
+ | `chatMaxSteps` / `chatWallMs` | 80 / 30 min | Cap for every main turn |
47
+ | `mainMaxSteps` / `mainWallMs` | 80 / 30 min | Cap after a dispatch or a host tool. It can only tighten the chat cap; with the defaults it changes nothing. Set it lower to push long work onto workers. |
48
+
49
+ - The step cap is checked in `agent/pre-step`: the next step is refused and the turn ends `blocked`. A step that already ended is never cancelled, so a turn whose last step answered the user ends `completed`.
50
+ - The wall cap stops a still-running step with `agent.cancel({ kind: 'hook', reason: 'main-budget:wall' })`. Host cancels never use `{ kind: 'user' }` (worker caps use `worker-budget:*`, ticket cancels `ticket-cancel`).
51
+ - Each trip is written to stderr (`session-foundations: main budget main-budget:steps session=… turn=… steps=…`) and posts one `[foundations:budget]` next-turn message. The model then tells the user the turn was cut off and may dispatch the rest to a worker. Set `budgetNotice: false` to skip the message.
52
+
53
+ Override in the patch (`config.work`) or with the `DSH_BOT_WORK_BUDGET` environment variable (the launcher's `--work-budget`). Config wins over the environment. Both accept `steps` / `wall` shorthands and duration strings:
54
+
55
+ ```yaml
56
+ - insert:
57
+ - id: session-foundations
58
+ name: "@thready-web/dsh-bot-plugin"
59
+ config:
60
+ work: { steps: 120, wall: 45m }
61
+ ```
62
+
63
+ ```bash
64
+ DSH_BOT_WORK_BUDGET='steps=120,wall=45m,mainMaxSteps=10'
65
+ ```
66
+
67
+ ## Session working directory
68
+
69
+ Workbench sessions start in `THREADY_SESSION_CWD` when set, otherwise in `<DSH_HOME>/workspace` (created on first use), never in `DSH_HOME` itself, which holds the owner token and profiles.
70
+
40
71
  DSH loads `dist/`. Rebuild after changing `src/`. Until `npm --prefix ui run build` has run, `/dsh-bot/` is 404.
41
72
 
42
73
  Host integration needs Node `>= 24.9` and `DSH_BIN`: