Skip to content

llamacpp adapter: the AIProviderAdapter impl moves to provider.rs, unchanged (S2b prep) - #6144

Merged
joelteply merged 3 commits into
canaryfrom
fable/adapter-generate-split
Nov 18, 2026
Merged

joelteply merged 3 commits into
canaryfrom
fable/adapter-generate-split

Conversation

@joelteply

@joelteply joelteply commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

This prepares serving S2b, which routes a resident's turn through the model's own chat handling (ChatRender, #6142). That work lands in generate_text, inside the 853-line llamacpp_adapter.rs, and would cross the 1,000-line rule. This PR is the move only, so S2b's diff stays reviewable.

The whole AIProviderAdapter impl now lives in llamacpp_adapter/provider.rs, the way openai_adapter/provider.rs holds that adapter's. It adds no new signature.

The first head, f556a46, moved only generate_text's body into an inherent generate(). That added a second Result<_, String> signature and failed stringly_errors (4245 → 4246), so the whole impl moves instead.

Byte-exact move:

  • provider.rs, after its 7-line header (doc comment and use super::*;), equals canary's llamacpp_adapter.rs lines 188-853.
  • llamacpp_adapter.rs equals canary's lines 1-187, plus mod provider;.
  • 853 lines become 188 + 673.

Measured

Not built locally: this machine serves, so CI is the first compile. No test changes.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo

…nged

Serving S2b routes a resident's turn through the model's own chat handling (ChatRender, #6142):
render with tools and reasoning, parse native tool calls. That work lands in generate_text, a
392-line body inside the 853-line adapter file, which would cross the 1,000-line rule. This is the
move only: LlamaCppAdapter::generate in llamacpp_adapter/generate.rs (404 lines), the trait method
delegates. No line of the body changes; llamacpp_adapter.rs is 463 lines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
…d (stringly_errors ratchet)

f556a46 moved generate_text's body into an inherent LlamaCppAdapter::generate, which added a
second Result<_, String> signature beside the trait's (stringly_errors 4245 -> 4246). The move is now
the whole AIProviderAdapter impl into llamacpp_adapter/provider.rs, the way openai_adapter/provider.rs
holds that adapter's: no new signature, generate.rs is gone. Verified byte-exact: provider.rs after
its header equals canary's llamacpp_adapter.rs lines 188-853; llamacpp_adapter.rs equals lines
1-187 plus 'mod provider;'. 853 -> 188 + 673 lines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
joelteply added a commit that referenced this pull request Nov 18, 2026
…o S2b slice 1

Git carried slice 1's edits through the generate.rs -> provider.rs rename: the chat render, parse
and response fields now sit inside AIProviderAdapter::generate_text in provider.rs (704 lines).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01LoTjvf5j3Ez13g6k8mRkFo
@joelteply joelteply changed the title llamacpp adapter: generate_text's body moves to its own module, unchanged (S2b prep) llamacpp adapter: the AIProviderAdapter impl moves to provider.rs, unchanged (S2b prep) Nov 18, 2026
@joelteply
joelteply merged commit 5168997 into canary Nov 18, 2026
32 checks passed
@joelteply
joelteply deleted the fable/adapter-generate-split branch November 18, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant