@sjawhar/opencode-legion-envoy 1.32.0 → 1.34.0
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/dist/src/server.js
CHANGED
|
@@ -13589,7 +13589,7 @@ var ArtifactReviewEventPayloadSchema = object({
|
|
|
13589
13589
|
var askEventPayloadFields = {
|
|
13590
13590
|
id: string2().optional(),
|
|
13591
13591
|
opened_event_id: number2().int().positive(),
|
|
13592
|
-
kind:
|
|
13592
|
+
kind: string2().optional(),
|
|
13593
13593
|
question: string2().optional(),
|
|
13594
13594
|
options: array(object({ label: string2().optional() })).optional(),
|
|
13595
13595
|
answer: object({ selected: array(string2()).nullish(), text: string2().nullish() }).nullish(),
|
|
@@ -13809,34 +13809,34 @@ var dispatchToolSpecs = [
|
|
|
13809
13809
|
},
|
|
13810
13810
|
{
|
|
13811
13811
|
name: "dispatch_issue_update",
|
|
13812
|
-
description: "Update an existing issue: move its lifecycle status, retitle it, replace its labels, link a URL " + "(the pull request that delivers it, a run, a document), or set its
|
|
13812
|
+
description: "Update an existing issue: move its lifecycle status, retitle it, replace its labels, link a URL " + "(the pull request that delivers it, a run, a document), set its route, or set or clear its parent. " + "Status is one of " + `${ISSUE_STATUSES.join(", ")}; outside Legion, move it yourself as the work advances; inside ` + "Legion the daemon moves it. external_links are " + "merged into the issue's existing links by URL, so linking the pull request you just opened " + "keeps every earlier link. Priority is the human's and is not settable here. At least one " + `field besides issue is required. ${ISSUE_REFERENCE}`,
|
|
13813
13813
|
arguments: (z) => ({
|
|
13814
13814
|
issue: z.string().describe(ISSUE_REFERENCE),
|
|
13815
13815
|
status: z.enum(ISSUE_STATUSES).describe("New lifecycle status.").optional(),
|
|
13816
13816
|
title: z.string({ min: 1 }).describe("Replacement title.").optional(),
|
|
13817
13817
|
labels: z.array(z.string({ min: 1, max: 40 }), { max: 20 }).describe("Replacement label set, at most 20 labels of up to 40 characters; replaces every existing label.").optional(),
|
|
13818
13818
|
external_links: z.array(z.string({ min: 1 })).describe("URLs to link; merged into the issue's existing external links by URL.").optional(),
|
|
13819
|
-
route: z.string().describe("Route the issue to role:<name> or session:<id>; an empty string clears it.").optional()
|
|
13819
|
+
route: z.string().describe("Route the issue to role:<name> or session:<id>; an empty string clears it.").optional(),
|
|
13820
|
+
parent: z.string().describe("Parent issue key in the same project; an empty string clears the parent.").optional()
|
|
13820
13821
|
}),
|
|
13821
13822
|
validation: {
|
|
13822
13823
|
check: (value) => {
|
|
13823
13824
|
const input = value;
|
|
13824
|
-
return typeof input.status === "string" || typeof input.title === "string" || Array.isArray(input.labels) || Array.isArray(input.external_links) || typeof input.route === "string";
|
|
13825
|
+
return typeof input.status === "string" || typeof input.title === "string" || Array.isArray(input.labels) || Array.isArray(input.external_links) || typeof input.route === "string" || typeof input.parent === "string";
|
|
13825
13826
|
},
|
|
13826
|
-
message: "Issue update requires at least one field besides issue: status, title, labels, external_links, or
|
|
13827
|
+
message: "Issue update requires at least one field besides issue: status, title, labels, external_links, route, or parent."
|
|
13827
13828
|
},
|
|
13828
13829
|
strict: true
|
|
13829
13830
|
},
|
|
13830
13831
|
{
|
|
13831
13832
|
name: "dispatch_ask",
|
|
13832
|
-
description: "Open a durable, answerable decision
|
|
13833
|
+
description: "Open a durable, answerable decision on an issue or project document. Do not use it for a status update or discussion; " + "use dispatch_message instead. A to-do a human must complete is a question phrased as that to-do, with the options you want (for example Done / Can't). " + "Anchor a document question, thread reply_to/reply_to_ask, or cite a dispatch:// " + 'reference \u2014 it must be answerable from its own text and anchor alone, never "see above". A quote anchor is pinned to its block. Question is at most 800 ' + `characters and has at most 8 options. ${OWNER_REFERENCE}`,
|
|
13833
13834
|
arguments: (z) => ({
|
|
13834
13835
|
issue: z.string().describe(ISSUE_REFERENCE).optional(),
|
|
13835
13836
|
project: z.string().describe("Project key owning the document.").optional(),
|
|
13836
13837
|
artifact: z.string().describe("Project document artifact id, slug, or filename.").optional(),
|
|
13837
13838
|
ref: z.string().describe("Optional dispatch:// reference (issue, document, message, or ask); appended to the question and rendered as a link.").optional(),
|
|
13838
13839
|
question: z.string({ max: 800 }).describe("Decision question, at most 800 characters."),
|
|
13839
|
-
kind: z.enum(["action"]).describe("Optional human to-do ask kind.").optional(),
|
|
13840
13840
|
options: z.array(z.object({
|
|
13841
13841
|
label: z.string().describe("Selectable option label."),
|
|
13842
13842
|
description: z.string().describe("Optional option context.").optional()
|
|
@@ -15323,9 +15323,6 @@ function askUrgency(args) {
|
|
|
15323
15323
|
const value = args.urgency;
|
|
15324
15324
|
return ASK_URGENCIES.find((urgency) => urgency === value);
|
|
15325
15325
|
}
|
|
15326
|
-
function askKind(args) {
|
|
15327
|
-
return optionalString(args, "kind") === "action" ? "action" : undefined;
|
|
15328
|
-
}
|
|
15329
15326
|
var maxAskQuestion16 = 800;
|
|
15330
15327
|
function questionWithRef(question, ref) {
|
|
15331
15328
|
return ref === undefined || question.includes(ref) ? question : `${question}
|
|
@@ -16024,6 +16021,7 @@ async function executeDispatchTool(input) {
|
|
|
16024
16021
|
const status = optionalString(args, "status");
|
|
16025
16022
|
const title = optionalString(args, "title");
|
|
16026
16023
|
const route = optionalString(args, "route");
|
|
16024
|
+
const parent = optionalString(args, "parent");
|
|
16027
16025
|
const labels = Array.isArray(args.labels) ? args.labels : undefined;
|
|
16028
16026
|
const requestedLinks = Array.isArray(args.external_links) ? [...new Set(args.external_links)] : undefined;
|
|
16029
16027
|
let newLinks = [];
|
|
@@ -16036,6 +16034,7 @@ async function executeDispatchTool(input) {
|
|
|
16036
16034
|
...title === undefined ? {} : { title },
|
|
16037
16035
|
...labels === undefined ? {} : { labels },
|
|
16038
16036
|
...route === undefined ? {} : { route },
|
|
16037
|
+
...parent === undefined ? {} : { parent: parent === "" ? null : parent },
|
|
16039
16038
|
...requestedLinks === undefined ? {} : { external_links: [...before.external_links, ...newLinks.map((url) => ({ url }))] },
|
|
16040
16039
|
actor
|
|
16041
16040
|
});
|
|
@@ -16047,7 +16046,8 @@ async function executeDispatchTool(input) {
|
|
|
16047
16046
|
...requestedLinks === undefined ? [] : [
|
|
16048
16047
|
newLinks.length === 0 ? `already linked ${requestedLinks.join(", ")} ${linkCount}` : `linked ${newLinks.join(", ")} ${linkCount}`
|
|
16049
16048
|
],
|
|
16050
|
-
...route === undefined ? [] : [after.route === null ? "route cleared" : `route ${after.route}`]
|
|
16049
|
+
...route === undefined ? [] : [after.route === null ? "route cleared" : `route ${after.route}`],
|
|
16050
|
+
...parent === undefined ? [] : [after.parent === null ? "parent cleared" : `parent -> ${after.parent}`]
|
|
16051
16051
|
];
|
|
16052
16052
|
return {
|
|
16053
16053
|
text: `${after.key}: ${changes.join("; ")} ${notSubscribed(issueTopic(after.key))}`,
|
|
@@ -16122,11 +16122,9 @@ async function executeDispatchTool(input) {
|
|
|
16122
16122
|
const options = args.options;
|
|
16123
16123
|
const multiple = optionalBoolean(args, "multiple");
|
|
16124
16124
|
const urgency = askUrgency(args);
|
|
16125
|
-
const kind = askKind(args);
|
|
16126
16125
|
const anchored = anchorArgs && resolved ? anchor(resolved.artifact, anchorArgs) : undefined;
|
|
16127
16126
|
const askInput = {
|
|
16128
16127
|
question: askQuestionWithRef(args),
|
|
16129
|
-
...kind === undefined ? {} : { kind },
|
|
16130
16128
|
...Array.isArray(options) ? { options } : {},
|
|
16131
16129
|
...multiple === undefined ? {} : { multiple },
|
|
16132
16130
|
...urgency === undefined ? {} : { urgency },
|
package/package.json
CHANGED
package/skills/dispatch/SKILL.md
CHANGED
|
@@ -75,8 +75,9 @@ rest. Use these headings in this order.
|
|
|
75
75
|
|
|
76
76
|
- The spec is the issue's one primary document. Extend it in place — a new version that keeps the
|
|
77
77
|
human's own text — never a second "spec" artifact beside it.
|
|
78
|
-
- No hedging ("might", "could consider"). No TBD, TODO, or placeholders: an open item is a
|
|
79
|
-
Decision needed
|
|
78
|
+
- No hedging ("might", "could consider"). No TBD, TODO, or placeholders: an open item is either a
|
|
79
|
+
Decision needed or a question for the platform PO whose ruling becomes a Requirement (see
|
|
80
|
+
[Before you ask](#before-you-ask) under Asking).
|
|
80
81
|
- Keep each section to one screen; work that exceeds one screen per section is two specs.
|
|
81
82
|
- Update the spec as decisions land: the spec is the record, comments are the discussion.
|
|
82
83
|
- Before sending it: no sections conflict, every requirement has exactly one reading, and the
|
|
@@ -121,9 +122,10 @@ status is." Waiting for the deploy lane is not a status and is never announced.
|
|
|
121
122
|
human's: set it on creation only when their intent is clear, and change it only on their word.
|
|
122
123
|
|
|
123
124
|
```ts
|
|
124
|
-
// PATCH /api/v1/issues/{key} — status, title, labels, external_links (merged by URL), route
|
|
125
|
+
// PATCH /api/v1/issues/{key} — status, title, labels, external_links (merged by URL), route, parent
|
|
125
126
|
dispatch_issue_update({ issue: "AGENTC-175", status: "testing" })
|
|
126
127
|
dispatch_issue_update({ issue: "AGENTC-175", external_links: ["https://github.com/owner/repo/pull/7"] })
|
|
128
|
+
dispatch_issue_update({ issue: "AGENTC-175", parent: "AGENTC-170" }) // same-project key; "" clears the parent
|
|
127
129
|
```
|
|
128
130
|
|
|
129
131
|
Link the pull request that delivers the issue in `external_links` when you open it; the issue page
|
|
@@ -148,6 +150,30 @@ Read them; reference the existing issue, or repeat the call with `force: true` w
|
|
|
148
150
|
|
|
149
151
|
## Asking
|
|
150
152
|
|
|
153
|
+
### Before you ask
|
|
154
|
+
|
|
155
|
+
Sami, 2026-09-16, verbatim, rejecting two asks the same night: "All of these \"decisions\" are
|
|
156
|
+
completely disconnected from any discussion of design or trade-offs. This is not a very useful way
|
|
157
|
+
of having this discussion" (on a report-table shape), and "What's a fenced PutObject or phantom
|
|
158
|
+
eval_id? What's an R4 model header? What exactly is the question or uncertainty here?" (on a
|
|
159
|
+
production import). Every `dispatch_ask` passes three gates first:
|
|
160
|
+
|
|
161
|
+
1. **Does it need his authority, taste, or risk appetite?** The same bar as a spec's Decisions
|
|
162
|
+
needed ([Writing a spec](#writing-a-spec)). Schema shapes, table layouts, field names, migration
|
|
163
|
+
internals, and contracts between lanes do not: they go to the platform PO over Envoy, who rules.
|
|
164
|
+
2. **Is there genuine uncertainty?** If not, it is a plan you execute. The one legitimate ask
|
|
165
|
+
without uncertainty is permission for an action only a human can authorise — a production
|
|
166
|
+
write, an external send, a console action — and then the question is that action in one
|
|
167
|
+
sentence with `Done` / `Can't` options (below).
|
|
168
|
+
3. **Can someone who has not read the code answer it on a phone?** What he can see today, what
|
|
169
|
+
changes for a reader, two options with what each costs, your recommendation. No slice or
|
|
170
|
+
decision numbers, no coined nouns, no internal identifiers he has never used, no jargon you
|
|
171
|
+
would have to define. This is the phone test in [Writing for the human](#writing-for-the-human).
|
|
172
|
+
If you cannot write it that way, you do not understand it well enough to ask.
|
|
173
|
+
|
|
174
|
+
The platform PO audits open asks. One that fails a gate is retracted, with the PO's answer as the
|
|
175
|
+
record.
|
|
176
|
+
|
|
151
177
|
Open a decision with:
|
|
152
178
|
```ts
|
|
153
179
|
dispatch_ask({
|
|
@@ -191,20 +217,22 @@ Before saying you are waiting for human input, call `dispatch_open_asks`. It lis
|
|
|
191
217
|
|
|
192
218
|
**Anything that needs the human is an ask, or it does not exist.** An approval, a credential,
|
|
193
219
|
a setting only they can change, a review click, a conflict between two of their own rules - if
|
|
194
|
-
your work waits on it, open a `dispatch_ask`
|
|
195
|
-
|
|
196
|
-
an explanation). Never write it into a spec, a comment reply, a message, or a
|
|
220
|
+
your work waits on it, open a `dispatch_ask` the moment you know, the action as the question.
|
|
221
|
+
Never write it into a spec, a comment reply, a message, or a
|
|
197
222
|
pull-request body: nothing in those paths reaches the human's Inbox, and a human who is not
|
|
198
223
|
reading your document does not know they are the blocker. Before asking, try to remove the
|
|
199
224
|
step: a value already on the machine, a permission you already hold, an API that replaces the
|
|
200
225
|
click. One ask per item, `urgency: "high"` when work is stopped on it; while it is open, keep
|
|
201
226
|
working on everything that is not.
|
|
202
227
|
|
|
203
|
-
|
|
204
|
-
`Can't
|
|
228
|
+
A to-do handed to a human is an ordinary question: phrase the to-do as the question and give it
|
|
229
|
+
the options you want, typically `Done` / `Can't`. Nothing about the options is special to the
|
|
230
|
+
server; if you need a reason with `Can't`, say so in the option's description, and the human's
|
|
231
|
+
free-text answer carries it:
|
|
205
232
|
```ts
|
|
206
|
-
dispatch_ask({ issue: "DSP-42",
|
|
207
|
-
question: "Confirm the deployment is complete."
|
|
233
|
+
dispatch_ask({ issue: "DSP-42",
|
|
234
|
+
question: "Confirm the deployment is complete.",
|
|
235
|
+
options: [{ label: "Done" }, { label: "Can't", description: "Say what is missing." }] })
|
|
208
236
|
```
|
|
209
237
|
|
|
210
238
|
Correct or refine an open ask in place instead of opening a second question:
|
|
@@ -258,7 +258,8 @@ Preserve this order exactly:
|
|
|
258
258
|
production-check task. It drives the changed path in production through the user's own access
|
|
259
259
|
path and records what it saw on the pull request and on this issue. Close only after the implementer's production report exists.
|
|
260
260
|
A defect it finds is a corrective child issue of this tree, not a note on a closed one; a deploy
|
|
261
|
-
the implementer cannot perform is its
|
|
261
|
+
the implementer cannot perform is its `dispatch_ask` with `Done` / `Can't` options, and the
|
|
262
|
+
issue waits for it.
|
|
262
263
|
|
|
263
264
|
What returns the tree to review: a changed diff — a commit above the approved head that
|
|
264
265
|
touches anything outside `docs/solutions/`, or a rebase whose fingerprint (the `legion-worker`
|
|
@@ -274,7 +275,7 @@ PR gets no CI and no wake announces it, and send the implementer to rebase the m
|
|
|
274
275
|
it. Do not let the merger publish `READY` for an obsolete approval.
|
|
275
276
|
|
|
276
277
|
If a worker reports that `legion threads resolve` exited 1 naming a review thread GitHub refused
|
|
277
|
-
to resolve, open
|
|
278
|
+
to resolve, open a `dispatch_ask` with `Done` / `Can't` options that names the thread's URL
|
|
278
279
|
and GitHub's message for a human to resolve it by hand; the merger does not publish while it is
|
|
279
280
|
open. That is the one review-thread step a human takes: the review App cannot resolve threads,
|
|
280
281
|
and the implementer's and merger's runs of the command close every accepted one.
|
|
@@ -315,7 +315,7 @@ this proof.
|
|
|
315
315
|
whose newest comment is the opener's own `Accepted:` reply, one `resolveReviewThread` per
|
|
316
316
|
thread, prints `resolved <url>` or `left open <url> — newest reply by <login> is not an acceptance`,
|
|
317
317
|
and exits 1 naming the thread's URL and GitHub's message when GitHub refuses one; report that
|
|
318
|
-
exit to the architect, which opens
|
|
318
|
+
exit to the architect, which opens a `Done` / `Can't` ask for a human to resolve the thread by hand —
|
|
319
319
|
never skip it silently. The merger runs the same command once more before publishing READY
|
|
320
320
|
and does not publish while any `left open` line remains.
|
|
321
321
|
- **Correctness fixes land in this PR; cleanup is one named fast-follow.** A finding that
|
|
@@ -428,8 +428,8 @@ this proof.
|
|
|
428
428
|
carrying the Legion footer, and a `dispatch_message` on the issue — the reviewer and merger
|
|
429
429
|
read GitHub, the architect reads the issue. When the deploy that carries the merge has not
|
|
430
430
|
happened (a shared profile still holding the previous plugin release, a daemon still running
|
|
431
|
-
the previous commit, a slot nobody has run), open
|
|
432
|
-
|
|
431
|
+
the previous commit, a slot nobody has run), open a `dispatch_ask` with `Done` / `Can't`
|
|
432
|
+
options naming the exact install or restart step, keep the `Production:` line at
|
|
433
433
|
`pending <what is missing>`, and complete the check once the human answers Done. Never record
|
|
434
434
|
a staging pass as the production check, and never let the architect sign off on a `pending`
|
|
435
435
|
line.
|