Skip to content

ADFA-5096 | Split the AI backends into standalone plugins - #65

Open
jatezzz wants to merge 7 commits into
mainfrom
refactor/ADFA-5096-split-ai-backend-plugins
Open

ADFA-5096 | Split the AI backends into standalone plugins#65
jatezzz wants to merge 7 commits into
mainfrom
refactor/ADFA-5096-split-ai-backend-plugins

Conversation

@jatezzz

@jatezzz jatezzz commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

Description

Reshapes the AI plugin set from ai-core + ai-assistant into one agent plugin plus one plugin per inference backend, so a user installs only the engine they want and a new backend can ship without touching this repo.

  • ai-core — the Agent chat (tool layer, view models, UI, all folded in from ai-assistant, which is deleted) plus the LlmInferenceService router. Ships no model; discovers installed engines through BackendRegistry and names no provider anywhere in its code.
  • ai-agent-llm — on-device .gguf backend (bundled llama.cpp AAR, native.code), registers as local.
  • ai-agent-gemini — Gemini API backend (network.access), registers as gemini.

Along the way: each backend owns its preferences instead of reading ai-core's AgentSettings; each contributes its own settings pane, system prompt and tests; the ADFA-5095 LlmBackend split is adopted (getConfigSpecs/settingsFragmentClassName moved onto ConfigurableBackend, supportsHistory declared, backend closed on deactivate() so disabling no longer orphans a live instance); and every plugin's sources are laid out by layer (plugin/, backend/, preferences/, services/, logging/…) with utils/ and data/ gone and logs tagged per plugin.

Because plugins load in parallel with no ordering guarantee, settings had to stop depending on who activated first. Each backend now reads the host's legacy store directly and migrates once from every prior location (old plugin id from before the ai-backend-*ai-agent-* rename, ai-core, ai-assistant, the host's LlamaPrefs), guarded by a migrated_* flag so a value changed since is never clobbered. A device configured on the old build stays configured.

Details

7 commits, 233 files, mostly moves/renames:

ai-assistant/ deleted — merged into ai-core
ai-backend-local/ai-agent-llm/ folder, package, plugin.id, label (submodule path in .gitmodules follows)
ai-backend-gemini/ai-agent-gemini/ folder, package, plugin.id, label

Plugin ids after the rename: …plugins.aicore, …plugins.aiagentllm, …plugins.aiagentgemini. README's examples table rewritten to state the new dependency shape (AI Core is mandatory; install at least one backend).

Tests moved with the code they cover and now sit under each owning plugin — 31 test files across the three plugins, all passing.

document_5179206860728698887.mp4

Ticket

ADFA-5096

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@jatezzz
jatezzz requested review from a team, Daniel-ADFA and itsaky-adfa August 11, 2026 22:35
@jatezzz
jatezzz force-pushed the refactor/ADFA-5096-split-ai-backend-plugins branch from 141696d to af8028c Compare August 11, 2026 23:00
@jatezzz
jatezzz force-pushed the feat/ADFA-3070-landscape-chat-scroll branch from 638fcf8 to 4e1d431 Compare August 12, 2026 14:57
@jatezzz
jatezzz force-pushed the refactor/ADFA-5096-split-ai-backend-plugins branch 2 times, most recently from 25b8ed5 to b983b3b Compare August 12, 2026 15:54
@jatezzz
jatezzz force-pushed the feat/ADFA-3070-landscape-chat-scroll branch from 4e1d431 to 2e66175 Compare August 12, 2026 16:56
@jatezzz
jatezzz force-pushed the refactor/ADFA-5096-split-ai-backend-plugins branch from b983b3b to 78316c7 Compare August 12, 2026 16:56
@hal-eisen-adfa

Copy link
Copy Markdown
Contributor

This depends on appdevforall/CodeOnTheGo#1660 landing first

@jatezzz
jatezzz force-pushed the feat/ADFA-3070-landscape-chat-scroll branch from 2e66175 to 4f97f44 Compare August 13, 2026 13:12
@jatezzz
jatezzz force-pushed the refactor/ADFA-5096-split-ai-backend-plugins branch from e1c3ffc to 3304742 Compare August 13, 2026 13:13
Base automatically changed from feat/ADFA-3070-landscape-chat-scroll to main August 13, 2026 13:13
@jatezzz
jatezzz force-pushed the refactor/ADFA-5096-split-ai-backend-plugins branch from 3304742 to 37c4398 Compare August 13, 2026 13:14
Extract the Gemini and local-LLM backends out of ai-assistant into their own plugins, each owning its settings behind a registry in ai-core, so a backend can be installed and enabled without dragging the others in.
Merge the chat UI, tool layer and view models into ai-core and delete the ai-assistant project, so the agent ships as one plugin.
Replace cross-plugin reads of ai-core's AgentSettings with GeminiPreferences and LocalLlmPreferences, reading the host's LlamaPrefs and every legacy store so unordered plugin activation no longer strands the model path. Move getConfigSpecs/getSettingsFragmentClassName onto ConfigurableBackend, declare supportsHistory, and close the backend on deactivate so disabling one no longer orphans a live instance.
Layer the plugin packages, tag logs per plugin, align both modules with the standard toolchain, and point the llama.cpp submodule at its final path.
Route generateStreamingWithTools by ToolCallingBackend/HistoryCapableBackend instead of the dropped supportsTools/supportsHistory flags, and delete getConfigSpecs from both backends now that each mounts its own settings fragment. Handle the API's new nullability and Role.TOOL: prompt builders omit the tool-call section when the caller parses no envelope, and ChatViewModel reads a completed response's text once.
Remove the ai-core lifecycle listener in dispose(), repoint proguard at the layered packages, raise min_ide_version to 26.32, gate create/update writes on PathGuard, and drop stale ai-assistant references from docs and tooltips.
plugin-api now annotates LlmResponse.text as @nullable, so code-suggestions and speech-to-text no longer compile against it. Fall back to an empty completion and to the existing null return respectively.
@jatezzz
jatezzz force-pushed the refactor/ADFA-5096-split-ai-backend-plugins branch from 1a3b533 to 4cfed82 Compare August 13, 2026 21:54
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.

2 participants