Skip to content

[WRONG BRANCH] fix(dashboard): safely group prototype-named providers - #231

Closed
luvs01 wants to merge 1 commit into
mainfrom
codex/fix-dashboard-grouping-prototype-vulnerability
Closed

[WRONG BRANCH] fix(dashboard): safely group prototype-named providers#231
luvs01 wants to merge 1 commit into
mainfrom
codex/fix-dashboard-grouping-prototype-vulnerability

Conversation

@luvs01

@luvs01 luvs01 commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Motivation

  • The Dashboard grouped models by provider using a plain object keyed by provider, which crashes when a provider name is an Object-prototype property (e.g. __proto__, constructor, toString).

Description

  • Replace the unsafe object accumulator with a Map-based helper groupDashboardModels and use it from useDashboardData so arbitrary provider names cannot collide with Object.prototype.
  • Add a focused regression test gui/tests/dashboard-model-grouping.test.ts that verifies grouping works for __proto__, constructor, and toString, including multiple models under the same provider.
  • This is an availability fix only and does not change UI appearance or i18n keys (screenshot: not applicable).

Testing

  • Ran cd gui && bun test tests/dashboard-model-grouping.test.ts, and the new test passed.
  • Ran cd gui && bun test tests; the new regression passed but the environment reported unrelated pre-existing test issues (9 fake-timer failures and one node:zlib export error) that are not caused by this change.
  • Ran cd gui && bun run lint and cd gui && bun run build, both of which completed (build emitted a large-chunk advisory from Vite only), and ran bun run typecheck which completed successfully.

Codex Task

Summary by CodeRabbit

  • Bug Fixes

    • Fixed dashboard model grouping for provider names that could conflict with built-in object properties.
    • Ensured duplicate and special provider names are grouped and displayed correctly.
  • Tests

    • Added coverage for grouping models from providers with overlapping or reserved names.

@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the bug Something isn't working label Aug 9, 2026
@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: a5db5836-233a-4804-b3bc-0b0e71b6c438

📥 Commits

Reviewing files that changed from the base of the PR and between 121f1ad and f946064.

📒 Files selected for processing (2)
  • gui/src/pages/use-dashboard-data.ts
  • gui/tests/dashboard-model-grouping.test.ts

📝 Walkthrough

Walkthrough

The PR adds an exported groupDashboardModels helper, updates dashboard grouping to use it, and adds regression coverage for provider names that overlap object prototype properties.

Changes

Dashboard model grouping

Layer / File(s) Summary
Provider grouping helper
gui/src/pages/use-dashboard-data.ts:71-80
Adds exported groupDashboardModels(models: ModelInfo[]): Array<[string, ModelInfo[]]>. The helper groups models with Map and sorts provider entries by name.
Dashboard integration and regression test
gui/src/pages/use-dashboard-data.ts:449, gui/tests/dashboard-model-grouping.test.ts:1-17
The dashboard uses the helper in its memoized grouping path. The test verifies separate and duplicate groups for __proto__, constructor, and toString providers.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: ingwannu, wibias

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the Dashboard fix for safely grouping providers with prototype-related names, which is the main change in the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-dashboard-grouping-prototype-vulnerability

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot changed the title fix(dashboard): safely group prototype-named providers [WRONG BRANCH] fix(dashboard): safely group prototype-named providers Aug 9, 2026
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown

⏳ DRAFT

  • wrong target branch (main); retarget to dev. UI screenshot required.

What to do

  • Retarget this PR to dev — all contributions go to dev.
  • Add a screenshot of the UI change to the PR description.

Its title has been prefixed with [WRONG BRANCH].
This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.

@github-actions
github-actions Bot marked this pull request as draft August 9, 2026 10:02
@luvs01 luvs01 closed this Aug 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

aardvark bug Something isn't working codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant