Repository navigation
feat(kiloclaw) briefing chat summary - #3352
Conversation
Code Review SummaryStatus: 1 Issue Found | Recommendation: Address before merge Executive SummaryThe new Overview
Issue Details (click to expand)WARNING
Resolved Issues
Files Reviewed (incremental diff since 0fdad49)
Fix these issues in Kilo Cloud Reviewed by claude-4.6-sonnet-20260217 · 861,043 tokens Review guidance: REVIEW.md from base branch |
jeanduplessis
left a comment
There was a problem hiding this comment.
Approved with two warnings worth addressing:
- chat day-window construction can shift by an hour on DST transition days
- summary configuration currently keys off gateway token even when controller Kilo Chat routes are not registered
Main feature shape, pagination hardening, and briefing integration otherwise look sound.
| }; | ||
| } | ||
|
|
||
| const sandboxId = options.sandboxId ?? process.env.KILOCLAW_SANDBOX_ID; |
There was a problem hiding this comment.
WARNING: sandboxId and kiloChatBaseUrl are validated as required but never used
Both variables are extracted and guard-checked (lines 202–218), but neither is referenced anywhere in the rest of createKiloChatSummaryClient. All request URLs are built from baseUrl (the controller proxy URL). The linter will flag these as unused variables.
This is either:
- Incomplete implementation —
kiloChatBaseUrlwas intended to be used in the/_kilo/kilo-chat/…URL construction instead of routing through the controller proxy, but the substitution was not wired in; or - Premature guards — these env vars are not yet needed and the validation should be removed until the code that uses them is added.
As-is, you are requiring operators to set two env vars (KILOCLAW_SANDBOX_ID, KILOCHAT_BASE_URL) that the runtime silently ignores, which will cause the morning briefing to silently report chat as unconfigured in environments that have not set these vars — even though the controller proxy path works fine without them.
There was a problem hiding this comment.
false positive
-
The bot claims "the linter will flag these as unused variables" — that's wrong. Both sandboxId (used at line 203) and kiloChatBaseUrl (used at line 212) are referenced in their own if (!...) guard checks. ESLint no-unused-vars will not flag them.
-
The bot's deeper point ("requiring env vars the runtime ignores") misses context: those guards are the fix for jeanduplessis's warning AppBuilder - Fix model selector not showing saved model on reload #4. The controller only registers /_kilo/kilo-chat/* when those exact two vars are present, so the briefing plugin checks the same two vars to decide whether the routes exist. They're an intentional availability gate, not URL inputs. Removing them would re-introduce finding AppBuilder - Fix model selector not showing saved model on reload #4 — the human reviewer's explicit concern.
Summary
Adds a Kilo Chat activity section to the morning briefing. Each briefing now includes two new sections built from the Kilo Chat controller: one summarizing yesterday's activity and one covering today so far. The summary reports message counts, active conversation counts, and a split between user messages and Kilo replies. Deleted messages are tracked separately and excluded from content counts.
The new
chat-summary-clientpaginates conversations and messages from the controller via the gateway, stopping early when activity falls outside the target window. The newchat-summary-utilsbuilds time windows in the configured briefing timezone, decodes ULIDs to message timestamps, and renders the markdown lines. The briefing pipeline now treats Kilo Chat as a configured source alongside Calendar, GitHub, Linear, Local News, and Web Search.If
OPENCLAW_GATEWAY_TOKENis not set, the chat section is skipped gracefully and the rest of the briefing continues to render.Verification
Yesterday in ChatandSo Far Today in Chatsections render with accurate counts.pnpm run format:check,pnpm run lint, andpnpm run typecheckat the workspace root.Visual Changes
N/A
Reviewer Notes
MAX_CONVERSATION_PAGES,MAX_MESSAGE_PAGES_PER_CONVERSATION) to bound worst case API load when the controller returns many stale conversations.ulidToTimestampMsis used to filter messages without relying on a server side timestamp. Worth a sanity check on the Crockford base32 implementation.new Date()in multiple places. It now shares a singlegeneratedAtso all sections, the markdown header, and the stored status agree on one timestamp.