delegation-layer 0.1.9 → 0.1.11

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
@@ -163,7 +163,8 @@ delegate models --provider codex:exec --cwd "$HOME/delegation-workspace" --json
163
163
  ```
164
164
 
165
165
  `--cwd` defaults to the current directory. Model discovery uses the
166
- state-rooted supervisor and a bounded `model-discovery-v1` 60-second inspection,
166
+ state-rooted supervisor and a bounded `model-discovery-v1` five-minute
167
+ inspection to allow a provider's first-run model/cache initialization. It
167
168
  creates inspection evidence without admitting a provider task, and may contact
168
169
  the provider CLI.
169
170
  It is advisory: a discovered model is not an admission guarantee or an
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "delegation-layer",
3
- "version": "0.1.9",
3
+ "version": "0.1.11",
4
4
  "description": "Multi-provider AI agent delegation CLI and Agent Skill for running bounded coding tasks across provider CLIs.",
5
5
  "keywords": [
6
6
  "ai-agents",
@@ -19,8 +19,11 @@ inspect, authenticate, or install a provider CLI directly.
19
19
  3. Give every turn an absolute workspace, a separate state root, an explicit
20
20
  permission mode, and a finite budget.
21
21
  4. Use `--json` and save the returned `task_id`. Read `admission`, `liveness`,
22
- `publication`, `status`, `outcome`, `continuation`, and `error` as separate
23
- fields.
22
+ `publication`, `status`, `outcome`, `continuation`, `task_record`, `failure`,
23
+ and `error` as separate fields.
24
+ Delegate owns the supervisor lifecycle. Never install, configure, start,
25
+ inspect, or repair Pueue, and never poll a task unless the response says its
26
+ `task_record` is `created`.
24
27
  5. Observe with `status` and collect with `collect`. Collection may recover the
25
28
  saved supervisor only to observe an already-requested budget stop; it never
26
29
  launches a provider or retries a task.
@@ -83,8 +86,9 @@ delegate models --provider PROVIDER_ID --cwd ABSOLUTE_WORKSPACE --json
83
86
 
84
87
  Omit `--cwd` to use the current directory. Run discovery only when the caller
85
88
  needs a non-default choice; provider defaults are valid. The command uses the
86
- state-rooted supervisor and a bounded `model-discovery-v1` 60-second native
87
- inspection, creates inspection evidence without admitting a provider task, and may contact the
89
+ state-rooted supervisor and a bounded `model-discovery-v1` five-minute native
90
+ inspection to allow first-run provider model/cache initialization. It creates
91
+ inspection evidence without admitting a provider task, and may contact the
88
92
  provider CLI. It is advisory and never an admission allowlist. Do not reject a
89
93
  requested value merely because discovery did not list it, and do not infer
90
94
  per-model effort support from the harness-wide list. If a selected model has
@@ -155,11 +159,19 @@ omitted or `default` effort is omitted from native argv. For AGY read-only,
155
159
  without a bypass. Authorized AGY workspace-write retains its existing native
156
160
  bypass. Do not add these native flags yourself.
157
161
 
158
- Save the exact `task_id` from the JSON response. If dispatch returns an error,
159
- use its `status`, `capability`, and `error` fields to report whether the request
160
- was invalid, unsupported, blocked by authentication, or operationally
161
- uncertain. Do not silently try another provider after a task has been
162
- admitted.
162
+ Save the exact `task_id` from the JSON response. The recovery steps below apply
163
+ to parsed dispatch responses. If the CLI rejects the command syntax before
164
+ dispatch (nonzero exit with a usage error and no JSON response), correct the
165
+ reported syntax and invoke it again; argument parsing fails before admission and
166
+ does not create a task record. For a parsed dispatch error, read its `failure`
167
+ and `task_record` fields. If `task_record` is
168
+ `not_created`, do not run `status`, `collect`, or `continue`; correct the request
169
+ only when `failure.next_action` is `correct_request`, otherwise report the
170
+ delegate failure and stop. If it is `created`, use `status` before taking any
171
+ other action. If it is `unknown`, stop and report the failure: with an
172
+ explicit task ID, absence can race another dispatch that is creating the same
173
+ ID. Never retry that ID, run Pueue commands, or silently try another provider
174
+ after a task may have been admitted.
163
175
 
164
176
  ### 5. Observe and collect
165
177
 
@@ -218,6 +230,13 @@ collect the successor by repeating step 5. If `resumable` is
218
230
  false, report the reason and stop; a fresh dispatch would lose the original
219
231
  conversation and is not an equivalent recovery.
220
232
 
233
+ If `continue` returns an error, use its `failure` and `task_record` fields just
234
+ as for dispatch: when the record is `created`, check the returned successor
235
+ `task_id` with `status`; when it is `not_created`, correct the request only if
236
+ `failure.next_action` is `correct_request`; and when it is `unknown`, stop and
237
+ report the failure. Do not repeat `continue` while successor creation is
238
+ unknown.
239
+
221
240
  ## JSON decisions
222
241
 
223
242
  The capability projection uses the stable `runtime-capability-v1` contract.