Commit b447254
authored
feat(kiloclaw): add Kilo CLI recovery agent (#1657)
* feat(kiloclaw): add kilo CLI run feature (spawn, poll, UI)
Add the ability to run `kilo run --auto` on a KiloClaw instance from the
dashboard, with real-time output polling and DB persistence.
Stack: controller spawn route -> CF Worker DO proxy -> platform routes ->
tRPC procedures -> React polling page. Includes admin visibility,
changelog entry, and 12 controller route tests.
* Fix dev-CLI
* refactor(kiloclaw): use DB run ID in CLI run URL instead of prompt query param
* Remove debug info
* feat(kiloclaw): add admin CLI Runs tab with search and pagination
* feat(kiloclaw): use KiloClaw default model for Kilo CLI runs
Sync the Kilo CLI's model config with the user's selected KiloClaw
default model (KILOCODE_DEFAULT_MODEL). Previously the CLI ignored this
env var and fell back to kilo-auto/small. Now the model is written to
opencode.json on both fresh installs and every boot, converting the
kilocode/ provider prefix to kilo/ for the CLI's naming convention.
* feat(kiloclaw): add system context prompt template for Kilo CLI runs
Wrap the user's prompt with system context (key paths, architecture,
diagnostic commands, and fix instructions) so the agent knows where
to look and how to repair broken OpenClaw instances. The original
user prompt is still stored for UI display; only the expanded prompt
is passed to `kilo run --auto`.
* refactor(kiloclaw): use shared constants in prompt template, improve CLI run UI
Export path constants from config-writer and kilo-cli-config so the
prompt template references them instead of duplicating string literals.
Add openclaw doctor to diagnostics. Improve the CLI run detail page
with SetPageTitle, remove max-height on output, and clean up layout.
* refactor(kiloclaw): rebrand CLI run as recovery tool
* fix(kiloclaw): wrap long output lines and auto-scroll on all updates
* chore: remove migration 0060 before rebase
* chore(db): regenerate migration 0060 for kiloclaw_cli_runs after rebase
* chore: fix migration numbering, type errors, and formatting after rebase
* docs(kiloclaw): update changelog entry to match recovery branding
* fix(kiloclaw): set baseURL in kilo CLI config instead of deleting it
* fix(kiloclaw): scope CLI run status to requested run ID and add GDPR cleanup
* fix(kiloclaw): revert baseURL config patch — delete stale field instead of setting it
* perf(kiloclaw): lazy-load CLI run output instead of fetching with list
Exclude the output column from listAllCliRuns to avoid sending up to
~25MB per page. Add a dedicated getCliRunOutput procedure that fetches
output for a single run on demand when selected in the admin panel.
* fix(kiloclaw): scope cancelKiloCliRun DB update to specific run ID
* chore(db): remove migration 0061 before merge with main
* chore(db): regenerate migration 0064 after merge with main
* fix(kilo-app): fix unsafe type access in useForceUpdate hook
* Undo unwanted change1 parent 4031cac commit b447254
File tree
29 files changed
+16600
-47
lines changed- kiloclaw
- controller/src
- routes
- src
- durable-objects
- kiloclaw-instance
- routes
- packages/db/src
- migrations
- meta
- src
- app
- (app)/claw
- components
- kilo-cli-run/[id]
- admin/components
- KiloclawCliRuns
- hooks
- lib
- kiloclaw
- routers
29 files changed
+16600
-47
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
282 | 302 | | |
283 | 303 | | |
284 | 304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
191 | 196 | | |
192 | 197 | | |
193 | 198 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
370 | 370 | | |
371 | 371 | | |
372 | 372 | | |
373 | | - | |
| 373 | + | |
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
362 | 363 | | |
363 | 364 | | |
364 | 365 | | |
| 366 | + | |
365 | 367 | | |
366 | 368 | | |
367 | 369 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
37 | 51 | | |
38 | 52 | | |
39 | 53 | | |
| |||
72 | 86 | | |
73 | 87 | | |
74 | 88 | | |
75 | | - | |
| 89 | + | |
76 | 90 | | |
77 | 91 | | |
78 | 92 | | |
79 | 93 | | |
80 | 94 | | |
81 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
82 | 108 | | |
83 | 109 | | |
84 | 110 | | |
| |||
99 | 125 | | |
100 | 126 | | |
101 | 127 | | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
108 | 132 | | |
| 133 | + | |
| 134 | + | |
109 | 135 | | |
110 | 136 | | |
111 | 137 | | |
112 | 138 | | |
113 | 139 | | |
114 | | - | |
| 140 | + | |
115 | 141 | | |
116 | 142 | | |
117 | | - | |
| 143 | + | |
118 | 144 | | |
119 | 145 | | |
120 | 146 | | |
121 | 147 | | |
122 | 148 | | |
123 | | - | |
124 | 149 | | |
125 | 150 | | |
126 | 151 | | |
127 | 152 | | |
128 | 153 | | |
129 | 154 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
| 155 | + | |
134 | 156 | | |
135 | 157 | | |
136 | | - | |
137 | | - | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
138 | 163 | | |
139 | 164 | | |
140 | 165 | | |
141 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
142 | 181 | | |
| 182 | + | |
| 183 | + | |
143 | 184 | | |
144 | 185 | | |
145 | 186 | | |
| 187 | + | |
146 | 188 | | |
147 | | - | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
148 | 192 | | |
149 | 193 | | |
150 | | - | |
| 194 | + | |
151 | 195 | | |
152 | 196 | | |
153 | 197 | | |
154 | 198 | | |
155 | 199 | | |
156 | 200 | | |
157 | | - | |
| 201 | + | |
158 | 202 | | |
159 | 203 | | |
160 | 204 | | |
161 | 205 | | |
162 | 206 | | |
163 | | - | |
164 | | - | |
165 | | - | |
166 | | - | |
| 207 | + | |
167 | 208 | | |
168 | 209 | | |
169 | 210 | | |
| |||
177 | 218 | | |
178 | 219 | | |
179 | 220 | | |
180 | | - | |
| 221 | + | |
181 | 222 | | |
182 | 223 | | |
183 | 224 | | |
| |||
197 | 238 | | |
198 | 239 | | |
199 | 240 | | |
200 | | - | |
| 241 | + | |
201 | 242 | | |
202 | 243 | | |
203 | 244 | | |
204 | 245 | | |
205 | 246 | | |
206 | | - | |
| 247 | + | |
| 248 | + | |
207 | 249 | | |
208 | | - | |
| 250 | + | |
209 | 251 | | |
210 | | - | |
| 252 | + | |
211 | 253 | | |
212 | 254 | | |
213 | 255 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
20 | 28 | | |
21 | 29 | | |
22 | 30 | | |
| |||
49 | 57 | | |
50 | 58 | | |
51 | 59 | | |
52 | | - | |
| 60 | + | |
53 | 61 | | |
54 | 62 | | |
55 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
56 | 67 | | |
57 | 68 | | |
58 | 69 | | |
59 | 70 | | |
60 | 71 | | |
61 | 72 | | |
62 | | - | |
63 | | - | |
| 73 | + | |
64 | 74 | | |
65 | 75 | | |
66 | | - | |
| 76 | + | |
67 | 77 | | |
68 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
69 | 90 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | | - | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
77 | 98 | | |
78 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
79 | 102 | | |
80 | 103 | | |
81 | 104 | | |
| |||
0 commit comments