Skip to content

feat: add host-owned chat model SDK facade - #695

Merged
danny-avila merged 2 commits into
mainfrom
danny-avila/host-model-service
Nov 17, 2026
Merged

danny-avila merged 2 commits into
mainfrom
danny-avila/host-model-service

Conversation

@danny-avila

Copy link
Copy Markdown
Collaborator

Remote SDK graphs need to use the host's configured model so builder settings, credentials and model-bound protections can remain authoritative. HostChatModel adds a native LangChain facade over a versioned host model service, preserving assistant chunks, reasoning, tool fragments, usage and provider metadata.

The facade snapshots execution identity and approved schemas, restricts tool binding to those schemas, normalizes tool choice, supports nonstreaming models, forwards cancellation and requests stream cleanup. Unexpected host errors are sanitized; no automatic retry can duplicate an ambiguous provider request. Host callbacks stay on the actual model and worker callbacks remain local.

SDK graph → HostChatModel → authenticated HostModelService
                                 ↓
                    host-configured provider model

This completes the SDK consumer contract, not the LibreChat host adapter. The documented next integration must authenticate and authorize each call, enforce shared admission/deadlines/queue bounds, preserve native messages across transport, and bind builder policy/accounting. Protected saved-agent guards remain necessary. Non-function provider tools, dynamic schema changes and child/fallback model authorization require explicit integration. See docs/host-model.md for the boundary and parity requirements.

Validation: 36 new model tests, including a real SDK graph and native tool loop; 302 tests passed across the model/harness/provider-registry/tracing suites before the final additional stream-cleanup case; TypeScript, scoped ESLint, CJS/ESM/declaration build, and circular-dependency checks pass. No package version change; SDK release remains a separate commit/PR. Independent of release PR #694.

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current PR head 381f658. Confirm that this exact commit is the reviewed commit and ignore findings that apply only to earlier heads.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T00:45:27.901576Z 2a034ce Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 381f6584d2

ℹ️ 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".

Copy link
Copy Markdown
Collaborator Author

@codex review

Please review the current PR head 2a034ce. Confirm that this exact commit is the reviewed commit and ignore findings that apply only to earlier heads.

The follow-up isolates the test's runtime provider fixture instead of augmenting the global provider-options union. Both Bun's CI typechecker and TypeScript now pass; all 36 model tests pass.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Chef's kiss.

Reviewed commit: 2a034ce216

ℹ️ 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".

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