From 6a7a0ee47cfe4e83d22fba8d5b93734e741233f6 Mon Sep 17 00:00:00 2001 From: "kiloconnect[bot]" <240665456+kiloconnect[bot]@users.noreply.github.com> Date: Sat, 11 Apr 2026 17:26:47 +0000 Subject: [PATCH 1/5] fix(cli): guard ErrorComponent against missing renderer context The ErrorBoundary fallback (ErrorComponent) called useRenderer() and useTerminalDimensions() which throw "No renderer found" when the OpenTUI renderer context is unavailable. This causes the CLI to crash on startup instead of showing the error UI. Wrap these hooks in try/catch helpers (tryUseRenderer, tryUseTerminalDimensions) that return undefined when the context is missing, and fall back to process.stdout dimensions. Also guard useKeyboard the same way. Closes #8774 --- packages/opencode/src/cli/cmd/tui/app.tsx | 47 ++++++++++++++++++----- 1 file changed, 37 insertions(+), 10 deletions(-) diff --git a/packages/opencode/src/cli/cmd/tui/app.tsx b/packages/opencode/src/cli/cmd/tui/app.tsx index 20209db9c1d..9c8482cf55a 100644 --- a/packages/opencode/src/cli/cmd/tui/app.tsx +++ b/packages/opencode/src/cli/cmd/tui/app.tsx @@ -914,27 +914,54 @@ function App(props: { onSnapshot?: () => Promise }) { ) } +// kilocode_change start — guard against missing renderer context in ErrorBoundary fallback +function tryUseRenderer() { + try { + return useRenderer() + } catch { + return undefined + } +} + +function tryUseTerminalDimensions() { + try { + return useTerminalDimensions() + } catch { + return undefined + } +} +// kilocode_change end + function ErrorComponent(props: { error: Error reset: () => void onExit: () => Promise mode?: "dark" | "light" }) { - const term = useTerminalDimensions() - const renderer = useRenderer() + // kilocode_change start — use safe accessors so ErrorComponent renders even without renderer context + const term = tryUseTerminalDimensions() + const renderer = tryUseRenderer() + + const height = () => term?.().height ?? process.stdout.rows ?? 24 const handleExit = async () => { - renderer.setTerminalTitle("") - renderer.destroy() + renderer?.setTerminalTitle("") + renderer?.destroy() win32FlushInputBuffer() await props.onExit() } - useKeyboard((evt) => { - if (evt.ctrl && evt.name === "c") { - handleExit() - } - }) + try { + useKeyboard((evt) => { + if (evt.ctrl && evt.name === "c") { + handleExit() + } + }) + } catch { + // Keyboard handler unavailable — renderer context may be missing. + // Ctrl+C will still work via the default signal handler. + } + // kilocode_change end const [copied, setCopied] = createSignal(false) const issueURL = new URL("https://github.com/Kilo-Org/kilocode/issues/new?template=bug-report.yml") @@ -989,7 +1016,7 @@ function ErrorComponent(props: { Exit - + {props.error.stack} {props.error.message} From f2cb0d7055c5135df7067789b12386feb47a12a5 Mon Sep 17 00:00:00 2001 From: Alex Alecu Date: Tue, 14 Apr 2026 17:02:11 +0300 Subject: [PATCH 2/5] fix(cli): add kilocode_change markers and regenerate source-links --- packages/kilo-docs/source-links.md | 4 +++- packages/opencode/src/cli/cmd/tui/app.tsx | 14 ++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/packages/kilo-docs/source-links.md b/packages/kilo-docs/source-links.md index ab260f2cfa9..ea898533346 100644 --- a/packages/kilo-docs/source-links.md +++ b/packages/kilo-docs/source-links.md @@ -1,7 +1,7 @@ # Source Code Links - + - @@ -55,6 +55,8 @@ - +- + - - diff --git a/packages/opencode/src/cli/cmd/tui/app.tsx b/packages/opencode/src/cli/cmd/tui/app.tsx index a1e03875a0b..9ea5009463d 100644 --- a/packages/opencode/src/cli/cmd/tui/app.tsx +++ b/packages/opencode/src/cli/cmd/tui/app.tsx @@ -1,7 +1,7 @@ import { render, TimeToFirstDraw, useKeyboard, useRenderer, useTerminalDimensions } from "@opentui/solid" import { Clipboard } from "@tui/util/clipboard" import { Selection } from "@tui/util/selection" -import { createCliRenderer, MouseButton, TextAttributes, type CliRendererConfig } from "@opentui/core" +import { createCliRenderer, MouseButton, TextAttributes, type CliRendererConfig } from "@opentui/core" // kilocode_change import { RouteProvider, useRoute } from "@tui/context/route" import { Switch, @@ -16,12 +16,12 @@ import { on, onCleanup, } from "solid-js" -import { win32DisableProcessedInput, win32FlushInputBuffer, win32InstallCtrlCGuard } from "./win32" +import { win32DisableProcessedInput, win32FlushInputBuffer, win32InstallCtrlCGuard } from "./win32" // kilocode_change import { Flag } from "@/flag/flag" import semver from "semver" import { DialogProvider, useDialog } from "@tui/ui/dialog" import { DialogProvider as DialogProviderList } from "@tui/component/dialog-provider" -import { Installation } from "@/installation" +import { Installation } from "@/installation" // kilocode_change import { PluginRouteMissing } from "@tui/component/plugin-route-missing" import { SDKProvider, useSDK } from "@tui/context/sdk" import { StartupLoading } from "@tui/component/startup-loading" @@ -202,6 +202,7 @@ export function tui(input: { await render(() => { return ( } > @@ -966,7 +967,7 @@ function App(props: { onSnapshot?: () => Promise }) { ) -} +} // kilocode_change // kilocode_change start — guard against missing renderer context in ErrorBoundary fallback function tryUseRenderer() { @@ -986,13 +987,13 @@ function tryUseTerminalDimensions() { } // kilocode_change end +// kilocode_change start — inlined ErrorComponent with safe renderer/keyboard guards function ErrorComponent(props: { error: Error reset: () => void onExit: () => Promise mode?: "dark" | "light" }) { - // kilocode_change start — use safe accessors so ErrorComponent renders even without renderer context const term = tryUseTerminalDimensions() const renderer = tryUseRenderer() @@ -1015,7 +1016,7 @@ function ErrorComponent(props: { // Keyboard handler unavailable — renderer context may be missing. // Ctrl+C will still work via the default signal handler. } - // kilocode_change end + const [copied, setCopied] = createSignal(false) const issueURL = new URL("https://github.com/Kilo-Org/kilocode/issues/new?template=bug-report.yml") @@ -1077,3 +1078,4 @@ function ErrorComponent(props: { ) } +// kilocode_change end From 20c8f3e5bead9da024cad34b4cfc748ba6340ba4 Mon Sep 17 00:00:00 2001 From: Alex Gold Date: Tue, 14 Apr 2026 10:04:52 -0400 Subject: [PATCH 3/5] docs(kilo-docs): recommend dedicated Google account and remove suggested-configuration page - Update google.md and end-to-end.md to recommend dedicated/Workspace bot accounts - Remove suggested-configuration.md (duplicate of end-to-end.md) - Add redirect from /docs/kiloclaw/suggested-configuration to /docs/kiloclaw/end-to-end --- .../kiloclaw/development-tools/google.md | 6 +- .../kilo-docs/pages/kiloclaw/end-to-end.md | 4 + .../pages/kiloclaw/suggested-configuration.md | 171 ------------------ packages/kilo-docs/previous-docs-redirects.js | 10 + 4 files changed, 18 insertions(+), 173 deletions(-) delete mode 100644 packages/kilo-docs/pages/kiloclaw/suggested-configuration.md diff --git a/packages/kilo-docs/pages/kiloclaw/development-tools/google.md b/packages/kilo-docs/pages/kiloclaw/development-tools/google.md index 3a7cdce83ac..6a417fa9c76 100644 --- a/packages/kilo-docs/pages/kiloclaw/development-tools/google.md +++ b/packages/kilo-docs/pages/kiloclaw/development-tools/google.md @@ -7,8 +7,10 @@ description: "Connect a dedicated Google account to KiloClaw for access to Gmail Connect a dedicated Google account to KiloClaw so it can interact with Google Workspace services — Gmail, Calendar, Drive, Docs, Sheets, Slides, Tasks, People, Forms, Chat, Classroom, and Apps Script. -{% callout type="warning" title="Use a standalone Google account" %} -We strongly recommend creating a **dedicated Google account** specifically for KiloClaw rather than connecting your personal Google account. This keeps your personal data separate and gives you full control over what KiloClaw can access. Throughout this guide, "the KiloClaw Google account" refers to this dedicated account. +{% callout type="warning" title="Use a dedicated Google account" %} +We recommend creating a **dedicated Google account** for KiloClaw. This keeps your personal data separate and gives you full control over what KiloClaw can access. + +If you are using Google Workspace, we recommend creating the bot account inside the Google Workspace. {% /callout %} ## What You Get diff --git a/packages/kilo-docs/pages/kiloclaw/end-to-end.md b/packages/kilo-docs/pages/kiloclaw/end-to-end.md index 5aa0e1913d8..7277445346c 100644 --- a/packages/kilo-docs/pages/kiloclaw/end-to-end.md +++ b/packages/kilo-docs/pages/kiloclaw/end-to-end.md @@ -46,6 +46,10 @@ Before configuring, take these preflight steps: 1. **Create a Google Account for your Claw** — Go to [google.com](https://www.google.com/) and create a new Google/Gmail account dedicated to your KiloClaw. Something like `yourname.bot@gmail.com` works well. +{% callout type="tip" title="Google Workspace users" %} +If your organization uses Google Workspace, consider creating the dedicated bot account inside your Workspace domain (e.g., `claw@yourcompany.com`) rather than as a standalone `@gmail.com` account. A Workspace-managed account benefits from your organization's admin policies, makes calendar sharing and internal collaboration seamless, and avoids external-sharing friction that free Gmail accounts can encounter. +{% /callout %} + 2. **Set up Google Cloud** — Visit [console.cloud.google.com](https://console.cloud.google.com). Accept the terms of service and click "Start my free tier". You may need to add a credit card for identity verification. {% callout type="info" %} diff --git a/packages/kilo-docs/pages/kiloclaw/suggested-configuration.md b/packages/kilo-docs/pages/kiloclaw/suggested-configuration.md deleted file mode 100644 index fa32037e7aa..00000000000 --- a/packages/kilo-docs/pages/kiloclaw/suggested-configuration.md +++ /dev/null @@ -1,171 +0,0 @@ ---- -title: "Setup walkthrough" -description: "Start-to-finish guide for configuring your KiloClaw instance" ---- - -# Setup walkthrough - -This guide walks you through a full KiloClaw setup — from creating accounts to scheduling your first automated workflow. Plan for about 60 minutes. - ---- - -## Planning your setup - -For most users, a useful KiloClaw configuration involves: - -1. A **chat platform** (called a "channel" in OpenClaw) so you can message your Claw -2. **Google services** for email, calendar, and Drive -3. **GitHub** for code and markdown syncing - -### Use dedicated accounts for your Claw - -We recommend creating **separate accounts** for your KiloClaw rather than connecting it to your personal accounts. This applies to Google, GitHub, and any other services you connect. A dedicated account improves isolation — your personal data stays separate, and you can control exactly what access the Claw has by sharing or delegating only what you want. - -### Chat platform options - -- **[Kilo Chat](https://app.kilo.ai)** — available in the web app and coming soon to iOS and Android; requires zero configuration -- **[Telegram](/docs/kiloclaw/chat-platforms/telegram)** — easy to set up, private by default -- **[Discord](/docs/kiloclaw/chat-platforms/discord)** — moderate setup -- **[Slack](/docs/kiloclaw/chat-platforms/slack)** — most involved setup - -{% callout type="warning" title="Chain-of-connection security" %} -If your Claw has access to sensitive data (like your email), be careful which chat platform you connect it to. On broadly-accessible platforms like Slack or Discord, anyone on the server could potentially message your Claw and access that data. If you're connecting sensitive integrations, use a private platform like Kilo Chat or Telegram. -{% /callout %} - -The steps below walk you through this configuration. - ---- - -## Preflight Steps - -Take these steps before configuring your Claw. - -If you are doing a [1-1 configuration call with Kilo](https://kilo.ai/kiloclaw/config-service), please complete these steps before the call. - -### Google - -Configuring Google services is by far the most involved part of setting up your Claw. - -Before configuring, take these preflight steps: - -1. **Create a Google Account for your Claw** — Go to [google.com](https://www.google.com/) and create a new Google/Gmail account dedicated to your KiloClaw. Something like `yourname.bot@gmail.com` works well. - -2. **Set up Google Cloud** — Visit [console.cloud.google.com](https://console.cloud.google.com). Accept the terms of service and click "Start my free tier". You may need to add a credit card for identity verification. - - {% callout type="info" %} - Nothing KiloClaw does costs any money with Google. - {% /callout %} - -3. **Install Docker** — KiloClaw configures Google by running a Docker container on your machine. Download Docker at [docker.com](https://www.docker.com/), then open it. You don't need to sign in or create a Docker account. - -## Other Services - -1. **Create a GitHub account for your Claw** — Using your new Gmail address, create a matching GitHub account for your Claw. - ---- - -## Set up a messaging platform - -Your Claw needs a way to communicate with you. **[Kilo Chat](https://app.kilo.ai)** requires no setup — just open the web app. For other platforms, follow the relevant guide: - -- [Telegram](/docs/kiloclaw/chat-platforms/telegram) — about 2 minutes -- [Discord](/docs/kiloclaw/chat-platforms/discord) — about 10 minutes -- [Slack](/docs/kiloclaw/chat-platforms/slack) — about 15 minutes; always use the manifest - -{% callout type="tip" %} -If you're not sure which to pick, Kilo Chat (no setup) or Telegram (2 minutes) are the easiest options. -{% /callout %} - ---- - -## Set up Google OAuth - -This lets your Claw act as the bot Google account — sending email, reading calendar, and more. Takes about 15 minutes. - -Prerequisites: Docker is installed and running, and your bot Google account is already created. - -1. In the KiloClaw dashboard, go to **Settings → Google Account** and copy the Docker command shown. -2. Open a terminal and run the command. -3. Follow the steps in the console: - - At each step, confirm you're logged in to the bot account (check the top-right corner of the screen). - - After project creation, confirm you're in the correct project. - - The last step may look like it failed — this is expected. - -For full details, see the [Google setup guide](/docs/kiloclaw/development-tools/google). - ---- - -## Set up GitHub - -A dedicated bot GitHub account is strongly recommended. Takes about 7 minutes. - -**Create a Personal Access Token (PAT):** - -1. In GitHub, go to **Settings → Developer Settings → Personal Access Tokens → Classic → Generate new token**. -2. Select these scopes: `repo`, `workflow`, `write:org`, `read:user`. - -For full details, see the [GitHub setup guide](/docs/kiloclaw/development-tools/github). - -**Set up a private workspace repo:** - -Once GitHub is connected, ask your Claw to back up its workspace: - -``` -Use your GitHub access to back up your workspace. Make it a GitHub repo and push it as a private repo. Add me as a member so I can see it. Then set up a cron job to pull, rebase, and push any changes at least once an hour. -``` - -After sending that, redeploy from the dashboard to pick up the changes. - ---- - -## Grant email and calendar access - -After OAuth is set up, decide how much access to give your Claw to your personal accounts. - -| Option | What it does | Best for | Configured from | -| ----------------------- | --------------------------------------------------------------------- | ------------------------------------------ | ------------------------------------------------------- | -| Forward select emails | A Gmail filter forwards specific senders or labels to the bot account | Targeted use cases like newsletter digests | Your personal account | -| Forward all email | Forwards your full inbox to the bot | Simpler setups where noise is acceptable | Bot account (destination) | -| Full account delegation | Gives the bot direct read/write access to your personal account | Maximum capability | Your personal account — Gmail Settings → Add a delegate | - -{% callout type="info" %} -Email forwarding is configured from the **destination** (bot) account. Account delegation is configured from the **source** (personal) account. -{% /callout %} - -**Push notifications:** by default, your Claw wakes up on every incoming email. If you'd prefer a digest (e.g., once at 7am), disable push notifications in **Settings → Google Account** on the [dashboard](/docs/kiloclaw/dashboard) — otherwise it processes each email as it arrives. - -**Google Calendar:** share your personal calendar from your personal Google account. Go to **Google Calendar → Settings → Settings for my calendars → [your calendar] → Share with specific people**, and add the bot account. - ---- - -## Enable auto-approval - -By default, KiloClaw asks for confirmation before every tool call. To let it act freely, go to the [KiloClaw dashboard](https://app.kilo.ai/claw) and enable auto-approval in the **Default Permissions** section. - ---- - -## Prompt and schedule work - -**How to prompt your Claw:** just tell it in plain language what you want. Be specific. If you want it to remember something across sessions, tell it to write it down in a specific file. - -**Scheduling jobs:** tell your Claw when and what to do — for example: - -``` -Every day at 7am, summarize my emails and send me a digest. -``` - -Mentioning "cron job" helps it understand you want a recurring scheduled task. - -**Skills:** the OpenClaw Skills hub has pre-built capabilities you can add. The easiest way to install a skill is to just ask your Claw by name: - -``` -Install the [skill name] skill. -``` - ---- - -## Manage inference - -**Model picker:** Balanced is a good starting point. Frontier is more capable but significantly more expensive. - -You can also use your KiloPass credits — find this under **Profile** in the dashboard. diff --git a/packages/kilo-docs/previous-docs-redirects.js b/packages/kilo-docs/previous-docs-redirects.js index f20702d05fb..24c86982e35 100644 --- a/packages/kilo-docs/previous-docs-redirects.js +++ b/packages/kilo-docs/previous-docs-redirects.js @@ -825,4 +825,14 @@ module.exports = [ basePath: false, permanent: true, }, + + // ============================================ + // KILOCLAW + // ============================================ + { + source: "/docs/kiloclaw/suggested-configuration", + destination: "/docs/kiloclaw/end-to-end", + basePath: false, + permanent: true, + }, ] From e0489f2f4bb55ff3ab906b0f692a6737589290fe Mon Sep 17 00:00:00 2001 From: Alex Gold Date: Tue, 14 Apr 2026 10:07:03 -0400 Subject: [PATCH 4/5] Apply suggestion from @alexkgold --- packages/kilo-docs/pages/kiloclaw/end-to-end.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/kilo-docs/pages/kiloclaw/end-to-end.md b/packages/kilo-docs/pages/kiloclaw/end-to-end.md index 7277445346c..eacbdc7b310 100644 --- a/packages/kilo-docs/pages/kiloclaw/end-to-end.md +++ b/packages/kilo-docs/pages/kiloclaw/end-to-end.md @@ -47,7 +47,9 @@ Before configuring, take these preflight steps: 1. **Create a Google Account for your Claw** — Go to [google.com](https://www.google.com/) and create a new Google/Gmail account dedicated to your KiloClaw. Something like `yourname.bot@gmail.com` works well. {% callout type="tip" title="Google Workspace users" %} -If your organization uses Google Workspace, consider creating the dedicated bot account inside your Workspace domain (e.g., `claw@yourcompany.com`) rather than as a standalone `@gmail.com` account. A Workspace-managed account benefits from your organization's admin policies, makes calendar sharing and internal collaboration seamless, and avoids external-sharing friction that free Gmail accounts can encounter. +If your organization uses Google Workspace, create the dedicated bot account inside your Workspace domain (e.g., `claw@yourcompany.com`) rather than as a standalone `@gmail.com` account. + +A Workspace-managed account benefits from your organization's admin policies, making configuration easier. {% /callout %} 2. **Set up Google Cloud** — Visit [console.cloud.google.com](https://console.cloud.google.com). Accept the terms of service and click "Start my free tier". You may need to add a credit card for identity verification. From a828e1a1ee2fcba2175f3a08bb89a25af2142193 Mon Sep 17 00:00:00 2001 From: Alex Alecu Date: Tue, 14 Apr 2026 17:10:03 +0300 Subject: [PATCH 5/5] fix(cli): restore onBeforeExit in ErrorComponent --- packages/opencode/src/cli/cmd/tui/app.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/opencode/src/cli/cmd/tui/app.tsx b/packages/opencode/src/cli/cmd/tui/app.tsx index 9ea5009463d..0507c6f0240 100644 --- a/packages/opencode/src/cli/cmd/tui/app.tsx +++ b/packages/opencode/src/cli/cmd/tui/app.tsx @@ -202,8 +202,11 @@ export function tui(input: { await render(() => { return ( } + // kilocode_change start + fallback={(error, reset) => ( + + )} + // kilocode_change end > @@ -964,10 +967,12 @@ function App(props: { onSnapshot?: () => Promise }) { {plugin()} + {/* kilocode_change start */} ) -} // kilocode_change +} +// kilocode_change end // kilocode_change start — guard against missing renderer context in ErrorBoundary fallback function tryUseRenderer() { @@ -991,6 +996,7 @@ function tryUseTerminalDimensions() { function ErrorComponent(props: { error: Error reset: () => void + onBeforeExit?: () => Promise onExit: () => Promise mode?: "dark" | "light" }) { @@ -1000,6 +1006,7 @@ function ErrorComponent(props: { const height = () => term?.().height ?? process.stdout.rows ?? 24 const handleExit = async () => { + await props.onBeforeExit?.() renderer?.setTerminalTitle("") renderer?.destroy() win32FlushInputBuffer()