feat(cli): expose local and BYO provider routes - #421
Conversation
aadc981 to
eba6732
Compare
eba6732 to
d9fe4fe
Compare
Add provider-aware semantic indexing, manifest-authoritative Wiki reopening, redacted doctor probes, and process-local credential delivery for GitHub Models and BYO OpenAI-compatible services.\n\nVerify remote embedding construction through a local OpenAI-compatible server and cover route mismatch, dependency, packaging, and secret-regression boundaries.
Explain GitHub Models and BYO embedding/chat setup, workflow permission requirements, artifact compatibility identity, billing boundaries, and the guarantee that credentials never enter manifests or static exports.
d9fe4fe to
a8fe561
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d9fe4fedde
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| model=model_backend.model if model_backend else None, | ||
| api_base=model_backend.api_base if model_backend else None, | ||
| api_key_env=model_backend.auth_source if model_backend else None, |
There was a problem hiding this comment.
Preserve separate Ask and Wiki model routes
When a user configures separate backends with CODENIB_DEMO_MODEL for Ask and CODENIB_DEMO_WIKI_MODEL for generated Wiki prose, _model_backend_for_args() intentionally resolves the wiki override first, but this call writes that resolved value back into prepare_local_wiki as the main model/model_api_base. prepare_local_wiki then persists it as model and exports CODENIB_DEMO_MODEL, so the launched app sends Ask traffic to the wiki-only backend and ignores the configured Ask model/endpoint. Keep the wiki route separate instead of materializing it into the Ask model fields.
Useful? React with 👍 / 👎.
| provider=provider, | ||
| model=model, | ||
| endpoint=endpoint, | ||
| dimension=dimension, |
There was a problem hiding this comment.
Forward OpenAI dimension overrides
When --embedding-provider openai uses text-embedding-3-small and the caller supplies a smaller --embedding-dimension such as 512, this records 512 as the expected artifact dimension but never sends the OpenAI dimensions request option. The SDK therefore requests the model default width (1536), so the build/probe fails dimension validation instead of producing the requested vector width; pass the matching compatibility option for OpenAI dimension overrides or reject that combination up front.
Useful? React with 👍 / 👎.
| return | ||
|
|
||
|
|
||
| def test_openai_semantic_build_uses_remote_sdk_without_sentence_transformers( |
There was a problem hiding this comment.
Move remote semantic smoke out of the unit tier
This new test is unmarked, so it runs in the unit tier, but it spins up a ThreadingHTTPServer and exercises a real remote semantic build through the OpenAI SDK/FAISS rather than pure logic/mocks. That makes the unit job depend on a local listener and semantic runtime cost; mark it for a heavier tier or mock the vector build to keep unit CI deterministic. test/CLAUDE.mdL8-L14
Useful? React with 👍 / 👎.
| endpoint=endpoint, | ||
| dimension=dimension, | ||
| credential_env=credential_env, |
There was a problem hiding this comment.
Don't attach OpenAI keys to unauthenticated embedding endpoints
When a caller selects a custom --embedding-endpoint but omits --embedding-api-key-env because that endpoint is intentionally unauthenticated, this resolver still runs against the real process environment, so an existing OPENAI_API_KEY is auto-selected and forwarded to the BYO endpoint. That leaks an unrelated provider credential to local or third-party embedding servers; suppress the default OpenAI env fallback for explicit custom endpoints unless the user explicitly opts into a credential source.
Useful? React with 👍 / 👎.
Summary
Expose the secret-safe local and BYO inference contract from #420 through CodeNib's CLI, local Wiki, doctor diagnostics, optional dependencies, and documentation.
#420 is merged. This PR is now independently reviewable against
mainand advances #419.Changes
Type of Change
Testing
Tests pass locally
Added new tests for the changes
full unit tier: 2584 passed, 10 skipped, 183 deselected
focused CLI/provider suite: 79 passed before restack; 55 changed-surface tests passed after restack
strict MkDocs build
pre-commit run --all-files
Checklist