Commit dc37aea
authored
feat(selfhost): local-inference binding for advisory-tier AI capabilities (AI_ADVISORY) (#4388)
Only the core PR review needs frontier-model accuracy -- it drives real
gate blockers. Slop advisory, e2e test-gen, the issue planner, and AI
summaries/rewrite are all advisory-only (never gate-blocking) and were
sharing the same frontier claude-code/codex chain purely because no
cheaper alternative existed, silently spending real subscription tokens
on every PR regardless of the repo's review-effort setting (which only
ever threaded through the core review path).
Adds env.AI_ADVISORY, wired in src/server.ts mirroring AI_EMBED/AI_VISION's
exact pattern (AI_ADVISORY_BASE_URL/_MODEL/_API_KEY, createOpenAiCompatibleAi,
absent-binding fallback to env.AI). Routing is config-driven per capability
via .gittensory.yml settings.advisoryAiRouting (global default + per-repo
override, config-as-code only, mirrors unlinkedIssueGuardrail's shape) --
never hardcoded, and a capability only actually routes through the local
binding when both the yml opt-in AND the binding itself are configured.
Wired at all four real call sites via a shared withAdvisoryAiEnv helper
(src/selfhost/ai.ts): runAiSlopForAdvisory, the e2e-test-gen delivery
path, the issue-planner command handler, and the agent-run AI summary
attachment. Zero risk to the core review's accuracy since that path is
untouched.1 parent 141e99a commit dc37aea
22 files changed
Lines changed: 804 additions & 283 deletions
File tree
- apps/gittensory-ui
- public
- src/lib
- config/examples
- packages/gittensory-engine/src
- review
- types
- src
- openapi
- queue
- review
- selfhost
- services
- signals
- test/unit
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
622 | 635 | | |
623 | 636 | | |
624 | 637 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
876 | 876 | | |
877 | 877 | | |
878 | 878 | | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
879 | 891 | | |
880 | 892 | | |
881 | 893 | | |
| |||
0 commit comments