opencodekit 0.15.9 → 0.15.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/dist/index.js +9 -7
- package/dist/template/.opencode/AGENTS.md +7 -2
- package/dist/template/.opencode/agent/build.md +390 -0
- package/dist/template/.opencode/agent/general.md +1 -0
- package/dist/template/.opencode/agent/looker.md +1 -0
- package/dist/template/.opencode/agent/painter.md +218 -0
- package/dist/template/.opencode/agent/plan.md +3 -0
- package/dist/template/.opencode/agent/vision.md +1 -0
- package/dist/template/.opencode/command/edit-image.md +1 -2
- package/dist/template/.opencode/command/generate-icon.md +1 -2
- package/dist/template/.opencode/command/generate-image.md +1 -2
- package/dist/template/.opencode/command/generate-pattern.md +1 -2
- package/dist/template/.opencode/command/generate-storyboard.md +1 -2
- package/dist/template/.opencode/command/implement.md +136 -10
- package/dist/template/.opencode/command/restore-image.md +1 -2
- package/dist/template/.opencode/dcp.jsonc +1 -15
- package/dist/template/.opencode/memory/observations/2026-01-25-decision-agent-roles-build-orchestrates-general-e.md +14 -0
- package/dist/template/.opencode/memory/observations/2026-01-25-decision-simplified-swarm-helper-tool-to-fix-type.md +20 -0
- package/dist/template/.opencode/memory/observations/2026-01-25-decision-use-beads-as-swarm-board-source-of-truth.md +14 -0
- package/dist/template/.opencode/memory/observations/2026-01-25-learning-user-wants-real-swarm-coordination-guida.md +15 -0
- package/dist/template/.opencode/memory/research/opencode-mcp-bug-report.md +126 -0
- package/dist/template/.opencode/opencode.json +812 -704
- package/dist/template/.opencode/package.json +1 -1
- package/dist/template/.opencode/plans/swarm-protocol.md +123 -0
- package/dist/template/.opencode/plugin/README.md +10 -0
- package/dist/template/.opencode/plugin/swarm-enforcer.ts +297 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/AGENTS.md +1490 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/SKILL.md +57 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/advanced-full-text-search.md +55 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/advanced-jsonb-indexing.md +49 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/conn-idle-timeout.md +46 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/conn-limits.md +44 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/conn-pooling.md +41 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/conn-prepared-statements.md +46 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/data-batch-inserts.md +54 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/data-n-plus-one.md +53 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/data-pagination.md +50 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/data-upsert.md +50 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/lock-advisory.md +56 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/lock-deadlock-prevention.md +68 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/lock-short-transactions.md +50 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/lock-skip-locked.md +54 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/monitor-explain-analyze.md +45 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/monitor-pg-stat-statements.md +55 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/monitor-vacuum-analyze.md +55 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/query-composite-indexes.md +44 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/query-covering-indexes.md +40 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/query-index-types.md +45 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/query-missing-indexes.md +43 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/query-partial-indexes.md +45 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/schema-data-types.md +46 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/schema-foreign-key-indexes.md +59 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/schema-lowercase-identifiers.md +55 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/schema-partitioning.md +55 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/schema-primary-keys.md +61 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/security-privileges.md +54 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/security-rls-basics.md +50 -0
- package/dist/template/.opencode/skill/supabase-postgres-best-practices/rules/security-rls-performance.md +57 -0
- package/dist/template/.opencode/skill/swarm-coordination/SKILL.md +405 -0
- package/dist/template/.opencode/tool/swarm-delegate.ts +175 -0
- package/dist/template/.opencode/tool/swarm-helper.ts +164 -0
- package/package.json +1 -1
|
@@ -89,6 +89,7 @@ Load skill(s) → Systematic analysis → Structured findings → Recommendation
|
|
|
89
89
|
|
|
90
90
|
- Embed CLI commands in responses (use skills/commands instead)
|
|
91
91
|
- Implement changes directly (delegate to @build)
|
|
92
|
+
- Generate or edit images directly (delegate to @painter)
|
|
92
93
|
- Make assumptions about intent without clarifying
|
|
93
94
|
- Skip skill loading for complex tasks
|
|
94
95
|
- Provide generic "looks good" assessments
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Edit image with natural language instructions
|
|
3
3
|
argument-hint: "<image-path> <edit-instruction> [--hd] [--preserve-size] [--compare]"
|
|
4
|
-
agent:
|
|
5
|
-
model: proxypal/gemini-3-pro-image-preview
|
|
4
|
+
agent: painter
|
|
6
5
|
---
|
|
7
6
|
|
|
8
7
|
# Edit Image: $ARGUMENTS
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Generate app icons in multiple sizes with platform optimization
|
|
3
3
|
argument-hint: "<description> [--platform=<ios|android|web|all>] [--style=<style>] [--shape=<shape>] [--color=<hex>] [--dark]"
|
|
4
|
-
agent:
|
|
5
|
-
model: proxypal/gemini-3-pro-image-preview
|
|
4
|
+
agent: painter
|
|
6
5
|
---
|
|
7
6
|
|
|
8
7
|
# Generate Icon: $ARGUMENTS
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Generate images using Gemini image models
|
|
3
3
|
argument-hint: "<prompt> [--style=<style>] [--aspect=<ratio>] [--size=<size>] [--count=<n>] [--pro]"
|
|
4
|
-
agent:
|
|
5
|
-
model: proxypal/gemini-3-pro-image-preview
|
|
4
|
+
agent: painter
|
|
6
5
|
---
|
|
7
6
|
|
|
8
7
|
# Generate Image: $ARGUMENTS
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Generate seamless patterns and textures
|
|
3
3
|
argument-hint: "<description> [--type=<type>] [--style=<style>] [--colors=<palette>] [--density=<level>] [--size=<px>]"
|
|
4
|
-
agent:
|
|
5
|
-
model: proxypal/gemini-3-pro-image-preview
|
|
4
|
+
agent: painter
|
|
6
5
|
---
|
|
7
6
|
|
|
8
7
|
# Generate Pattern: $ARGUMENTS
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Generate sequential images for visual storytelling
|
|
3
3
|
argument-hint: "<story-description> [--frames=<N>] [--style=<style>] [--aspect=<ratio>] [--layout=<layout>]"
|
|
4
|
-
agent:
|
|
5
|
-
model: proxypal/gemini-3-pro-image-preview
|
|
4
|
+
agent: painter
|
|
6
5
|
---
|
|
7
6
|
|
|
8
7
|
# Generate Storyboard: $ARGUMENTS
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Implement a bead - load context, delegate research, make changes, verify
|
|
3
|
-
argument-hint: "<bead-id> [--parallel]"
|
|
3
|
+
argument-hint: "<bead-id> [--parallel] [--swarm]"
|
|
4
4
|
agent: build
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -14,6 +14,7 @@ You're implementing a tracked task. Stay focused, delegate research, verify as y
|
|
|
14
14
|
| ------------ | -------- | ----------------------------------------- |
|
|
15
15
|
| `<bead-id>` | required | The bead to implement |
|
|
16
16
|
| `--parallel` | false | Run aggressive parallel subagent research |
|
|
17
|
+
| `--swarm` | false | Use swarm coordination for parallel tasks |
|
|
17
18
|
|
|
18
19
|
## First: Load Skills & Context
|
|
19
20
|
|
|
@@ -21,6 +22,7 @@ You're implementing a tracked task. Stay focused, delegate research, verify as y
|
|
|
21
22
|
skill({ name: "beads" });
|
|
22
23
|
skill({ name: "test-driven-development" });
|
|
23
24
|
skill({ name: "verification-before-completion" });
|
|
25
|
+
skill({ name: "swarm-coordination" }); // For swarm mode
|
|
24
26
|
```
|
|
25
27
|
|
|
26
28
|
Get the task details and check hierarchy:
|
|
@@ -33,8 +35,8 @@ bd list --status=in_progress # See what else is active
|
|
|
33
35
|
|
|
34
36
|
Check for messages from other agents:
|
|
35
37
|
|
|
36
|
-
```
|
|
37
|
-
bd
|
|
38
|
+
```bash
|
|
39
|
+
bd inbox --unread -n 5
|
|
38
40
|
```
|
|
39
41
|
|
|
40
42
|
## Check Hierarchy Position
|
|
@@ -55,7 +57,131 @@ bd ready --json | grep -q "$ARGUMENTS"
|
|
|
55
57
|
|
|
56
58
|
→ Work on ready subtasks instead: `/implement <subtask-id>`
|
|
57
59
|
|
|
58
|
-
**Or
|
|
60
|
+
**Or use SWARM MODE for parallel execution (recommended for 3+ subtasks):**
|
|
61
|
+
|
|
62
|
+
## Swarm Mode Execution (--swarm flag or auto-detect)
|
|
63
|
+
|
|
64
|
+
When the task has 3+ independent subtasks that can run in parallel, use swarm coordination:
|
|
65
|
+
|
|
66
|
+
### Step 1: Evaluate Swarm Eligibility
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
// Check if subtasks are parallelizable:
|
|
70
|
+
// - Do they modify different files? → YES = parallel OK
|
|
71
|
+
// - Are they sequentially dependent? → NO = parallel OK
|
|
72
|
+
// - Are there 3+ independent tasks? → YES = swarm beneficial
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Step 2: Create Delegation Packets
|
|
76
|
+
|
|
77
|
+
For each parallelizable subtask:
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
swarm_delegate({
|
|
81
|
+
bead_id: "<subtask-id>",
|
|
82
|
+
title: "Subtask title from bead",
|
|
83
|
+
expected_outcome: "Measurable completion criteria",
|
|
84
|
+
required_tools: "read, grep, lsp, edit, bash",
|
|
85
|
+
must_do: "LSP before edits, run project verification commands",
|
|
86
|
+
must_not_do: "No new deps, don't edit files outside scope",
|
|
87
|
+
acceptance_checks: "typecheck: npm run typecheck, lint: npm run lint, test: npm test",
|
|
88
|
+
context: "Part of epic $ARGUMENTS. See spec for requirements.",
|
|
89
|
+
write: true,
|
|
90
|
+
});
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Step 3: Reserve File Sets
|
|
94
|
+
|
|
95
|
+
Prevent conflicts between workers:
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
# Reserve files for each worker
|
|
99
|
+
bd reserve "src/domain-a/*" --reason "swarm: subtask-1"
|
|
100
|
+
bd reserve "src/domain-b/*" --reason "swarm: subtask-2"
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Step 4: Spawn Worker Swarm
|
|
104
|
+
|
|
105
|
+
Launch all workers in parallel (multiple Task calls in one message):
|
|
106
|
+
|
|
107
|
+
```typescript
|
|
108
|
+
// All run simultaneously
|
|
109
|
+
Task({
|
|
110
|
+
subagent_type: "general",
|
|
111
|
+
description: "Execute subtask-1",
|
|
112
|
+
prompt: `Execute bead <subtask-1>: <title>
|
|
113
|
+
|
|
114
|
+
## Delegation
|
|
115
|
+
Read: .beads/artifacts/<subtask-1>/delegation.md
|
|
116
|
+
|
|
117
|
+
## Coordination
|
|
118
|
+
Team: $ARGUMENTS-swarm
|
|
119
|
+
Worker: worker-1
|
|
120
|
+
|
|
121
|
+
## Protocol
|
|
122
|
+
1. Read delegation packet FIRST
|
|
123
|
+
2. Announce start: swarm-helper sendTeamMessage
|
|
124
|
+
3. Execute following MUST DO / avoiding MUST NOT DO
|
|
125
|
+
4. Run ALL acceptance checks
|
|
126
|
+
5. Report completion: swarm-helper sendTeamMessage
|
|
127
|
+
|
|
128
|
+
Report format:
|
|
129
|
+
- DONE: <summary> (if successful)
|
|
130
|
+
- ERROR: <issue> (if failed)`,
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
Task({
|
|
134
|
+
subagent_type: "general",
|
|
135
|
+
description: "Execute subtask-2",
|
|
136
|
+
prompt: `Execute bead <subtask-2>: <title>
|
|
137
|
+
...same pattern, different worker name...`,
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
Task({
|
|
141
|
+
subagent_type: "general",
|
|
142
|
+
description: "Execute subtask-3",
|
|
143
|
+
prompt: `Execute bead <subtask-3>: <title>
|
|
144
|
+
...same pattern, different worker name...`,
|
|
145
|
+
});
|
|
146
|
+
// Results available when all complete
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Step 5: Monitor Progress
|
|
150
|
+
|
|
151
|
+
Check mailbox for worker status:
|
|
152
|
+
|
|
153
|
+
```typescript
|
|
154
|
+
swarm_helper({
|
|
155
|
+
operation: "getTeamStatus",
|
|
156
|
+
team_name: "$ARGUMENTS-swarm",
|
|
157
|
+
limit: 20,
|
|
158
|
+
});
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### Step 6: Handle Worker Reports
|
|
162
|
+
|
|
163
|
+
| Message | Action |
|
|
164
|
+
| ------- | --------------------------------------- |
|
|
165
|
+
| DONE | Mark subtask complete, continue waiting |
|
|
166
|
+
| ERROR | Analyze, fix locally or respawn |
|
|
167
|
+
| BLOCKED | Resolve blocker, send guidance |
|
|
168
|
+
|
|
169
|
+
### Step 7: Final Verification
|
|
170
|
+
|
|
171
|
+
After all workers complete:
|
|
172
|
+
|
|
173
|
+
```bash
|
|
174
|
+
# Full verification suite
|
|
175
|
+
npm run typecheck && npm run lint && npm test
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### Step 8: Close Epic
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
bd close $ARGUMENTS --reason "Swarm completed all subtasks: <summary>"
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
**Or execute READY subtasks sequentially (non-swarm mode):**
|
|
59
185
|
|
|
60
186
|
```typescript
|
|
61
187
|
// Get all READY subtasks for this epic
|
|
@@ -264,14 +390,14 @@ If you hit 80% of budget without finishing, create a handoff. Don't push past li
|
|
|
264
390
|
|
|
265
391
|
For shared files or multi-agent coordination:
|
|
266
392
|
|
|
267
|
-
```
|
|
268
|
-
bd
|
|
393
|
+
```bash
|
|
394
|
+
bd reserve src/file-to-edit.ts --ttl 600
|
|
269
395
|
```
|
|
270
396
|
|
|
271
397
|
Release after completing edits:
|
|
272
398
|
|
|
273
|
-
```
|
|
274
|
-
bd
|
|
399
|
+
```bash
|
|
400
|
+
bd release src/file-to-edit.ts
|
|
275
401
|
```
|
|
276
402
|
|
|
277
403
|
## Do The Work
|
|
@@ -417,6 +543,6 @@ Then start a fresh session. Don't grind past diminishing returns.
|
|
|
417
543
|
|
|
418
544
|
Before ending session:
|
|
419
545
|
|
|
420
|
-
```
|
|
421
|
-
bd
|
|
546
|
+
```bash
|
|
547
|
+
bd release --all # Release all your locks
|
|
422
548
|
```
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Restore, enhance, upscale, or improve image quality using AI
|
|
3
3
|
argument-hint: "<image-path> [mode: enhance|upscale|restore|denoise|colorize]"
|
|
4
|
-
agent:
|
|
5
|
-
model: proxypal/gemini-3-pro-image-preview
|
|
4
|
+
agent: painter
|
|
6
5
|
---
|
|
7
6
|
|
|
8
7
|
# Restore Image: $ARGUMENTS
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"enabled": true,
|
|
4
4
|
"debug": false,
|
|
5
5
|
// "minimal" shows prune activity without noise; "detailed" shows token counts
|
|
6
|
-
"pruneNotification": "
|
|
6
|
+
"pruneNotification": "off",
|
|
7
7
|
"turnProtection": {
|
|
8
8
|
"enabled": true,
|
|
9
9
|
// 3 turns = faster cleanup while still protecting recent context
|
|
@@ -19,20 +19,6 @@
|
|
|
19
19
|
"**/tsconfig.json",
|
|
20
20
|
"**/biome.json",
|
|
21
21
|
],
|
|
22
|
-
// Custom slash commands (v1.2.4+)
|
|
23
|
-
"commands": {
|
|
24
|
-
"sweep": {
|
|
25
|
-
"description": "Aggressive context cleanup",
|
|
26
|
-
"action": "prune",
|
|
27
|
-
"options": {
|
|
28
|
-
"aggressive": true,
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
"context": {
|
|
32
|
-
"description": "Show context usage stats",
|
|
33
|
-
"action": "stats",
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
22
|
"tools": {
|
|
37
23
|
"settings": {
|
|
38
24
|
"nudgeEnabled": true,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: decision
|
|
3
|
+
created: 2026-01-25T05:33:03.130Z
|
|
4
|
+
confidence: high
|
|
5
|
+
valid_until: null
|
|
6
|
+
superseded_by: null
|
|
7
|
+
concepts: ["agents", "build", "general", "orchestrator", "executor", "workflow", "swarm"]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 🎯 Agent roles: Build orchestrates, General executes
|
|
11
|
+
|
|
12
|
+
🟢 **Confidence:** high
|
|
13
|
+
|
|
14
|
+
User decided on agent role split: Build is the primary orchestrator/lead agent controlling the workflow; General is the executor/implementer for individual Beads tasks. Other agents (plan/explore/scout/review) support as needed.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: decision
|
|
3
|
+
created: 2026-01-25T06:49:53.678Z
|
|
4
|
+
confidence: high
|
|
5
|
+
valid_until: null
|
|
6
|
+
superseded_by: null
|
|
7
|
+
files: [".opencode/tool/swarm-helper.ts"]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 🎯 Simplified swarm-helper tool to fix TypeScript errors
|
|
11
|
+
|
|
12
|
+
🟢 **Confidence:** high
|
|
13
|
+
|
|
14
|
+
The swarm-helper tool had TypeScript errors because it tried to import and use a `Task` function that doesn't exist in the @opencode-ai/plugin package. The @opencode-ai/plugin package only exports `tool`, not a `Task` function.
|
|
15
|
+
|
|
16
|
+
Solution: Simplified the tool to only provide coordination operations that don't require external tool calls:
|
|
17
|
+
- Removed: spawnTeam, assignTask operations
|
|
18
|
+
- Kept: getTeamStatus, sendTeamMessage operations
|
|
19
|
+
|
|
20
|
+
Team spawning should be done directly via the task tool in the command workflows, not wrapped in this helper. This keeps the tool focused on mailbox coordination only.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: decision
|
|
3
|
+
created: 2026-01-25T04:48:21.517Z
|
|
4
|
+
confidence: high
|
|
5
|
+
valid_until: null
|
|
6
|
+
superseded_by: null
|
|
7
|
+
concepts: ["beads", "swarm-protocol", "task-board", "dependencies", "source-of-truth", "opencode"]
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# 🎯 Use Beads as swarm board source of truth
|
|
11
|
+
|
|
12
|
+
🟢 **Confidence:** high
|
|
13
|
+
|
|
14
|
+
User preference/decision: use `.beads/` as the single source of truth for the swarm task board (tasks + dependencies). Avoid introducing a separate swarm board file; plugins/tools should read from and write through Beads workflows.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: learning
|
|
3
|
+
created: 2026-01-25T04:43:38.235Z
|
|
4
|
+
confidence: high
|
|
5
|
+
valid_until: null
|
|
6
|
+
superseded_by: null
|
|
7
|
+
concepts: ["swarms", "multi-agent", "orchestration", "delegation", "task-board", "dependencies", "coordination", "opencode"]
|
|
8
|
+
files: [".opencode/AGENTS.md"]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# 📚 User wants real swarm coordination guidance
|
|
12
|
+
|
|
13
|
+
🟢 **Confidence:** high
|
|
14
|
+
|
|
15
|
+
User wants best-practice guidance for building/improving 'real swarms' (multi-agent coordination) beyond centralized orchestration. They asked me to review `.opencode/AGENTS.md` and all `.opencode/agent/*.md` specs and synthesize improvements: shared task board with dependencies, parallel specialists, and coordination/messaging patterns compatible with their constraints (security-first, no URL guessing, delegation thresholds, LSP-first before edits, read-only specialists).
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# OpenCode MCP Bug Report
|
|
2
|
+
|
|
3
|
+
## Title
|
|
4
|
+
|
|
5
|
+
MCP tool calls fail with `TypeError: undefined is not an object (evaluating 'output.output.includes')` despite successful connection
|
|
6
|
+
|
|
7
|
+
## Environment
|
|
8
|
+
|
|
9
|
+
- **OpenCode version**: 1.1.36
|
|
10
|
+
- **OS**: macOS (darwin)
|
|
11
|
+
- **Node version**: (run `node --version` to fill in)
|
|
12
|
+
|
|
13
|
+
## MCP Servers Affected
|
|
14
|
+
|
|
15
|
+
- `context7` (https://mcp.context7.com/mcp)
|
|
16
|
+
- `gh_grep` (https://mcp.grep.app)
|
|
17
|
+
|
|
18
|
+
## Description
|
|
19
|
+
|
|
20
|
+
MCP tool calls from the AI agent fail with a TypeError, even though the MCP servers connect successfully and respond with HTTP 200 OK.
|
|
21
|
+
|
|
22
|
+
## Steps to Reproduce
|
|
23
|
+
|
|
24
|
+
1. Configure MCP servers in `opencode.json`:
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"mcp": {
|
|
29
|
+
"context7": {
|
|
30
|
+
"type": "remote",
|
|
31
|
+
"url": "https://mcp.context7.com/mcp",
|
|
32
|
+
"headers": {
|
|
33
|
+
"CONTEXT7_API_KEY": "{env:CONTEXT7_API_KEY}"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"gh_grep": {
|
|
37
|
+
"type": "remote",
|
|
38
|
+
"url": "https://mcp.grep.app"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
2. Set the `CONTEXT7_API_KEY` environment variable
|
|
45
|
+
|
|
46
|
+
3. Verify MCP servers are connected:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
$ opencode mcp list
|
|
50
|
+
✓ context7 connected - https://mcp.context7.com/mcp
|
|
51
|
+
✓ gh_grep connected - https://mcp.grep.app
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
4. Debug shows successful connection:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
$ opencode mcp debug context7
|
|
58
|
+
HTTP response: 200 OK
|
|
59
|
+
Server info: name=Context7, version=2.0.2
|
|
60
|
+
|
|
61
|
+
$ opencode mcp debug gh_grep
|
|
62
|
+
HTTP response: 200 OK
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
5. Use the AI agent to call a tool:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
context7_resolve-library-id(query="React hooks", libraryName="react")
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Expected Behavior
|
|
72
|
+
|
|
73
|
+
The tool should return library information from Context7.
|
|
74
|
+
|
|
75
|
+
## Actual Behavior
|
|
76
|
+
|
|
77
|
+
```
|
|
78
|
+
TypeError: undefined is not an object (evaluating 'output.output.includes')
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
## Analysis
|
|
82
|
+
|
|
83
|
+
The error `output.output.includes` suggests there's code in OpenCode that does something like:
|
|
84
|
+
|
|
85
|
+
```javascript
|
|
86
|
+
if (output.output.includes(...)) { ... }
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
When `output` is undefined or doesn't have an `output` property, this crashes.
|
|
90
|
+
|
|
91
|
+
The bug is in **OpenCode's tool response handler**, not the MCP connection layer, because:
|
|
92
|
+
|
|
93
|
+
1. `opencode mcp list` shows both servers as "connected"
|
|
94
|
+
2. `opencode mcp debug` shows HTTP 200 OK responses
|
|
95
|
+
3. The error happens only when the AI agent calls the tool
|
|
96
|
+
|
|
97
|
+
## Workaround
|
|
98
|
+
|
|
99
|
+
Use alternative tools that don't go through MCP:
|
|
100
|
+
|
|
101
|
+
- `codesearch` (Exa Code API) - works
|
|
102
|
+
- `websearch` (Exa Web Search) - works
|
|
103
|
+
|
|
104
|
+
## Related Issues
|
|
105
|
+
|
|
106
|
+
- #6972 - May be related to Accept header issues
|
|
107
|
+
- #834 - SSE transport issues
|
|
108
|
+
|
|
109
|
+
## Additional Context
|
|
110
|
+
|
|
111
|
+
Log entries show benign errors that don't cause the crash:
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
ERROR service=mcp clientName=context7 error=MCP error -32601: Method not found failed to get prompts
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
This is expected (prompts method not implemented), but the TypeError happens later in the response processing pipeline.
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## How to File
|
|
122
|
+
|
|
123
|
+
1. Go to: https://github.com/anomalyco/opencode/issues/new
|
|
124
|
+
2. Title: `MCP tool calls fail with TypeError: output.output.includes despite successful connection`
|
|
125
|
+
3. Copy the content above
|
|
126
|
+
4. Add labels: `bug`, `mcp`
|