Skip to content

feat(kiloclaw): default session.dmScope to 'main' on fresh install#1834

Open
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
feat/fresh-install-session-dmscope
Open

feat(kiloclaw): default session.dmScope to 'main' on fresh install#1834
kilo-code-bot[bot] wants to merge 1 commit intomainfrom
feat/fresh-install-session-dmscope

Conversation

@kilo-code-bot
Copy link
Copy Markdown
Contributor

@kilo-code-bot kilo-code-bot bot commented Apr 1, 2026

Summary

On fresh KiloClaw installs, set config.session.dmScope = 'main' so DMs are routed to the main session by default. This follows the existing KILOCLAW_FRESH_INSTALL pattern used for config.tools.profile. On subsequent boots, the user's choice is left untouched.

  • Added a fresh-install-only block in generateBaseConfig() (right after the tools.profile block) that sets config.session.dmScope = 'main' when KILOCLAW_FRESH_INSTALL === 'true'
  • Added 4 tests covering: fresh install sets the value, non-fresh boot does not set it, user customization is preserved on non-fresh boot, and fresh install overrides a previously-set value

Verification

  • pnpm test --run — 49 test files, 1151 tests passed (kiloclaw)
  • pnpm test --run controller/src/config-writer.test.ts — 71 tests passed (4 new)
  • pnpm typecheck — no errors
  • pnpm lint — 0 warnings, 0 errors

Visual Changes

N/A

Reviewer Notes

The change only applies on fresh installs (KILOCLAW_FRESH_INSTALL === 'true'), matching the exact same pattern used at config-writer.ts:203 for tools.profile. The writeBaseConfig() function temporarily forces KILOCLAW_FRESH_INSTALL = 'true' during config restores, so session.dmScope will also be reset to 'main' on config restore — this is intentional and consistent with how tools.profile behaves.

Set config.session.dmScope = 'main' when KILOCLAW_FRESH_INSTALL is truthy,
so DMs are routed to the main session on new installations. On subsequent
boots the user's choice is left untouched.
@kilo-code-bot
Copy link
Copy Markdown
Contributor Author

kilo-code-bot bot commented Apr 1, 2026

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Files Reviewed (2 files)
  • kiloclaw/controller/src/config-writer.ts
  • kiloclaw/controller/src/config-writer.test.ts

Reviewed by gpt-5.4-20260305 · 368,905 tokens

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants