Repository navigation
LLM triage: propose tasks from dumps and a review queue - #10
Merged
rooty-bot merged 2 commits intoNov 30, 2026
Merged
Conversation
- OpenAI-compatible chat client (LLM_BASE_URL, LLM_MODEL, LLM_API_KEY,
LLM_TIMEOUT_SECONDS) with a timeout and clear error messages.
- Triage: strict JSON system prompt, defensive parsing (code fences,
<think> tags, {tasks: [...]} wrapper) validated with zod, one retry
that explains what was wrong.
- Proposals table: nothing becomes a task until a human accepts it.
Accepting is atomic and idempotent; a dump is triaged once all its
proposals are reviewed. Empty results stay in the queue.
- Review page: triage all new dumps, edit/accept/reject, retry, dismiss.
- Tasks page: list with done toggle and project filter.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Retry only replaces a dump's pending proposals after the LLM succeeds. - Saving proposals claims the dump atomically, so concurrent triage runs or a dump deleted mid-call cannot duplicate or crash. - Triage-all skips a dump the LLM errors on and only stops after two LLM errors in a row. - Pass LLM_TIMEOUT_SECONDS through docker compose. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
Author
|
Thanks for this, it's a careful and well-scoped PR. I checked it against #3 point by point: Scope vs. issue #3
Tests: All four cases the issue requires are in Correctness/security
Non-blocking nits (fine for a follow-up):
Nice work overall. Approving from my side. -- OpenSourcerer (Rootshift review) |
rooty-bot
deleted the
claude/3-llm-triage-propose-tasks-from-dumps-and
branch
November 30, 2026 11:49
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.
Summary
src/lib/server/llm.ts): OpenAI-compatiblePOST {LLM_BASE_URL}/chat/completions. It readsLLM_BASE_URL(defaulthttp://ollama:11434/v1),LLM_MODELand an optionalLLM_API_KEY(sent as a bearer token). It has a timeout and gives distinct, readable errors for timeout, unreachable server, HTTP error (with a short body excerpt) and non-chat responses. The API key never appears in messages.src/lib/server/triage.ts): a strict system prompt asks for a JSON[{title, notes, project?, due?}]array. Parsing is defensive: it strips code fences and<think>tags, unwraps{tasks: [...]}, and validates with zod (trimmed title; blank fields become null; an invalid or non-ISOduebecomes null). On invalid JSON or the wrong shape it retries once, telling the model what was wrong./review): pending proposals grouped by dump. You can edit then accept, accept, reject, ask the LLM again, or reject the rest and mark triaged. Triage all new dumps processes every untriaged dump and reports failures per dump.triagedonce none of its proposals are pending./tasks): list with a done toggle (todo ↔ done, bumpsupdated_at) and a project filter.Decisions the issue didn't specify
LLM_MODELdefaults tollama3.2, so the bundled Ollama works without extra config. I also addedLLM_TIMEOUT_SECONDS(default 120). All four variables are in the README table and indocker-compose.yml.003_triage.sqladds three things:proposalstable, deleted with its dump;tasks.projectcolumn (the existing table only hadcategory_id);dumps.proposed_atcolumn marking "sent to the LLM, awaiting review".[]can't silently drop a dump.zodwas added as a runtime dependency.How it was tested
fetchlevel as an OpenAI-compatible server:TriageError; no proposals are stored and the dump staysnew/reviewand/tasksform actions end to end with a stubbed globalfetch, including a failed retry that keeps existing proposals.npm run lint,npm run check,npm test(68 tests) andnpm run buildall pass locally./taskswith its project filter, and the dump showstriagedin the inbox.Closes #3
🤖 Generated with Claude Code