Skip to content

Implement TOML configuration, provider chaining, and Omni client integration#5

Open
fajarhide wants to merge 8 commits intomainfrom
feat/0.1.4
Open

Implement TOML configuration, provider chaining, and Omni client integration#5
fajarhide wants to merge 8 commits intomainfrom
feat/0.1.4

Conversation

@fajarhide
Copy link
Copy Markdown
Owner

@fajarhide fajarhide commented May 3, 2026

PR Auto Describe

Summary

This PR overhauls the CI, configuration, and runtime layers: the GitHub Actions workflow now delegates all checks to a single make ci target; a new DEVELOPMENT.md guide replaces the old env‑based docs; configuration switches from env vars to a TOML file that supports multiple providers and Omni distillation; the server now uses a UniversalRouterHandler that builds a provider chain and optional Omni distiller; an OpenAI‑to‑Anthropic adapter is added; OAuth credential management is introduced; the Makefile, Docker‑Compose, and README are updated to reflect these changes.


Key Changes

  • CI – single make ci target replaces vet/test/build steps.
  • Development guide – new DEVELOPMENT.md replaces env‑based instructions.
  • Configurationconfig.toml (with provider list, Omni, fallbacks); env files removed.
  • Router & Provider chainUniversalRouterHandler, router.NewProviderChain, Omni support.
  • AdapterFromOpenAIRequest for OpenAI → Anthropic conversion.
  • Auth – OAuth provider interface, manager, file store.
  • Makefile – added ci, updated setup to use Go binary.
  • Docker‑Compose – mounts config.toml instead of env.
  • README – rewritten with new features, architecture, quick‑start, and table of contents.

Detailed Breakdown

  • .github/workflows/ci.yml
    Removed vet, test, build steps; added make ci job.

  • DEVELOPMENT.md
    • Full local dev guide (prereqs, init, setup, run, test, ci, build).
    • Highlights Go 1.25+, Make, Git, config.toml wizard.

  • Makefile
    Added ci: fmt lint test build with success message.
    Changed setup to go run $(MAIN_PKG) setup.
    Kept fmt, lint (go vet).

  • README.md
    Rewritten intro, added TOC, problem/solution sections, feature list, architecture diagram, quick‑start, config schema, supported providers table, container notes, API reference.
    Removed env‑based config section.

  • cmd/server/main.go
    Switched to handler.NewUniversalRouterHandler.
    Instantiates provider chain (router.NewProviderChain) if providers defined.
    Adds Omni distiller (omni.NewClient, omni.NewDistiller).
    Registers /v1/messages and /v1/chat/completions to same handler.

  • internal/adapter/from_openai.go
    Implements conversion of OpenAIRequest to AnthropicRequest, including tools, messages, and content blocks.

  • internal/auth/oauth.go + store.go
    New OAuth provider interface, manager, and file‑based credential store with JSON persistence.

  • internal/config/config.go
    Removed env parsing; now loads from TOML (LoadTOML).
    Adds fields: OmniEnabled, OmniMCPURL, OmniMinContentBytes, Providers []ProviderConfig.
    Returns error if TOML missing.

  • config.toml.example
    Provides template with server, omni, provider, and fallback sections.

  • docker-compose.yaml
    Replaces env file with volume mount of ~/.heimsense/config.toml.

  • go.mod / go.sum
    Added github.com/BurntSushi/toml v1.6.0.

  • scripts/setup-claude.sh removed (replaced by Go setup).

  • Other changes – updated README badges, removed legacy env example.


Notes

  • The project no longer reads ~/.heimsense/.env; ensure config.toml exists or run heimsense setup to generate it.
  • The setup command now runs the Go binary, not a shell script.
  • make ci now encapsulates all checks; run this locally before PRs.

Breaking Changes

  • Configuration: HEIMSENSE_CONFIG and .env are obsolete; use config.toml.
  • Setup command changed, may require updating CI or local scripts.
  • Server now supports /v1/chat/completions; older clients using only /v1/messages continue to work.
  • Docker Compose no longer exposes environment variables; update volume mounts accordingly.

Last updated: 2026-05-03 11:21:14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant