Conversation
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.
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.
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`.
…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.
Code Review SummaryStatus: 5 Issues Found | Recommendation: Address before merge Overview
Fix these issues in Kilo Cloud Issue Details (click to expand)WARNING
Other Observations (not in diff)Issues found in unchanged code that cannot receive inline comments:
Resolved since previous review:
Files Reviewed (5 files)
Reviewed by gpt-5.4-20260305 · 3,615,017 tokens |
| if (env.KILOCODE_API_BASE_URL) { | ||
| env.KILO_API_URL = new URL(env.KILOCODE_API_BASE_URL).origin; | ||
| } |
There was a problem hiding this comment.
This replaces the providers.kilo.options.baseURL setting in the opencode.json config, which doesn't work as expected.
| config.provider = config.provider || {}; | ||
| config.provider.kilo = config.provider.kilo || {}; | ||
| config.provider.kilo.options = config.provider.kilo.options || {}; | ||
| delete config.provider.kilo.options.baseURL; |
There was a problem hiding this comment.
As far as I could test baseURL just never works as you want it to because either the models-fetch or the chat-completion fails because it uses the wrong path.
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.
# Conflicts: # kiloclaw/controller/src/config-writer.ts # packages/trpc/dist/index.d.ts
| .input(z.object({ runId: z.string().uuid() })) | ||
| .mutation(async ({ ctx, input }) => { | ||
| const client = new KiloClawInternalClient(); | ||
| const result = await client.cancelKiloCliRun(ctx.user.id); |
There was a problem hiding this comment.
WARNING: runId still is not sent to the controller cancel API
cancelKiloCliRun only narrows the database update. The controller request here still cancels the user's current run regardless of input.runId, so canceling an older row after a newer recovery starts can terminate the newer job and leave the wrong row marked as cancelled.
Summary
kilo run --autoon a KiloClaw instance from the dashboard as a recovery tool for stuck/failing instances, with real-time output polling and DB persistenceVerification
pnpm typecheck— passes (all packages)pnpm format:check— passespnpm lint— passes (0 warnings, 0 errors)kilo-cli-run.test.ts)Visual Changes
hooks-enabled-recovery.mp4
Reviewer Notes
kiloclaw_cli_runstable with FK tokilocode_usersand indexes onuser_idandstarted_at.kilo-cli-config.tsgives the agent context about the OpenClaw environment.@tanstack/react-querywith a 2s refetch interval while the run is active.