Skip to content

feat(cli): expose local and BYO provider routes - #421

Merged
fishmingyu merged 3 commits into
mainfrom
feat/provider-integration
Aug 5, 2026
Merged

feat(cli): expose local and BYO provider routes#421
fishmingyu merged 3 commits into
mainfrom
feat/provider-integration

Conversation

@fishmingyu

@fishmingyu fishmingyu commented Aug 5, 2026

Copy link
Copy Markdown
Member

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 main and advances #419.

Changes

  • Add local Hugging Face and BYO OpenAI-compatible embedding flags to index, wiki, and doctor
  • Keep fast and graph commands independent of unused embedding configuration
  • Reopen vector views from manifest-authoritative identities and reject incompatible overrides
  • Add provider-aware dependencies plus redacted model and embedding probes
  • Deliver credentials only through process-local runtime state
  • Verify a real remote semantic build through a local OpenAI-compatible server
  • Reject retired GitHub Models aliases instead of targeting an unavailable endpoint
  • Document provider selection, compatibility identity, and static-export credential boundaries

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Refactoring
  • Performance improvement
  • Tests

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

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented code where the behavior is not self-explanatory
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

@fishmingyu
fishmingyu force-pushed the feat/provider-integration branch 2 times, most recently from aadc981 to eba6732 Compare August 5, 2026 08:17
@github-actions github-actions Bot added type/docs Documentation type/test Test-related type/chore Build, CI, dependency updates labels Aug 5, 2026
Base automatically changed from feat/provider-routes to main August 5, 2026 08:38
@fishmingyu
fishmingyu force-pushed the feat/provider-integration branch from eba6732 to d9fe4fe Compare August 5, 2026 08:38
@fishmingyu
fishmingyu marked this pull request as ready for review August 5, 2026 08:39
Copilot AI lite review requested due to automatic review settings August 5, 2026 08:39

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@fishmingyu fishmingyu changed the title feat(cli): expose hosted inference routes feat(cli): expose local and BYO provider routes Aug 5, 2026
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.
@fishmingyu
fishmingyu force-pushed the feat/provider-integration branch from d9fe4fe to a8fe561 Compare August 5, 2026 08:41
Copilot AI review requested due to automatic review settings August 5, 2026 08:41

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@fishmingyu
fishmingyu merged commit 560462b into main Aug 5, 2026
4 of 5 checks passed
@fishmingyu
fishmingyu deleted the feat/provider-integration branch August 5, 2026 08:41

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 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".

Comment thread codenib/cli.py
Comment on lines +687 to +689
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,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment thread codenib/cli.py
provider=provider,
model=model,
endpoint=endpoint,
dimension=dimension,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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(

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Comment thread codenib/cli.py
Comment on lines +119 to +121
endpoint=endpoint,
dimension=dimension,
credential_env=credential_env,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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

Labels

type/chore Build, CI, dependency updates type/docs Documentation type/test Test-related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants