-
Notifications
You must be signed in to change notification settings - Fork 0
159 lines (152 loc) · 7.45 KB
/
Copy pathopencode.yml
File metadata and controls
159 lines (152 loc) · 7.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
name: opencode
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
jobs:
opencode:
if: |
github.actor != 'opencode-agent[bot]' &&
(
contains(github.event.comment.body, ' /oc') ||
startsWith(github.event.comment.body, '/oc') ||
contains(github.event.comment.body, ' /opencode') ||
startsWith(github.event.comment.body, '/opencode')
)
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
pull-requests: write
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 1
persist-credentials: false
- name: Write OpenCode auth.json
shell: bash
run: |
mkdir -p ~/.local/share/opencode
echo "${{ secrets.OPENCODE_AUTH_JSON_B64 }}" | base64 -d > ~/.local/share/opencode/auth.json
chmod 600 ~/.local/share/opencode/auth.json
- name: Clone and start local proxy
shell: bash
run: |
git clone --depth 1 https://github.com/dhruvkej9/opencode-local-proxy.git /tmp/opencode-local-proxy
cd /tmp/opencode-local-proxy
export OPENCODE_PROXY_PORT=4318
node proxy.mjs &
sleep 3
curl -s http://127.0.0.1:4318/health
- name: Setup Bun
uses: oven-sh/setup-bun@v2
- name: Configure OpenCode variant
shell: bash
run: |
mkdir -p ~/.config/opencode
cat > ~/.config/opencode/opencode.json <<'JSON'
{
"$schema": "https://opencode.ai/config.json",
"model": "local-proxy/kimi-k2.5-free",
"agent": {
"build": {
"model": "local-proxy/kimi-k2.5-free",
"variant": "high",
"prompt": "Use ripgrep (rg) instead of grep/glob/find for searching. Commands: rg 'pattern' (search content), rg --files (list all files), rg --files -g '*.ext' (filter by extension), rg --files -g '*.{js,py,md}' (multiple extensions), rg 'pattern' -g '*.ext' (search in specific file types), rg -i 'pattern' (case insensitive), rg -C 3 'pattern' (show 3 lines context). ripgrep is faster and respects .gitignore by default. Use context7 for latest package info.\n\nUse websearch when local context is insufficient. At least one websearch is recommended for each task before finalizing.\n\nYou are an AI agent with persistent memory powered by SuperMemory MCP (mcp.supermemory.ai).\n\nMemory rules:\n- Before responding, call supermemory_recall only when the request benefits from past context (preferences, prior decisions, project history, recurring issues).\n- Skip recall for direct mechanical actions that already contain full context (e.g., explicit save/forget memory commands, simple one-shot confirmations).\n- Prioritize the most recent and most relevant memories; if nothing useful is found, continue normally.\n- Store memory with supermemory_memory only when there is durable value.\n- Save only durable learnings, reusable patterns, and solved-issue knowledge (root cause + fix).\n- Do not save task logs, todos, progress updates, generic work-completed notes, or low-value status noise.\n- Update incrementally; avoid overwriting prior memory unless explicitly instructed.\n\nWorkflow:\n1) Recall relevant context when useful.\n2) Reason using recalled context plus current input.\n3) Save durable insights if any.\n4) Respond concisely and personalize using recalled memory when relevant.\n\nFallback:\n- If supermemory tools fail, continue and include a concise memory-candidate summary for later storage.\n\nUse MCP tools intentionally:\n- Use chrome-devtools MCP for browser debugging, performance bottlenecks, network waterfall, runtime errors, DOM/CSS inspection, and rendering issues.\n- For frontend or integration fixes, validate behavior and include what you verified in your response."
}
},
"watcher": {
"ignore": [
"node_modules/**",
"dist/**",
".git/**"
]
},
"mcp": {
"supermemory": {
"type": "remote",
"url": "https://mcp.supermemory.ai/mcp",
"headers": {
"Authorization": "Bearer ${{ secrets.SUPERMEMORY_API_KEY }}"
},
"enabled": true
},
"chrome-devtools": {
"type": "local",
"command": [
"npx",
"-y",
"chrome-devtools-mcp@latest",
"--headless",
"--isolated",
"--chromeArg=--no-sandbox",
"--chromeArg=--disable-dev-shm-usage",
"--logFile=/tmp/chrome-devtools-mcp.log"
],
"enabled": true
}
},
"lsp": false,
"permission": {
"external_directory": "allow",
"question": "allow",
"*": "allow"
},
"provider": {
"local-proxy": {
"npm": "@ai-sdk/openai-compatible",
"name": "Local Proxy (Free Models + Codex Fallback)",
"options": {
"baseURL": "http://127.0.0.1:4318/v1",
"apiKey": "public"
},
"models": {
"kimi-k2.5-free": {
"name": "Kimi K2.5 Free",
"limit": { "context": 262000, "output": 32768 },
"modalities": { "input": ["text", "image"], "output": ["text"] }
},
"big-pickle": {
"name": "Big-Pickle",
"limit": { "context": 200000, "output": 64000 },
"modalities": { "input": ["text", "image"], "output": ["text"] }
},
"minimax-m2.5-free": {
"name": "MiniMax M2.5 Free",
"limit": { "context": 204800, "output": 128000 },
"modalities": { "input": ["text", "image"], "output": ["text"] }
},
"glm-5-free": {
"name": "GLM-5 Free",
"limit": { "context": 200000, "output": 128000 },
"modalities": { "input": ["text", "image"], "output": ["text"] }
},
"trinity-large-preview-free": {
"name": "Trinity Large Preview Free",
"limit": { "context": 128000, "output": 128000 },
"modalities": { "input": ["text", "image"], "output": ["text"] }
},
"gpt-5.3-codex": {
"name": "GPT-5.3 Codex (Fallback)",
"limit": { "context": 272000, "output": 128000 },
"modalities": { "input": ["text", "image"], "output": ["text"] }
},
"gpt-5-nano": {
"name": "GPT-5 Nano",
"limit": { "context": 400000, "output": 128000 },
"modalities": { "input": ["text", "image"], "output": ["text"] }
}
}
}
}
}
JSON
- name: Run OpenCode
uses: anomalyco/opencode/github@latest
env:
OPENCODE_PERMISSION: '{"*": "allow"}'
with:
model: local-proxy/kimi-k2.5-free