Skip to content

Ignore inherited provider and Bot registry entries - #697

Merged
davidmckayv merged 2 commits into
CopilotKit:mainfrom
charan-rathore:fix-registry-own-property
Oct 2, 2026
Merged

davidmckayv merged 2 commits into
CopilotKit:mainfrom
charan-rathore:fix-registry-own-property

Conversation

@charan-rathore

Copy link
Copy Markdown
Contributor

What this changes

shared/model-providers.ts uses plain objects as registries. Looking up constructor or __proto__ can return an inherited object rather than a configured row. botSettings("__proto__", {}) returns undefined provider/model fields instead of the existing missing-Bot error.

Require an own property before reading either registry. Unknown providers return undefined, and missing Bot names throw the existing startup error. Defaults, normalization, environment overrides, and registered entries keep their existing behavior. This is a small correctness fix, not a claim of exploitable prototype pollution. No issue was filed.

Where it runs

  • New state that outlives a request: none. The existing read-only registries are unchanged.
  • Second replica: performs the same own-property check against its checked spec file and returns the same result.
  • Anything serialised: no writes or coordination added.
  • Browser fan-out: none.
  • New listener, port, or schedule: none.

Boundary and audit

  • Acting calls: none added; gateway behavior unchanged.
  • Refusals/failures: uses the existing configuration error, before a Bot starts. No request-level action or new audit path.
  • Client trust: none added.

Changelog

  • Added an Unreleased note describing corrected unknown-name behavior.

Proof

Bun 1.3.14, fresh main, frozen root dependency install, and the repository's normal test preloads:

  • New regressions on unchanged implementation: 28 pass, 2 fail.
  • Patched bun test ./shared/model-providers.test.ts: 30 pass, 0 fail, 93 assertions.
  • Full bun run lint and bun run format:check: pass.
  • Full bun run test:ci: attempted twice, timed out at 65 and 110 seconds. A direct bun run test also timed out at 55 seconds; no full-suite pass claimed.
  • Workspace typecheck: worker passed; app/server were killed (exit 137). Separate server typecheck exhausted Node's heap (exit 134). No full typecheck pass claimed.
  • Build: attempted, worker passed, server killed; overall command timed out at 35 seconds. No full build pass claimed.
  • Database integration, live providers, browser deployment and platform checks were not verified. No dedicated test PostgreSQL instance was configured.

davidmckayv
davidmckayv previously approved these changes Oct 2, 2026
@davidmckayv
davidmckayv enabled auto-merge (squash) October 2, 2026 03:56
auto-merge was automatically disabled October 2, 2026 05:16

Head branch was pushed to by a user without write access

@charan-rathore
charan-rathore force-pushed the fix-registry-own-property branch from 3e851e5 to 02362e1 Compare October 2, 2026 05:16
@charan-rathore

Copy link
Copy Markdown
Contributor Author

Refreshed onto latest main. The CHANGELOG conflict is resolved. I re-ran only the changed test file locally (shared/model-providers.test.ts, 30 pass); CI will cover the rest.

davidmckayv
davidmckayv previously approved these changes Oct 2, 2026

@davidmckayv davidmckayv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The current head 02362e1 matches the accepted source disposition from the refreshed triage. Required CI must pass before landing.

@davidmckayv
davidmckayv enabled auto-merge (squash) October 2, 2026 16:52
@davidmckayv
davidmckayv merged commit f12836d into CopilotKit:main Oct 2, 2026
@charan-rathore
charan-rathore deleted the fix-registry-own-property branch October 2, 2026 18:33
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.

2 participants