Skip to content

Expose contextual model discovery in Node.js and Rust - #2398

Draft
andysalerno wants to merge 4 commits into
mainfrom
andysalerno/hydrafusion-model-discovery
Draft

Expose contextual model discovery in Node.js and Rust#2398
andysalerno wants to merge 4 commits into
mainfrom
andysalerno/hydrafusion-model-discovery

Conversation

@andysalerno

@andysalerno andysalerno commented Aug 25, 2026

Copy link
Copy Markdown

Summary

  • regenerate the Node.js and Rust RPC contracts for the versioned pre-session models.list context from github/copilot-agent-runtime#16938
  • expose the contextual resolution acknowledgment and experimental model picker category in both generated clients
  • leave the cached high-level listModels() APIs unchanged for backward compatibility

Compatibility

  • old SDK clients continue sending legacy models.list requests to new runtimes
  • new clients can use the generated low-level RPC API with sessionContext and require the resolution acknowledgment
  • new clients remain safe with old runtimes because an absent acknowledgment means contextual discovery was not applied
  • contextual results bypass the high-level account-scoped model cache

GitHub App integration

The coordinated app change is github/github-app#13556. It vendors compatibility commit 3b2019f05e3a8455541e3fd2778748216ed2ea24, which applies only this generated contract to the SDK revision the app already consumed. That commit is included in this PR's ancestry.

This avoids coupling HydraFusion discovery to the roughly 20 newer SDK commits currently on this branch, which would otherwise force the app through an unrelated permissions/API migration. The PR's final tree still contains the current generated Node.js and Rust contract updates.

Validation

  • npm --prefix nodejs run typecheck
  • npm --prefix nodejs test -- test/typescript-codegen.test.ts
  • npx prettier --check src/generated/rpc.ts
  • cargo check --manifest-path rust/Cargo.toml
  • cargo fmt --manifest-path rust/Cargo.toml -- --check
  • cargo test --manifest-path rust/Cargo.toml --lib

Dependency

Draft until github/copilot-agent-runtime#16938 lands and the generated contract can be refreshed from a published runtime package.

Regenerate the public RPC types for the versioned pre-session models.list context and resolution acknowledgment introduced by github/copilot-agent-runtime#16938.

Keep the cached listModels API unchanged so existing callers preserve legacy behavior.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

This comment has been minimized.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

This comment has been minimized.

@andysalerno andysalerno changed the title Node.js: expose contextual model discovery Expose contextual model discovery in Node.js and Rust Aug 25, 2026
andysalerno and others added 2 commits August 25, 2026 12:53
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Cross-SDK Consistency Review

This PR updates the auto-generated RPC contracts for Node.js and Rust, adding:

  1. experimental variant to ModelPickerCategory enum
  2. New ModelsListPreSessionContext input type (with sessionContext field on ModelsListRequest)
  3. New ModelsListResolution / ModelsListResolutionMode response type (with resolution field on ModelList/ModelsListResult)

The following SDKs have not been updated and are now behind the Node.js/Rust contracts:

SDK ModelPickerCategory.experimental ModelsListRequest.sessionContext ModelList.resolution
Python (python/copilot/generated/rpc.py) ❌ missing ❌ missing ❌ missing
Go (go/rpc/zrpc.go) ❌ missing ❌ missing ❌ missing
.NET (dotnet/src/Generated/Rpc.cs) ❌ missing ❌ missing ❌ missing
Java (java/sdk/src/generated/java/.../ModelPickerCategory.java) ❌ missing ❌ missing ❌ missing

Since these are all auto-generated files driven by the same upstream schema (api.schema.json), the fix is to re-run each SDK's code generation once the schema is updated. The PR description notes it is draft, pending github/copilot-agent-runtime#16938 — that dependency likely gates the schema update, so the other SDKs could be regenerated in this same PR (or a follow-up) once the schema lands.

Suggested action before merging: regenerate the Python, Go, .NET, and Java RPC contracts from the updated schema so all six SDKs expose the new experimental category, sessionContext input, and resolution acknowledgment consistently.

Generated by SDK Consistency Review Agent for #2398 · sonnet46 34.6 AIC · ⌖ 5.51 AIC · ⊞ 6.6K ·

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