ποΈ Architect: extract a Backend adapter so ServerManager stops branching on backend type - #77
Draft
cleanunicorn wants to merge 1 commit into
Draft
ποΈ Architect: extract a Backend adapter so ServerManager stops branching on backend type#77cleanunicorn wants to merge 1 commit into
cleanunicorn wants to merge 1 commit into
Conversation
Structural-debt review: ServerManager branches on backend type (llama vs ASR) inline for command building and prompt-cache eligibility, while backend.py only handles detection. Recent llama-only feature work (prompt cache persistence, cache flags) grew this special-casing further. Proposal-only doc, zero functional code changes.
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
This is a proposal only β zero functional code changes. Full write-up:
docs/proposals/2026-08-24-backend-adapter.mdProposed change: move the llama-server-vs-ASR command-building and prompt-cache-eligibility
logic out of
ServerManager(863 lines, the largest module in the codebase) and into two smallBackendadapter classes (LlamaBackend,AsrBackend) behind a shared interface insrc/drove/backend.py, which today only detects the backend name but doesn't own what that namemeans.
Why now
The last two feature PRs (prompt-cache-across-sleep, llama-server cache flags) both added more
llama-only special-casing directly into
ServerManager(if backend == BACKEND_ASR: ... else: ...at 3 separate points). Tests already reach intoServerManager's private methods(
manager._build_asr_command(...)) to test backend-specific behavior β a symptom of there being noseam to test that logic without going through the manager.
What this is not
/v1/*API, CLI, or config-file format changesModelConfigschema changesBefore / after
See diagrams in the proposal doc.
Risk: low
No contract changes, no new dependencies, fully revertible in one commit, existing test suite
covers both backends' command-building today and can be adapted rather than rewritten.
Approval needed
Repo owner sign-off (single-maintainer repo, no infra/security surface touched).
ποΈ This PR is intentionally a discussion draft β the doc is the deliverable, not code. If the
proposal isn't approved, I'll record why in the (to-be-created) architect journal for next time.
Generated by the automated Architect review routine.
Generated by Claude Code