Skip to content

feat: multi-custom provider system with TUI preset picker#6

Merged
Axect merged 15 commits intomainfrom
feat/multi-custom-provider
Apr 7, 2026
Merged

feat: multi-custom provider system with TUI preset picker#6
Axect merged 15 commits intomainfrom
feat/multi-custom-provider

Conversation

@Axect
Copy link
Copy Markdown
Owner

@Axect Axect commented Apr 7, 2026

Summary

  • Add custom_providers DB table for storing user-defined AI CLI providers with preset templates
  • Support 6 presets: Claude-like, Codex-like, Gemini-like, Ollama-like, OpenRouter, Manual
  • TUI Prefs tab: new "Custom" row in Config section with full creation flow (preset picker -> name input -> command template editor)
  • Dynamic provider resolution: custom providers appear in provider cycle alongside built-ins
  • Error propagation: summarize/translate failures now write to stderr with exit code 1, visible in TUI jobs panel

Changes

Python backend (7 files):

  • core/database.py: custom_providers table schema
  • core/models.py: CustomProviderConfig dataclass
  • services/settings_service.py: CRUD methods for custom providers
  • services/providers.py: get_provider() resolves custom providers dynamically
  • services/summarization.py, services/translation.py: stderr error output
  • cli/daily.py: exit code 1 on AI service failure

Rust TUI (6 files):

  • presets.rs: 6 preset template definitions
  • db/models.rs, db/mod.rs: CustomProviderEntry model + DB CRUD
  • app.rs: PrefsState fields, new OverlayMode and ConfirmAction variants
  • events.rs: Config section navigation, overlay handlers, confirm handler
  • main.rs: Config section rendering, 3 new overlay render functions

Test plan

  • Python tests: 171/171 passed
  • Rust tests: 4/4 passed
  • Rust clippy: no new warnings
  • Release build: OK
  • Python CLI: custom provider add/resolve/remove flow verified
  • TUI manual test: preset picker -> name input -> command template -> provider cycle

Axect added 15 commits April 7, 2026 15:11
- Add custom_providers and custom_provider_selected fields to PrefsState
- Add PresetPicker, ProviderNameInput, CommandTemplateInput variants to OverlayMode
- Add RemoveCustomProvider variant to ConfirmAction
- Load custom_providers in Char('5') and Char('r'/'R') prefs refresh handlers
Add presets.rs with 6 built-in CLI templates (Claude-like, Codex-like,
Gemini-like, Ollama-like, OpenRouter, Manual) and reserved name list.
Update cycle_config_option to append custom providers from the DB to
the built-in provider rotation list.
Add Down/Up/Left/Right/a/Delete key handling for the custom providers
row (section_selected[4] == 2) in the Config section, and implement
RemoveCustomProvider confirmation action.
Add render_preset_picker, render_provider_name_input, and
render_command_template_input functions, and wire them into the
overlay dispatch replacing the previous empty stubs.
@Axect Axect merged commit fab6673 into main Apr 7, 2026
4 checks passed
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.

1 participant