Feat/multi model sqlite state - #13
Open
zelvinator wants to merge 10 commits into
Open
Conversation
The previous 1500-character truncation was too aggressive and could lose important context from issue/PR descriptions (which have a 65,536 character limit). Increasing to 5000 chars provides a much better preview while still keeping the payload manageable. Closes #10
Redesign from single-model cron to two-model pipeline: - Qwen 3.6 worker (every 5 min): discovery, triage, simple fixes, implementation from GLM plans, file-level review, stale reset - GLM 5.2 planner (every 15 min): architectural planning, complex review, takeover after 2 failed Qwen attempts Replaces flat-file tracker (.zelvinator-processed.txt) with SQLite state database at ~/.hermes/zelvinator-bot/state.db — outside git working directory, immune to git stash/checkout/reset. Key improvements: - Claim-on-complete instead of claim-on-discover: items stay in their current state if cron session dies, get retried next cycle - Validated state transitions with 10-state machine - Attempt tracking with auto-increment on implementation cycles - Stale detection (implementing >20 min → reset to planned) - Structured JSON plan format as GLM→Qwen contract - New CLI commands: queue, state, plan, stale, stats, reset Tested: 18/18 state machine tests pass, end-to-end find discovers 23 real items from GitHub API with correct dedup on re-run.
zelvinator
commented
Jul 27, 2026
| plan TEXT, -- JSON plan from GLM | ||
| review_feedback TEXT, -- GLM's review notes | ||
| pr_url TEXT, | ||
| attempts INTEGER DEFAULT 0, |
Owner
Author
There was a problem hiding this comment.
@zelvinator Could there be guard against it going to negative?
Items that GLM planned must always go through GLM review (needs_review), not be self-approved by Qwen. Updated Phase 3 review triage to distinguish between direct items (Qwen can self-approve) and planned items (must escalate to GLM).
Comment triggers requesting a code review ('review', 'code review',
'review this') now go to needs_review for GLM instead of being
handled directly by Qwen. Only quick questions/actions stay with Qwen.
Qwen does a fast first-pass review (bugs, tests, style) and posts findings as a comment, then escalates to GLM. GLM reads Qwen's review and amends it with architectural analysis instead of starting from scratch. Applies to both code review requests (comment triggers) and planned item implementations.
Add /command parsing to trigger comments. Commands replace natural language triage with deterministic dispatch: /review — Qwen fast review + GLM amend /quick-review — Qwen only /fix — apply review fixes, GLM reviews /quick-fix — apply fixes, self-approve /plan — GLM plans only /implement — Qwen implements, GLM reviews /quick-implement — Qwen implements, self-approve /status — report pipeline state (empty) — conversational reply (unknown) — show /help Bot can self-trigger: GLM posts @zelvinator /fix after review, Qwen posts @zelvinator /review after implementing. zelvinator user added to whitelist for slash commands only (not natural language). Go changes: - command column added to SQLite schema (with migration for existing DBs) - ParseCommand/IsKnownCommand/IsQuickCommand in state package - find.go: zelvinator user can trigger via slash commands only - Unit tests for command parsing
…hedule - /help: Go binary posts cheatsheet directly, no LLM invocation needed - Worker model: qwen36-coding (temp 0.6, better for code work) - Worker schedule: every minute (most cycles are SILENT)
All implementation paths (body/assignment, /implement, /quick-implement, Phase 2 planned items) now comment on the original issue with the PR link and summary before transitioning state.
All implementation paths now post @zelvinator /review on the PR after opening it. Next cycle Qwen discovers the self-trigger, does fast first-pass review, escalates to GLM for architectural amend. Flow: implement → post PR link → post @zelvinator /review → next cycle: Qwen fast review → GLM amends → done (or /fix loop) /quick-* variants skip the self-trigger (self-approve, no review).
find only returns NEW items. Items discovered in a previous run that weren't processed (e.g. session timed out) sat in discovered state forever. Now Phase 1 also runs queue --state=discovered to pick up all unprocessed items.
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.
No description provided.