crewly 1.7.0 → 1.8.1
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/config/constants.ts +2 -0
- package/config/roles/orchestrator/prompt.md +71 -0
- package/config/skills/orchestrator/delegate-task/execute.sh +101 -2
- package/config/skills/orchestrator/delegate-task/execute.test.sh +202 -0
- package/dist/backend/backend/src/constants.d.ts +1 -0
- package/dist/backend/backend/src/constants.d.ts.map +1 -1
- package/dist/backend/backend/src/controllers/team/team.controller.d.ts.map +1 -1
- package/dist/backend/backend/src/controllers/team/team.controller.js +27 -0
- package/dist/backend/backend/src/controllers/team/team.controller.js.map +1 -1
- package/dist/backend/backend/src/index.d.ts.map +1 -1
- package/dist/backend/backend/src/index.js +16 -1
- package/dist/backend/backend/src/index.js.map +1 -1
- package/dist/backend/backend/src/services/agent/agent-registration.service.d.ts +3 -3
- package/dist/backend/backend/src/services/agent/agent-registration.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/agent/agent-registration.service.js +1 -1
- package/dist/backend/backend/src/services/agent/agent-registration.service.js.map +1 -1
- package/dist/backend/backend/src/services/agent/crewly-agent/crewly-agent-external-runtime.service.d.ts +44 -0
- package/dist/backend/backend/src/services/agent/crewly-agent/crewly-agent-external-runtime.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/agent/crewly-agent/crewly-agent-external-runtime.service.js +179 -10
- package/dist/backend/backend/src/services/agent/crewly-agent/crewly-agent-external-runtime.service.js.map +1 -1
- package/dist/backend/backend/src/services/agent/crewly-agent/in-process-runtime-registry.d.ts +6 -6
- package/dist/backend/backend/src/services/agent/crewly-agent/in-process-runtime-registry.d.ts.map +1 -1
- package/dist/backend/backend/src/services/agent/crewly-agent/in-process-runtime-registry.js +3 -3
- package/dist/backend/backend/src/services/agent/crewly-agent/in-process-runtime-registry.js.map +1 -1
- package/dist/backend/backend/src/services/agent/crewly-agent/types.d.ts +7 -1
- package/dist/backend/backend/src/services/agent/crewly-agent/types.d.ts.map +1 -1
- package/dist/backend/backend/src/services/agent/crewly-agent/types.js.map +1 -1
- package/dist/backend/backend/src/services/agent/runtime-service.factory.js +4 -4
- package/dist/backend/backend/src/services/agent/runtime-service.factory.js.map +1 -1
- package/dist/backend/backend/src/services/mcp-server.d.ts.map +1 -1
- package/dist/backend/backend/src/services/mcp-server.js +5 -0
- package/dist/backend/backend/src/services/mcp-server.js.map +1 -1
- package/dist/backend/backend/src/services/mcp-tool-definitions.d.ts +4 -0
- package/dist/backend/backend/src/services/mcp-tool-definitions.d.ts.map +1 -1
- package/dist/backend/backend/src/services/mcp-tool-definitions.js +12 -1
- package/dist/backend/backend/src/services/mcp-tool-definitions.js.map +1 -1
- package/dist/backend/backend/src/services/memory/capability-inference.d.ts +73 -0
- package/dist/backend/backend/src/services/memory/capability-inference.d.ts.map +1 -0
- package/dist/backend/backend/src/services/memory/capability-inference.js +115 -0
- package/dist/backend/backend/src/services/memory/capability-inference.js.map +1 -0
- package/dist/backend/backend/src/services/memory/memory.service.d.ts +22 -1
- package/dist/backend/backend/src/services/memory/memory.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/memory/memory.service.js +46 -0
- package/dist/backend/backend/src/services/memory/memory.service.js.map +1 -1
- package/dist/backend/backend/src/services/memory/project-memory.service.d.ts +25 -1
- package/dist/backend/backend/src/services/memory/project-memory.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/memory/project-memory.service.js +43 -0
- package/dist/backend/backend/src/services/memory/project-memory.service.js.map +1 -1
- package/dist/backend/backend/src/services/memory/task-history-seeder.d.ts +47 -0
- package/dist/backend/backend/src/services/memory/task-history-seeder.d.ts.map +1 -0
- package/dist/backend/backend/src/services/memory/task-history-seeder.js +89 -0
- package/dist/backend/backend/src/services/memory/task-history-seeder.js.map +1 -0
- package/dist/backend/backend/src/services/memory/task-history.subscriber.d.ts +76 -0
- package/dist/backend/backend/src/services/memory/task-history.subscriber.d.ts.map +1 -0
- package/dist/backend/backend/src/services/memory/task-history.subscriber.js +199 -0
- package/dist/backend/backend/src/services/memory/task-history.subscriber.js.map +1 -0
- package/dist/backend/backend/src/services/reconciler/reconciler-data-provider.d.ts +44 -0
- package/dist/backend/backend/src/services/reconciler/reconciler-data-provider.d.ts.map +1 -1
- package/dist/backend/backend/src/services/reconciler/reconciler-data-provider.js +94 -0
- package/dist/backend/backend/src/services/reconciler/reconciler-data-provider.js.map +1 -1
- package/dist/backend/backend/src/services/reconciler/reconciler.service.d.ts +19 -0
- package/dist/backend/backend/src/services/reconciler/reconciler.service.d.ts.map +1 -1
- package/dist/backend/backend/src/services/reconciler/reconciler.service.js +28 -0
- package/dist/backend/backend/src/services/reconciler/reconciler.service.js.map +1 -1
- package/dist/backend/backend/src/types/event-bus.types.d.ts +1 -1
- package/dist/backend/backend/src/types/event-bus.types.d.ts.map +1 -1
- package/dist/backend/backend/src/types/event-bus.types.js +17 -0
- package/dist/backend/backend/src/types/event-bus.types.js.map +1 -1
- package/dist/backend/backend/src/types/memory.types.d.ts +94 -1
- package/dist/backend/backend/src/types/memory.types.d.ts.map +1 -1
- package/dist/backend/backend/src/types/memory.types.js.map +1 -1
- package/dist/backend/config/constants.d.ts +2 -0
- package/dist/backend/config/constants.d.ts.map +1 -1
- package/dist/backend/config/constants.js +2 -0
- package/dist/backend/config/constants.js.map +1 -1
- package/dist/backend/config/index.d.ts +1 -0
- package/dist/backend/config/index.d.ts.map +1 -1
- package/dist/cli/backend/src/constants.d.ts +1 -0
- package/dist/cli/backend/src/constants.d.ts.map +1 -1
- package/dist/cli/backend/src/services/mcp-server.d.ts.map +1 -1
- package/dist/cli/backend/src/services/mcp-server.js +5 -0
- package/dist/cli/backend/src/services/mcp-server.js.map +1 -1
- package/dist/cli/backend/src/services/mcp-tool-definitions.d.ts +4 -0
- package/dist/cli/backend/src/services/mcp-tool-definitions.d.ts.map +1 -1
- package/dist/cli/backend/src/services/mcp-tool-definitions.js +12 -1
- package/dist/cli/backend/src/services/mcp-tool-definitions.js.map +1 -1
- package/dist/cli/backend/src/services/memory/memory.service.d.ts +22 -1
- package/dist/cli/backend/src/services/memory/memory.service.d.ts.map +1 -1
- package/dist/cli/backend/src/services/memory/memory.service.js +46 -0
- package/dist/cli/backend/src/services/memory/memory.service.js.map +1 -1
- package/dist/cli/backend/src/services/memory/project-memory.service.d.ts +25 -1
- package/dist/cli/backend/src/services/memory/project-memory.service.d.ts.map +1 -1
- package/dist/cli/backend/src/services/memory/project-memory.service.js +43 -0
- package/dist/cli/backend/src/services/memory/project-memory.service.js.map +1 -1
- package/dist/cli/backend/src/types/event-bus.types.d.ts +1 -1
- package/dist/cli/backend/src/types/event-bus.types.d.ts.map +1 -1
- package/dist/cli/backend/src/types/event-bus.types.js +17 -0
- package/dist/cli/backend/src/types/event-bus.types.js.map +1 -1
- package/dist/cli/backend/src/types/memory.types.d.ts +94 -1
- package/dist/cli/backend/src/types/memory.types.d.ts.map +1 -1
- package/dist/cli/backend/src/types/memory.types.js.map +1 -1
- package/dist/cli/config/constants.d.ts +2 -0
- package/dist/cli/config/constants.d.ts.map +1 -1
- package/dist/cli/config/constants.js +2 -0
- package/dist/cli/config/constants.js.map +1 -1
- package/dist/cli/config/index.d.ts +1 -0
- package/dist/cli/config/index.d.ts.map +1 -1
- package/package.json +1 -1
package/config/constants.ts
CHANGED
|
@@ -609,6 +609,8 @@ export const MEMORY_CONSTANTS = {
|
|
|
609
609
|
GOTCHAS: 'gotchas.json',
|
|
610
610
|
/** Relationship entries */
|
|
611
611
|
RELATIONSHIPS: 'relationships.json',
|
|
612
|
+
/** Completed-task ledger (TaskHistoryEntry[]) */
|
|
613
|
+
TASK_HISTORY: 'task-history.json',
|
|
612
614
|
/** Human-readable learnings log */
|
|
613
615
|
LEARNINGS: 'learnings.md',
|
|
614
616
|
},
|
|
@@ -235,6 +235,33 @@ When receiving a request from owner or upstream, every Request you materialise i
|
|
|
235
235
|
|
|
236
236
|
The `delegate-task` skill emits a stderr WARNING when a brief is missing G/O/E markers — non-fatal, but a signal that the brief is malformed and the downstream TL is allowed (and expected) to push back.
|
|
237
237
|
|
|
238
|
+
### Scope Discipline — No Auto-Expansion (MANDATORY)
|
|
239
|
+
|
|
240
|
+
> Source incident: 2026-05-20 ESTestNode dispatch. User said "update ESTestNode OSS + crewly agent." Brief shipped with "fix the 3 known 5/15 side-issues" promoted into Eval Criteria. One of those was a production nginx config change the user never authorized. Caught only when the user asked "为什么会涉及到 nginx?" 9 hours later.
|
|
241
|
+
|
|
242
|
+
**The bug pattern**: you `recall_memory` history about the topic, find an adjacent known issue, and quietly write it into the brief's `Expected Outcome` or `Eval Criteria`. The executor faithfully addresses everything in the brief, so unauthorized scope ships unless they happen to escalate. By the time the user notices, the work is partly done.
|
|
243
|
+
|
|
244
|
+
**Hard rule:**
|
|
245
|
+
|
|
246
|
+
1. **Goal / Expected Outcome / Eval Criteria** are derived ONLY from the user's literal words in this turn. If the user said `X`, your brief targets `X`. Period.
|
|
247
|
+
|
|
248
|
+
2. **Recalled context** (from `recall_memory`, past chat threads, project knowledge, audit findings) goes into a `## Context` section that informs the executor's *awareness* — NOT into `Expected Outcome` or `Eval Criteria`. Context is for "here's what you should know while doing X"; criteria is for "here's what X requires."
|
|
249
|
+
|
|
250
|
+
3. **If you think bundling related work is efficient**, ASK FIRST and wait for an explicit Y. Templates:
|
|
251
|
+
- "You asked X. While we're there, want me to also handle Y, Z? (Y/N)"
|
|
252
|
+
- "Memory says there's an open issue with Z in the same surface — bundle it in or defer? (bundle/defer)"
|
|
253
|
+
Only after explicit Y can Y appear in the brief's criteria.
|
|
254
|
+
|
|
255
|
+
4. **Production-adjacent scope is double-gated**. Even when memory recalls a "known issue," items touching `prod nginx`, `prod DNS`, `prod secrets`, `live billing`, `live customer data`, or `live user-facing domain` (`crewlyai.com`, `api.crewlyai.com`, owner's personal accounts) MUST go through the ask-first gate above. There is no "obvious next step" override for prod.
|
|
256
|
+
|
|
257
|
+
5. **Self-check before dispatch** — diff your composed `Expected Outcome` line items against the user's literal words. Every line in Expected Outcome must trace to a word/phrase the user actually wrote. If a line is justified only by recalled history, move it to `Context` or `Suggested Follow-ups` and surface back for confirmation.
|
|
258
|
+
|
|
259
|
+
**Negative pattern to suppress** (the 2026-05-20 ESTestNode shape):
|
|
260
|
+
> User: "update X" → ORC: `recall_memory(X)` → memory has "X had 3 known issues" → ORC: "while you're updating X, handle the 3 known issues too" → executor does all 4 things → user pays for unauthorized scope on prod.
|
|
261
|
+
|
|
262
|
+
**Replacement pattern**:
|
|
263
|
+
> User: "update X" → ORC: `recall_memory(X)` → ORC composes brief targeting ONLY update X, includes the 3 known issues in `## Context` for awareness, asks user in reply "noticed 3 open issues on X — bundle in this run? Y/N", waits.
|
|
264
|
+
|
|
238
265
|
## Conversation History — Recall Only
|
|
239
266
|
|
|
240
267
|
Your conversation history is for **recall only**. Use it to remember context: who asked for what, what you discussed, what decisions you made.
|
|
@@ -519,6 +546,50 @@ This is a hard pre-yield check. Do not yield if any Slack message is unanswered.
|
|
|
519
546
|
- Escalate cross-team blockers
|
|
520
547
|
- Your role boundaries are defined in the Role Boundary section. When unsure whether to do something yourself vs delegate, consult those boundaries.
|
|
521
548
|
|
|
549
|
+
### Delegation-First Routing for External Access (MANDATORY)
|
|
550
|
+
|
|
551
|
+
**Before you reach for your own tools to do external-system work — reading email, posting to Slack, scheduling on a calendar, opening a browser tab, calling a third-party API — first ask the team's task-history ledger who has demonstrated that capability before. Then prefer delegating to that member.** This is the difference between "I can't read Gmail because the Chrome extension is offline" and "Ella can — she has Gmail OAuth and read MIT-Role emails last week."
|
|
552
|
+
|
|
553
|
+
**The capability lookup:**
|
|
554
|
+
|
|
555
|
+
```jsonc
|
|
556
|
+
// crewly_recall_memory tool — pass `capability` to query the ledger
|
|
557
|
+
{
|
|
558
|
+
"query": "who can read gmail", // free-text context
|
|
559
|
+
"capability": "gmail:read", // canonical <category>:<resource>
|
|
560
|
+
"projectPath": "<current-project>",
|
|
561
|
+
"scope": "project"
|
|
562
|
+
}
|
|
563
|
+
```
|
|
564
|
+
|
|
565
|
+
The response's `taskHistory[]` lists members who have completed tasks exercising that capability, sorted most-recent first. The `combined` field already includes a `### Capability Routing` block summarising the ranking — read it before deciding.
|
|
566
|
+
|
|
567
|
+
**Canonical capability strings** (extend as new tools land — registry in `services/memory/capability-inference.ts`):
|
|
568
|
+
|
|
569
|
+
| Capability | Granted by tools |
|
|
570
|
+
|---|---|
|
|
571
|
+
| `gmail:read` / `gmail:send` | `read_email_oauth`, `send_email_oauth` |
|
|
572
|
+
| `oauth:gmail` | any Gmail OAuth tool |
|
|
573
|
+
| `calendar:read` / `calendar:write` | `read_calendar_oauth`, `create_calendar_event` |
|
|
574
|
+
| `oauth:calendar` | any Calendar OAuth tool |
|
|
575
|
+
| `slack:post` | `reply-slack` |
|
|
576
|
+
| `github:pr-create` / `github:issue-comment` | `gh_pr_create`, `gh_issue_comment` |
|
|
577
|
+
| `oauth:github` | any GitHub-token tool |
|
|
578
|
+
| `chrome:scrape` / `web:search` / `web:fetch` | browser-bridge tools |
|
|
579
|
+
| `code:edit` / `code:write` / `git:commit` | editor + git tools |
|
|
580
|
+
| `shell:exec` | `bash_exec` |
|
|
581
|
+
|
|
582
|
+
**Decision tree (apply in order):**
|
|
583
|
+
|
|
584
|
+
1. **`recall(capability: '<cap>')` returns ≥1 member** → delegate to the most-recent member. Use `delegate-task` with a brief that names the capability ("Ella, please read the most recent email matching 'Fwd: MIT Role' — using your Gmail OAuth"). Skip to step 4.
|
|
585
|
+
2. **Returns 0 but a team member's role config declares the capability** (e.g. `members[].capabilities.oauth: ['gmail']` in `team.json`) → delegate to them; their first run will seed the ledger.
|
|
586
|
+
3. **Returns 0 and no member self-declares it** → fall back to your own tools (e.g. Crewly in Chrome for browser access — see next section). Mention to the user that this is the fallback path so they know nobody on the team is currently set up for this.
|
|
587
|
+
4. **After the delegated task completes**, the TaskHistorySubscriber writes a new entry automatically — no manual recording needed.
|
|
588
|
+
|
|
589
|
+
**Do NOT** answer "I can't do X because <runtime state>" without first running step 1. The runtime state of *your* tools (Chrome extension offline, OAuth not connected on the orc) tells you nothing about your team's capabilities.
|
|
590
|
+
|
|
591
|
+
**Cold-start case** (brand-new project, empty ledger): use the team config's `members[].capabilities` field as a hint, and at `register-self` time each agent declares its OAuth/skill set — these synthetic `outcome: 'declared'` entries populate the ledger so day-1 routing works.
|
|
592
|
+
|
|
522
593
|
### Browser Access — Prefer Crewly in Chrome
|
|
523
594
|
|
|
524
595
|
When a task needs browser access (web browsing, scraping, controlling a live web app, reading a logged-in page), **prefer the user's own Chrome via the `Crewly in Chrome` extension** over headless Playwright or a remote browser.
|
|
@@ -17,6 +17,16 @@ TASK_TYPE="general"
|
|
|
17
17
|
TEAM_ID=""
|
|
18
18
|
FORCE_CROSS_TEAM="false"
|
|
19
19
|
REQUEST_ID=""
|
|
20
|
+
# Self-heal fix #3 (2026-05-20): default fallback timer at 30min. Per
|
|
21
|
+
# the orchestrator prompt §3.0 the orc is supposed to set 2× ETA
|
|
22
|
+
# manually for every dispatch, but the convention was unenforced —
|
|
23
|
+
# observable in the 2026-05-20 ESTestNode incident where the orc set
|
|
24
|
+
# only the idle subscription and not the fallback timer, leaving the
|
|
25
|
+
# orc clueless when Sora never started. Auto-creating a 30min fallback
|
|
26
|
+
# at dispatch time guarantees the dual-signal contract is honored.
|
|
27
|
+
# Caller can override via --fallback-minutes N, or disable with
|
|
28
|
+
# --fallback-minutes 0.
|
|
29
|
+
FALLBACK_MINUTES="30"
|
|
20
30
|
|
|
21
31
|
# Detect legacy JSON argument
|
|
22
32
|
if [[ $# -gt 0 && ${1:0:1} == '{' ]]; then
|
|
@@ -36,6 +46,7 @@ while [[ $# -gt 0 ]]; do
|
|
|
36
46
|
--team|-g) TEAM_ID="$2"; shift 2 ;;
|
|
37
47
|
--request-id|-R) REQUEST_ID="$2"; shift 2 ;;
|
|
38
48
|
--force-cross-team) FORCE_CROSS_TEAM="true"; shift ;;
|
|
49
|
+
--fallback-minutes) FALLBACK_MINUTES="$2"; shift 2 ;;
|
|
39
50
|
--json|-j) INPUT_JSON="$2"; shift 2 ;;
|
|
40
51
|
--help|-h)
|
|
41
52
|
echo "Usage: execute.sh --to agent-session --task 'implement feature' --priority high --project /path [--team teamId] [--context 'extra info']"
|
|
@@ -241,11 +252,99 @@ if [ "$POOL_OK" != "true" ]; then
|
|
|
241
252
|
exit 1
|
|
242
253
|
fi
|
|
243
254
|
|
|
255
|
+
# --- Immediate claim transition (self-heal fix #1) ---
|
|
256
|
+
# Force `queued → running` at dispatch time so the WI doesn't rot in
|
|
257
|
+
# queued waiting for a pull that may never come. The 2026-05-20 ESTestNode
|
|
258
|
+
# incident (WI d705bfe0) revealed the gap: addToPool succeeded, the
|
|
259
|
+
# message was delivered to Sora's PTY, but the WI stayed `queued` for
|
|
260
|
+
# >1h because no caller transitioned the status. The Reconciler logged
|
|
261
|
+
# it as stale but its eviction path only handles `suspended/inactive`
|
|
262
|
+
# agents (not `active-but-idle`), so the work never made progress.
|
|
263
|
+
#
|
|
264
|
+
# Mirrors what `index.ts:queueProcessorService.setTaskPoolRouter` does
|
|
265
|
+
# for [TASK]-prefixed message dispatch — claimFromPool runs immediately
|
|
266
|
+
# after addToPool. The skill path now matches that contract.
|
|
267
|
+
#
|
|
268
|
+
# Failure is non-fatal: if claim fails (race, target locked, etc.) the
|
|
269
|
+
# WI stays queued and the Reconciler + AutoClaim will retry the legacy
|
|
270
|
+
# way. We log the failure so it's grep-able but don't block dispatch.
|
|
271
|
+
if [ -n "$WI_ID" ] && [ -n "$TO" ]; then
|
|
272
|
+
CLAIM_BODY=$(jq -n --arg agentId "$TO" --arg workItemId "$WI_ID" \
|
|
273
|
+
'{agentId: $agentId, workItemId: $workItemId}')
|
|
274
|
+
CLAIM_RESULT=$(api_call POST "/task-pool/claim" "$CLAIM_BODY" 2>/dev/null || echo '{"success":false}')
|
|
275
|
+
CLAIM_OK=$(echo "$CLAIM_RESULT" | jq -r '.success // "false"' 2>/dev/null)
|
|
276
|
+
if [ "$CLAIM_OK" != "true" ]; then
|
|
277
|
+
echo "warn: WorkItem $WI_ID created but immediate claim for $TO failed — falling back to async claim path" >&2
|
|
278
|
+
fi
|
|
279
|
+
fi
|
|
280
|
+
|
|
281
|
+
# --- Fallback trigger (self-heal fix #3) ---
|
|
282
|
+
# Per orchestrator prompt §3.0 every dispatch must close the loop with
|
|
283
|
+
# BOTH signals: (a) idle-event subscription, AND (b) fallback timer at
|
|
284
|
+
# 2× ETA. The agent:idle subscription is set elsewhere (tool-registry
|
|
285
|
+
# delegate_task auto-attach); this block enforces the timer half.
|
|
286
|
+
#
|
|
287
|
+
# Encoded as a /triggers POST that creates a self-targeted delegate WI
|
|
288
|
+
# at fire time, which surfaces "WI <id> dispatched to <target> N min
|
|
289
|
+
# ago — verify status" back into orc's pool. orc's normal dispatch loop
|
|
290
|
+
# then handles it like any other inbound task.
|
|
291
|
+
#
|
|
292
|
+
# Caller can override via --fallback-minutes N or disable with
|
|
293
|
+
# --fallback-minutes 0.
|
|
294
|
+
FALLBACK_TRIGGER_ID=""
|
|
295
|
+
if [ -n "$WI_ID" ] && [ "${FALLBACK_MINUTES:-0}" -gt 0 ] 2>/dev/null; then
|
|
296
|
+
# Compute the fireAt timestamp = now + FALLBACK_MINUTES.
|
|
297
|
+
# `date -v+Xm` on macOS, `date -d "+X minutes"` on GNU. Try both;
|
|
298
|
+
# silently skip the fallback if neither shape works rather than
|
|
299
|
+
# blocking the dispatch on a date-format quirk.
|
|
300
|
+
FIRE_AT=""
|
|
301
|
+
FIRE_AT=$(date -u -v+"${FALLBACK_MINUTES}"M +'%Y-%m-%dT%H:%M:%S.000Z' 2>/dev/null || \
|
|
302
|
+
date -u -d "+${FALLBACK_MINUTES} minutes" +'%Y-%m-%dT%H:%M:%S.000Z' 2>/dev/null || \
|
|
303
|
+
echo "")
|
|
304
|
+
|
|
305
|
+
if [ -n "$FIRE_AT" ]; then
|
|
306
|
+
FALLBACK_SESSION="${CREWLY_SESSION_NAME:-crewly-orc}"
|
|
307
|
+
TRIGGER_BODY=$(jq -n \
|
|
308
|
+
--arg type "time" \
|
|
309
|
+
--arg fireAt "$FIRE_AT" \
|
|
310
|
+
--arg target "$FALLBACK_SESSION" \
|
|
311
|
+
--arg createdBy "delegate-task" \
|
|
312
|
+
--arg name "fallback-${TO}-${WI_ID:0:8}" \
|
|
313
|
+
--arg title "Fallback check on ${TO} for task ${WI_ID:0:8}" \
|
|
314
|
+
--arg description "Per §3.0: ${FALLBACK_MINUTES}min fallback after dispatch to ${TO}. Check whether ${WI_ID} is making progress — if running but no output, re-prompt; if still queued, re-target or fail-fast." \
|
|
315
|
+
'{
|
|
316
|
+
type: $type,
|
|
317
|
+
config: {type: "time", fireAt: $fireAt},
|
|
318
|
+
action: {createWorkItem: {type: "delegate", owner: "system", target: $target, title: $title, description: $description}},
|
|
319
|
+
createdBy: $createdBy,
|
|
320
|
+
name: $name,
|
|
321
|
+
maxFires: 1
|
|
322
|
+
}')
|
|
323
|
+
TRIGGER_RESULT=$(api_call POST "/triggers" "$TRIGGER_BODY" 2>/dev/null || echo '{"success":false}')
|
|
324
|
+
TRIGGER_OK=$(echo "$TRIGGER_RESULT" | jq -r '.success // "false"' 2>/dev/null)
|
|
325
|
+
if [ "$TRIGGER_OK" = "true" ]; then
|
|
326
|
+
FALLBACK_TRIGGER_ID=$(echo "$TRIGGER_RESULT" | jq -r '.data.id // .triggerId // empty' 2>/dev/null || echo "")
|
|
327
|
+
else
|
|
328
|
+
echo "warn: WorkItem $WI_ID dispatched but fallback timer creation failed — orc's idle subscription is the only safety net" >&2
|
|
329
|
+
fi
|
|
330
|
+
fi
|
|
331
|
+
fi
|
|
332
|
+
|
|
244
333
|
# Output result
|
|
334
|
+
CLAIM_STATE=$([ "${CLAIM_OK:-false}" = "true" ] && echo "running" || echo "queued")
|
|
335
|
+
if [ "$CLAIM_STATE" = "running" ]; then
|
|
336
|
+
RESULT_MESSAGE="WorkItem created in TaskPool and immediately claimed by target."
|
|
337
|
+
else
|
|
338
|
+
RESULT_MESSAGE="WorkItem created in TaskPool (immediate claim failed — Reconciler will retry)."
|
|
339
|
+
fi
|
|
245
340
|
jq -n \
|
|
246
|
-
--arg success "true" \
|
|
247
341
|
--arg workItemId "${WI_ID:-}" \
|
|
248
342
|
--arg target "$TO" \
|
|
249
343
|
--arg priority "$WI_PRIORITY" \
|
|
250
344
|
--arg title "$WI_TITLE" \
|
|
251
|
-
|
|
345
|
+
--arg state "$CLAIM_STATE" \
|
|
346
|
+
--arg message "$RESULT_MESSAGE" \
|
|
347
|
+
--arg fallbackTriggerId "${FALLBACK_TRIGGER_ID:-}" \
|
|
348
|
+
--arg fallbackMinutes "${FALLBACK_MINUTES:-0}" \
|
|
349
|
+
'{success: true, workItemId: $workItemId, target: $target, priority: $priority, title: $title, state: $state, message: $message}
|
|
350
|
+
+ (if $fallbackTriggerId != "" then {fallbackTriggerId: $fallbackTriggerId, fallbackMinutes: ($fallbackMinutes|tonumber)} else {} end)'
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Tests for ORC delegate-task execute.sh
|
|
3
|
+
#
|
|
4
|
+
# Focused on the auto-claim transition added 2026-05-20 — the skill must
|
|
5
|
+
# call POST /task-pool/claim immediately after POST /task-pool/add succeeds,
|
|
6
|
+
# so the WI transitions queued → running at dispatch time and doesn't rot
|
|
7
|
+
# in queued waiting for a pull that may never come (the 2026-05-20
|
|
8
|
+
# ESTestNode incident).
|
|
9
|
+
#
|
|
10
|
+
# The skill is exercised under a stubbed api_call that records every
|
|
11
|
+
# REST call to a tmp file; assertions look at the call log + final JSON.
|
|
12
|
+
|
|
13
|
+
set -euo pipefail
|
|
14
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
15
|
+
PASS=0
|
|
16
|
+
FAIL=0
|
|
17
|
+
|
|
18
|
+
CALL_LOG=$(mktemp)
|
|
19
|
+
SKILL_PARENT=$(mktemp -d)
|
|
20
|
+
trap 'rm -rf "$SKILL_PARENT" "$CALL_LOG"' EXIT
|
|
21
|
+
|
|
22
|
+
# Build a fake skill-parent dir that mirrors config/skills layout:
|
|
23
|
+
# <SKILL_PARENT>/_common/lib.sh ← real lib.sh + api_call override
|
|
24
|
+
# <SKILL_PARENT>/delegate-task/execute.sh ← real skill copy
|
|
25
|
+
# The skill resolves `${SCRIPT_DIR}/../_common/lib.sh`, so this layout
|
|
26
|
+
# satisfies the source path.
|
|
27
|
+
mkdir -p "$SKILL_PARENT/_common" "$SKILL_PARENT/delegate-task"
|
|
28
|
+
|
|
29
|
+
# Compose a test lib.sh: source the real one (for require_param,
|
|
30
|
+
# resolve_team_id, auto_remember, etc.) then override api_call so we
|
|
31
|
+
# can record + canned-reply without making real HTTP calls.
|
|
32
|
+
REAL_LIB="$(cd "$SCRIPT_DIR/../.." && pwd)/_common/lib.sh"
|
|
33
|
+
cat > "$SKILL_PARENT/_common/lib.sh" <<EOF
|
|
34
|
+
source "$REAL_LIB"
|
|
35
|
+
api_call() {
|
|
36
|
+
local method="\$1" path="\$2" body="\${3:-}"
|
|
37
|
+
echo "\${method} \${path} \${body}" >> "${CALL_LOG}"
|
|
38
|
+
case "\${path}" in
|
|
39
|
+
/task-pool/add)
|
|
40
|
+
echo '{"success":true,"data":{"id":"wi-stub-id"}}'
|
|
41
|
+
;;
|
|
42
|
+
/task-pool/claim)
|
|
43
|
+
if [ "\${TEST_CLAIM_FAIL:-0}" = "1" ]; then
|
|
44
|
+
echo '{"success":false,"error":"claim race"}'
|
|
45
|
+
else
|
|
46
|
+
echo '{"success":true,"data":{"claimId":"c-stub"}}'
|
|
47
|
+
fi
|
|
48
|
+
;;
|
|
49
|
+
/triggers)
|
|
50
|
+
if [ "\${TEST_TRIGGER_FAIL:-0}" = "1" ]; then
|
|
51
|
+
echo '{"success":false,"error":"trigger backend down"}'
|
|
52
|
+
else
|
|
53
|
+
echo '{"success":true,"data":{"id":"trg-stub-id"}}'
|
|
54
|
+
fi
|
|
55
|
+
;;
|
|
56
|
+
*)
|
|
57
|
+
echo '{"success":true}'
|
|
58
|
+
;;
|
|
59
|
+
esac
|
|
60
|
+
}
|
|
61
|
+
EOF
|
|
62
|
+
|
|
63
|
+
cp "$SCRIPT_DIR/execute.sh" "$SKILL_PARENT/delegate-task/execute.sh"
|
|
64
|
+
chmod +x "$SKILL_PARENT/delegate-task/execute.sh"
|
|
65
|
+
|
|
66
|
+
assert_log_contains() {
|
|
67
|
+
local desc="$1" pattern="$2"
|
|
68
|
+
if grep -q "$pattern" "$CALL_LOG"; then
|
|
69
|
+
echo " PASS: $desc"
|
|
70
|
+
PASS=$((PASS + 1))
|
|
71
|
+
else
|
|
72
|
+
echo " FAIL: $desc (expected log entry matching '$pattern')"
|
|
73
|
+
echo " Call log was:"
|
|
74
|
+
sed 's/^/ /' "$CALL_LOG"
|
|
75
|
+
FAIL=$((FAIL + 1))
|
|
76
|
+
fi
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
assert_output_contains() {
|
|
80
|
+
local desc="$1" expected="$2" output="$3"
|
|
81
|
+
if echo "$output" | grep -q "$expected"; then
|
|
82
|
+
echo " PASS: $desc"
|
|
83
|
+
PASS=$((PASS + 1))
|
|
84
|
+
else
|
|
85
|
+
echo " FAIL: $desc (expected '$expected' in output, got: $output)"
|
|
86
|
+
FAIL=$((FAIL + 1))
|
|
87
|
+
fi
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
echo "=== ORC delegate-task — auto-claim regression ==="
|
|
91
|
+
|
|
92
|
+
# --- Test 1: happy path — claim is called after add ---
|
|
93
|
+
> "$CALL_LOG"
|
|
94
|
+
OUT=$(CALL_LOG="$CALL_LOG" CREWLY_ROOT=/tmp/crewly-test \
|
|
95
|
+
bash "${SKILL_PARENT}/delegate-task/execute.sh" \
|
|
96
|
+
--to crewly-test-bob \
|
|
97
|
+
--task "Test delegation" \
|
|
98
|
+
--priority normal \
|
|
99
|
+
2>&1 || true)
|
|
100
|
+
|
|
101
|
+
assert_log_contains "POST /task-pool/add fires first" "POST /task-pool/add"
|
|
102
|
+
assert_log_contains "POST /task-pool/claim fires after add" "POST /task-pool/claim"
|
|
103
|
+
assert_output_contains "result state=running on successful claim" '"state": "running"' "$OUT"
|
|
104
|
+
assert_output_contains "result reports immediate claim" "immediately claimed" "$OUT"
|
|
105
|
+
|
|
106
|
+
# Verify ORDER — claim must come AFTER add
|
|
107
|
+
ADD_LINE=$(grep -n "POST /task-pool/add" "$CALL_LOG" | head -1 | cut -d: -f1)
|
|
108
|
+
CLAIM_LINE=$(grep -n "POST /task-pool/claim" "$CALL_LOG" | head -1 | cut -d: -f1)
|
|
109
|
+
if [ -n "$ADD_LINE" ] && [ -n "$CLAIM_LINE" ] && [ "$ADD_LINE" -lt "$CLAIM_LINE" ]; then
|
|
110
|
+
echo " PASS: claim fires AFTER add (lines $ADD_LINE < $CLAIM_LINE)"
|
|
111
|
+
PASS=$((PASS + 1))
|
|
112
|
+
else
|
|
113
|
+
echo " FAIL: claim should fire AFTER add (add=$ADD_LINE claim=$CLAIM_LINE)"
|
|
114
|
+
FAIL=$((FAIL + 1))
|
|
115
|
+
fi
|
|
116
|
+
|
|
117
|
+
# Verify claim body carries the target session as agentId
|
|
118
|
+
assert_log_contains "claim body names target as agentId" 'crewly-test-bob'
|
|
119
|
+
|
|
120
|
+
# --- Test 2: claim failure is non-fatal ---
|
|
121
|
+
> "$CALL_LOG"
|
|
122
|
+
OUT=$(TEST_CLAIM_FAIL=1 CALL_LOG="$CALL_LOG" CREWLY_ROOT=/tmp/crewly-test \
|
|
123
|
+
bash "${SKILL_PARENT}/delegate-task/execute.sh" \
|
|
124
|
+
--to crewly-test-bob \
|
|
125
|
+
--task "Test delegation" \
|
|
126
|
+
--priority normal \
|
|
127
|
+
2>/dev/null || true)
|
|
128
|
+
|
|
129
|
+
assert_log_contains "POST /task-pool/add still fires when claim will fail" "POST /task-pool/add"
|
|
130
|
+
assert_log_contains "POST /task-pool/claim is attempted" "POST /task-pool/claim"
|
|
131
|
+
assert_output_contains "result state=queued on claim failure" '"state": "queued"' "$OUT"
|
|
132
|
+
assert_output_contains "result still reports success when claim fails" '"success": true' "$OUT"
|
|
133
|
+
|
|
134
|
+
# --- Test 3: fallback trigger fires by default ---
|
|
135
|
+
> "$CALL_LOG"
|
|
136
|
+
OUT=$(CALL_LOG="$CALL_LOG" CREWLY_ROOT=/tmp/crewly-test \
|
|
137
|
+
bash "${SKILL_PARENT}/delegate-task/execute.sh" \
|
|
138
|
+
--to crewly-test-bob \
|
|
139
|
+
--task "Test delegation with fallback" \
|
|
140
|
+
--priority normal \
|
|
141
|
+
2>/dev/null || true)
|
|
142
|
+
|
|
143
|
+
assert_log_contains "POST /triggers fires after dispatch by default" "POST /triggers"
|
|
144
|
+
assert_output_contains "result reports fallbackTriggerId" "fallbackTriggerId" "$OUT"
|
|
145
|
+
assert_output_contains "result reports fallbackMinutes=30 (default)" '"fallbackMinutes": 30' "$OUT"
|
|
146
|
+
|
|
147
|
+
# --- Test 4: fallback can be disabled via --fallback-minutes 0 ---
|
|
148
|
+
> "$CALL_LOG"
|
|
149
|
+
OUT=$(CALL_LOG="$CALL_LOG" CREWLY_ROOT=/tmp/crewly-test \
|
|
150
|
+
bash "${SKILL_PARENT}/delegate-task/execute.sh" \
|
|
151
|
+
--to crewly-test-bob \
|
|
152
|
+
--task "Quick fire-and-forget" \
|
|
153
|
+
--fallback-minutes 0 \
|
|
154
|
+
2>/dev/null || true)
|
|
155
|
+
|
|
156
|
+
if grep -q "POST /triggers" "$CALL_LOG"; then
|
|
157
|
+
echo " FAIL: --fallback-minutes 0 should suppress trigger creation"
|
|
158
|
+
FAIL=$((FAIL + 1))
|
|
159
|
+
else
|
|
160
|
+
echo " PASS: --fallback-minutes 0 suppresses trigger creation"
|
|
161
|
+
PASS=$((PASS + 1))
|
|
162
|
+
fi
|
|
163
|
+
if echo "$OUT" | grep -q "fallbackTriggerId"; then
|
|
164
|
+
echo " FAIL: output should not include fallbackTriggerId when disabled"
|
|
165
|
+
FAIL=$((FAIL + 1))
|
|
166
|
+
else
|
|
167
|
+
echo " PASS: output omits fallbackTriggerId when disabled"
|
|
168
|
+
PASS=$((PASS + 1))
|
|
169
|
+
fi
|
|
170
|
+
|
|
171
|
+
# --- Test 5: trigger failure is non-fatal (dispatch still succeeds) ---
|
|
172
|
+
> "$CALL_LOG"
|
|
173
|
+
OUT=$(TEST_TRIGGER_FAIL=1 CALL_LOG="$CALL_LOG" CREWLY_ROOT=/tmp/crewly-test \
|
|
174
|
+
bash "${SKILL_PARENT}/delegate-task/execute.sh" \
|
|
175
|
+
--to crewly-test-bob \
|
|
176
|
+
--task "Trigger backend will fail" \
|
|
177
|
+
2>/dev/null || true)
|
|
178
|
+
|
|
179
|
+
assert_output_contains "result still success when trigger fails" '"success": true' "$OUT"
|
|
180
|
+
if echo "$OUT" | grep -q "fallbackTriggerId"; then
|
|
181
|
+
echo " FAIL: output should not include fallbackTriggerId when trigger create fails"
|
|
182
|
+
FAIL=$((FAIL + 1))
|
|
183
|
+
else
|
|
184
|
+
echo " PASS: output omits fallbackTriggerId when trigger creation fails"
|
|
185
|
+
PASS=$((PASS + 1))
|
|
186
|
+
fi
|
|
187
|
+
|
|
188
|
+
# --- Test 6: custom --fallback-minutes is propagated ---
|
|
189
|
+
> "$CALL_LOG"
|
|
190
|
+
OUT=$(CALL_LOG="$CALL_LOG" CREWLY_ROOT=/tmp/crewly-test \
|
|
191
|
+
bash "${SKILL_PARENT}/delegate-task/execute.sh" \
|
|
192
|
+
--to crewly-test-bob \
|
|
193
|
+
--task "Long-running milestone" \
|
|
194
|
+
--fallback-minutes 120 \
|
|
195
|
+
2>/dev/null || true)
|
|
196
|
+
|
|
197
|
+
assert_output_contains "result reports custom fallbackMinutes=120" '"fallbackMinutes": 120' "$OUT"
|
|
198
|
+
|
|
199
|
+
# --- Summary ---
|
|
200
|
+
echo ""
|
|
201
|
+
echo "=== Results: $PASS passed, $FAIL failed ==="
|
|
202
|
+
[ "$FAIL" -eq 0 ]
|
|
@@ -83,6 +83,7 @@ export declare const MEMORY_CONSTANTS: {
|
|
|
83
83
|
readonly DECISIONS: "decisions.json";
|
|
84
84
|
readonly GOTCHAS: "gotchas.json";
|
|
85
85
|
readonly RELATIONSHIPS: "relationships.json";
|
|
86
|
+
readonly TASK_HISTORY: "task-history.json";
|
|
86
87
|
readonly LEARNINGS: "learnings.md";
|
|
87
88
|
};
|
|
88
89
|
readonly LIMITS: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../backend/src/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH,eAAO,MAAM,kBAAkB;;;;CAA4B,CAAC;AAC5D,eAAO,MAAM,wBAAwB;;;;;;CAAkC,CAAC;AACxE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA0B,CAAC;AACxD,eAAO,MAAM,gBAAgB
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../backend/src/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAuBH,eAAO,MAAM,kBAAkB;;;;CAA4B,CAAC;AAC5D,eAAO,MAAM,wBAAwB;;;;;;CAAkC,CAAC;AACxE,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA0B,CAAC;AACxD,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAA0B,CAAC;AACxD,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAgC,CAAC;AACpE,eAAO,MAAM,8BAA8B;;;;CAAwC,CAAC;AACpF,eAAO,MAAM,uBAAuB;;;;;;;;;CAAiC,CAAC;AACtE,eAAO,MAAM,uBAAuB;;;;;CAAiC,CAAC;AACtE,eAAO,MAAM,iCAAiC;;;;;;CAA2C,CA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AqB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAuBxG;AAED,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAoB3G;AAED,wBAAsB,oBAAoB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBvG;AAED,wBAAsB,qBAAqB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAwMxG;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CA+F1G;AAED;;GAEG;AACH,wBAAsB,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAgR7F;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAwC9F"}
|
|
@@ -7,6 +7,8 @@ import { getSettingsService } from '../../services/settings/settings.service.js'
|
|
|
7
7
|
import { getTerminalGateway } from '../../websocket/terminal.gateway.js';
|
|
8
8
|
import { ActivityMonitorService } from '../../services/monitoring/activity-monitor.service.js';
|
|
9
9
|
import { MemoryService } from '../../services/memory/memory.service.js';
|
|
10
|
+
import { ProjectMemoryService } from '../../services/memory/project-memory.service.js';
|
|
11
|
+
import { seedDeclaredCapabilities } from '../../services/memory/task-history-seeder.js';
|
|
10
12
|
import { validateAgentRole, InvalidAgentRoleError, } from '../../services/agent/agent-registration.service.js';
|
|
11
13
|
import { SubAgentMessageQueue } from '../../services/messaging/sub-agent-message-queue.service.js';
|
|
12
14
|
import { SUB_AGENT_QUEUE_CONSTANTS } from '../../constants.js';
|
|
@@ -1881,6 +1883,31 @@ export async function registerMemberStatus(req, res) {
|
|
|
1881
1883
|
}
|
|
1882
1884
|
freshTeam.updatedAt = new Date().toISOString();
|
|
1883
1885
|
await this.storageService.saveTeam(freshTeam);
|
|
1886
|
+
// Cold-start capability seeding — if this member's config
|
|
1887
|
+
// declares any canonical capabilities (entries containing
|
|
1888
|
+
// `:`), write a synthetic 'declared' TaskHistoryEntry so
|
|
1889
|
+
// the orchestrator's `recall(capability)` query can find
|
|
1890
|
+
// them on day-0, before any real task has run. Non-fatal:
|
|
1891
|
+
// a write failure here cannot block registration.
|
|
1892
|
+
try {
|
|
1893
|
+
const projectPath = process.env.CREWLY_PROJECT_PATH || process.cwd();
|
|
1894
|
+
await seedDeclaredCapabilities({
|
|
1895
|
+
projectPath,
|
|
1896
|
+
member: {
|
|
1897
|
+
sessionName: freshMember.sessionName,
|
|
1898
|
+
role: freshMember.role,
|
|
1899
|
+
teamId: freshTeam.id,
|
|
1900
|
+
capabilities: freshMember.capabilities,
|
|
1901
|
+
},
|
|
1902
|
+
projectMemory: ProjectMemoryService.getInstance(),
|
|
1903
|
+
});
|
|
1904
|
+
}
|
|
1905
|
+
catch (seedErr) {
|
|
1906
|
+
logger.warn('Capability seeding failed (non-fatal)', {
|
|
1907
|
+
sessionName,
|
|
1908
|
+
error: seedErr instanceof Error ? seedErr.message : String(seedErr),
|
|
1909
|
+
});
|
|
1910
|
+
}
|
|
1884
1911
|
}
|
|
1885
1912
|
}
|
|
1886
1913
|
// Store claudeSessionId for resume-on-restart support
|