Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 45 additions & 6 deletions home/openclaw/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ in
# the token itself never enters the store.
environment = {
OPENCLAW_GATEWAY_TOKEN = "${homeDir}/.secrets/openclaw/gateway-token";
OPENCLAW_SLACK_BOT_TOKEN = "/home/user/.secrets/openclaw/slack-bot-token";
OPENCLAW_SLACK_APP_TOKEN = "/home/user/.secrets/openclaw/slack-app-token";
};

# Extra binaries on the gateway's PATH (not the login shell's):
Expand Down Expand Up @@ -105,11 +107,7 @@ in

# nix-openclaw tool plugins (CLI tools + skills, packaged in Nix).
bundledPlugins = {
# summarize.enable = true; # summarize URLs / PDFs / videos —
# disabled 2026-10-26: its ~780-package pnpm deps fetch kept dying
# on the laptop's flaky route to registry.npmjs.org (timeouts /
# HTTP2 framing errors). Re-enable and rebuild when the route is
# healthy; nothing else depends on it.
summarize.enable = true; # summarize URLs / PDFs / videos
gogcli.enable = true; # Google Workspace CLI (gog)
goplaces.enable = true; # Google Places CLI
# peekaboo / poltergeist are macOS-only in the nix-openclaw
Expand Down Expand Up @@ -141,6 +139,9 @@ in
"firecrawl"
"perplexity"
"duckduckgo"
"searxng" # keyless web search (added 2026-10-26, Drew: more plugins)
"lobster" # typed workflow runtime for resumable automations
"diffs" # diff rendering for code review in chat
"tokenjuice" # context compression
];

Expand Down Expand Up @@ -224,6 +225,30 @@ in
};
};

# Chat channels. Slack wired 2026-10-26: app A0CD7L3S81W, bot
# @openclaw (U0CC72H7KA7); tokens via env SecretRefs fed from
# laptop files (interim home for sops-managed secrets). DMs from
# Drew only; channel access gets allowlisted per channel later.
channels = {
slack = {
enabled = true;
mode = "socket";
botToken = {
source = "env";
provider = "default";
id = "OPENCLAW_SLACK_BOT_TOKEN";
};
appToken = {
source = "env";
provider = "default";
id = "OPENCLAW_SLACK_APP_TOKEN";
};
dmPolicy = "allowlist";
allowFrom = [ "U0CBX163G8Z" ]; # Drew
groupPolicy = "allowlist";
};
};

# Model routing: local plan proxies only (see QUOTAS.md). Primary is
# DeepSeek Flash on the CommandCode plan; fallbacks stay on plan
# routes; the Codex/OpenAI proxy is registered for explicit use as
Expand Down Expand Up @@ -255,6 +280,12 @@ in
};
};

# One DM session per channel+peer, so a future second channel
# never shares a transcript with Slack DMs.
session = {
dmScope = "per-channel-peer";
};

agents = {
defaults = {
model = {
Expand All @@ -265,7 +296,15 @@ in
"commandcode/moonshotai/kimi-k2.6"
];
};
heartbeat.every = "1h";
heartbeat = {
every = "30m";
lightContext = true;
isolatedSession = true;
activeHours = {
start = "07:00";
end = "23:00";
};
};
};
ownership = "explicit";
entries = {
Expand Down
2 changes: 1 addition & 1 deletion home/openclaw/workspace/QUOTAS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Drew's rule, verbatim in spirit: **"Use the plans. Measure the quotas."**

1. **Plans only, never funds.** Every model call must ride a subscription plan. PAYG balances (e.g. a raw DeepSeek API balance, OpenAI API billing, Zen funds) are emergency reserves Drew controls — an agent never falls back to them. A 402/quota error is a wall: at most ONE retry on the same pool, then rotate pools or stop and report.
2. **Burn by expiry.** Prefer the pool whose window expires soonest. **OpenAI is the final reserve** — do not drain it while other pools have capacity. (This is why this gateway's default is DeepSeek Flash on the CommandCode plan, with the Design-plan DeepSeek as fallback, and the Codex/OpenAI proxy is registered but _not_ in the fallback chain.)
3. **Measure before and during.** Before starting heavy work on a pool, check its quota if a checker exists (OpenChamber's quota view / the provider registry in the keep-the-four-repos-healthy goal files). Above ~85% of a window: only small work that finishes inside the window.
3. **Measure before and during.** Before starting heavy work on a pool, check its quota if a checker exists (OpenChamber's quota view / the provider registry in the keep-the-four-repos-healthy goal files). Pools are used all the way to 100% (the old ~85% caution zone is retired, Drew 2026-10-27). At a known 100% the pool is closed — no new work, no continued calls — until its reset time, or until a fresh check shows it has dropped below 100% (some providers reset early).
4. **Model + effort is one decision, per task.** Defaults: DeepSeek Flash (high effort) for routine work; Haiku/Sonnet-class for standard Claude work; Luna-class at max effort for cheap OpenAI-side work; flagship models (Sol/Opus-class) right-sized at medium, only for genuinely hard problems. Never leave model or effort at "default" by accident.
5. **One Meta pool, one door.** The Meta High Usage plan is reached through the fleet's `meta` provider route (muse-proxy, :18747). It is a plan pool like the others — not "Muse's subscription" (that's Drew's separate assistant product and not a pool at all). This gateway does not use it by default; OpenCode sessions route to it under their own discipline.
6. **Cloudflare gateway:** at most one unimportant session at a time. Not a routine route.
Loading