feat: sync routing suggestions to cloud for smart routing UX#264
Merged
Conversation
Root cause: Working contract stale threshold (90m) was higher than Kai's manual check (60m), so the product never enforced first. Enforcement messages lacked explicit product-automation labeling, causing leadership agents to feel compelled to intervene manually. Changes: - Tighten stale auto-requeue: 90m → 45m warning, 15m → 10m grace (product enforces at 45+10=55m, before any 60m manual check) - All enforcement messages now labeled [Product Enforcement] with explicit 'no leadership action needed' note - Watchdog stale-working alerts updated: product-driven, not @kai-driven - Follow-up reflection submitted confirming fix Task: task-1771800349310-938b6ebrn
itskai-dev
added a commit
that referenced
this pull request
May 4, 2026
#1333) Replaces drain.ts's inline if/else dispatch with a registry lookup so adding a new verb is one entry in registry.ts plus one file in handlers/. Behavior-zero per kai+link locks (msg-1777932028252 / msg-1777932030625): - same poll cadence - same ack contract - same unknown-skip semantics - no auth / intake churn - no new verbs (the two existing verbs become the first two registry entries — no scope creep) New files: src/commands/types.ts — PendingCommand, CommandContext, CommandHandler src/commands/registry.ts — COMMAND_REGISTRY (context_sync, run_approve) src/commands/handlers/context-sync.ts — relocated from drain.ts src/commands/handlers/run-approve.ts — relocated from drain.ts drain.ts is now ~80 LOC (down from ~200): poll + error tracking + dispatch via registry with the existing unknown-skip ack fallback. Net diff +206/-136. Closes §11e step 2 of reflectt-cloud/docs/COMMAND_PLUGIN_SKILL_ARCHITECTURE.md. Step 3 (routes/canvas extraction) and step 4 (routes/chat extraction) are explicitly out of scope for this PR. Proof: - typecheck green - 244/244 test files pass (2647 tests, 1 skipped) - canonical staging command-queue smoke planned post-merge (poll, ack-complete, ack-fail)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
getRoutingSuggestions()output to the cloud usage sync payload. The node already computes smart routing suggestions (cheaper models for low-stakes categories like heartbeat/reflection/chat). This syncs those suggestions to the cloud dashboard.Part of Monetization Test #1 Day-5: smart routing suggestion UX.
Task: task-1771470941394-632fjzxiq
Reviewer: @Sage