Skip to content

feat: optional LLM classifier and guidance triggers - #27

Open
BaconDroid wants to merge 2 commits into
ian-pascoe:mainfrom
BaconDroid:feat/classifier
Open

BaconDroid wants to merge 2 commits into
ian-pascoe:mainfrom
BaconDroid:feat/classifier

Conversation

@BaconDroid

@BaconDroid BaconDroid commented Oct 19, 2026 •

Copy link
Copy Markdown

Summary

Adds an optional LLM classifier and scopes the guidance to the turns that matter.

  • triggers.afterIdle: first request after an idle or session start when no user message is pending.
  • triggers.afterUserMessage: first request after a real user message.
  • Omit triggers for the original behavior (guidance on every request); both false disables the guidance.
  • The main session still receives the same guidance (policy + current/valid levels) at the triggers.
  • classifier is disabled by default and keeps opencode/big-pickle configured. When enabled, it runs on real user messages, uses the same guidance as its system prompt, the last compaction summary (assistant message with summary: true) or the messages since session start/last idle, and the current message last. It applies the returned level to the triggering message.
  • Synthetic and ignored messages are skipped. Failures and timeouts leave the level unchanged.
  • State is a 5,000-entry LRU, expires after seven days of inactivity, and is removed on session.deleted.

Stacked on #23.

"triggers": { "afterIdle": true, "afterUserMessage": true },
"classifier": {
  "enabled": false,
  "model": { "providerID": "opencode", "modelID": "big-pickle" }
}

Tests

  • Guidance per idle/user turn, no double injection, both-false disables, classifier only on user turns, compaction summary context, session deletion cleanup.
  • pnpm verify passes (28 tests, format, lint, typecheck, build).

Fix the temporary-reset baseline, read assistant-shaped messages, merge
guidance into the first system prompt, and replace Zod config parsing
with a small validator.
Add an optional classifier (default opencode/big-pickle) and
afterIdle/afterUserMessage triggers for the guidance. The classifier uses
the same guidance, the last compaction summary or the current segment,
and the current message last. Session state is bounded at 5,000 entries,
expires after seven days, and is removed when a session is deleted.
@BaconDroid BaconDroid changed the title feat: optional LLM effort classifier feat: optional LLM classifier and guidance triggers Oct 20, 2026
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.

1 participant