Skip to content

Add model display names to hide real model IDs in public shares - #1097

Open
charlesyhuang wants to merge 7 commits into
stagingfrom
feat/model-presentation-names
Open

Add model display names to hide real model IDs in public shares#1097
charlesyhuang wants to merge 7 commits into
stagingfrom
feat/model-presentation-names

Conversation

@charlesyhuang

@charlesyhuang charlesyhuang commented Aug 6, 2026

Copy link
Copy Markdown
Collaborator

Adds a new "Model names" admin panel for operators to map stored model IDs to presentation names. Public share pages render the presentation name instead of the real model ID, while internal authenticated views and cost calculations continue to use the real ID unchanged.

🤖 Generated with Claude Code


Note

Medium Risk
Changes what anonymous share viewers see for model identifiers and adds operator-only admin mutations, but aliases are applied only after pricing and are designed to fail open if the table is missing.

Overview
Introduces operator-managed model display names so published share pages can show a friendly label instead of the real model id, while internal views, cost accounting, and queue routing keep the stored id.

A new model_display_names table (soft-delete, one live row per canonical model key) backs a FastAPI admin router at /admin/model-display-names (operator org + org admin to mutate). Writes canonicalize model keys; missing schema during deploy returns 503 on admin and degrades to real ids on public reads.

Public share paths load aliases and run apply_model_display_names on already-built TrialResponse objects (after cost resolution), rewriting model and matching queue_key segments. Org-scoped trial lists are unchanged.

The admin UI gains an operator-only Model Names tab with list/add/edit/remove, proxied through Next.js API routes. Tests cover alias behavior, cost invariance, canonical keys, and deploy-before-migrate safety.

Reviewed by Cursor Bugbot for commit 33e65aa. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
oddish-app Ready Ready Preview Aug 6, 2026 11:33pm

charlesyhuang and others added 2 commits August 6, 2026 11:38
Adds a "Model names" admin pane where operators map a stored model id to
the name public share pages show. The alias is applied at the public
serialization boundary only -- the authenticated dashboard, cost accounting
and queue routing keep reading the real model id.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Comment thread oddish/src/oddish/core/model_display_names.py

@cursor cursor 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.

Risk: medium. Left a non-blocking comment — Cursor Bugbot reported an unresolved high-severity finding (public shares can 500 pre-migration), and the Bugbot check completed as skipping, so this is not approved. Human review is needed; reviewers are already assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

main advanced past the original base, leaving two alembic heads. Re-point
down_revision at trajgraph_002 so the tree stays linear.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@charlesyhuang
charlesyhuang force-pushed the feat/model-presentation-names branch from ed92c83 to bd13a55 Compare August 6, 2026 18:51
Comment thread backend/api/routers/model_display_names.py
@charlesyhuang

Copy link
Copy Markdown
Collaborator Author

bugbot run

@cursor cursor 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.

✅ Bugbot reviewed your changes and found no new issues!

1 issue from previous review remains unresolved.

Fix All in Cursor

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit bd13a55. Configure here.

Two Bugbot findings. load_model_display_names now reads inside a savepoint
and degrades to real model ids when model_display_names does not exist yet,
so the deploy-before-migrate window no longer 500s published share pages;
any other SQL fault still surfaces. Writers canonicalize model_name so the
case-sensitive live UNIQUE index cannot hold two rows that the
case-insensitive public lookup would disagree about.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@charlesyhuang

Copy link
Copy Markdown
Collaborator Author

bugbot run

@cursor cursor 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.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 62666cb. Configure here.

@charlesyhuang
charlesyhuang changed the base branch from main to staging August 6, 2026 22:30

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 28e4c53. Configure here.

Comment thread oddish/alembic/versions/modeldisp01_add_model_display_names.py Outdated
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Oddish preview

Commit: 33e65aa73462520f4968216868d38562c9149d45

Surface Link Target
Frontend https://pr-1097.oddish.app Vercel preview for 33e65aa
Backend oddish-pr-1097 oddish-pr-1097
Database project vupihdmftkiofiizrvao project vupihdmftkiofiizrvao

Vercel deployment URL: https://oddish-4fnufzulr.oddish.app

Plan:

  • Frontend deploy: true
  • Backend deploy: true
  • Migrations: true

This comment is updated by the PR Preview workflow.

@github-actions
github-actions Bot had a problem deploying to Preview August 6, 2026 23:06 Failure
Staging landed trial_facets_001 on the same parent (trajgraph_002), so
merging staging forked the alembic tree into two heads. That broke the
Migration Head Guard and, downstream, the preview bootstrap, which runs
`alembic upgrade head` and aborts on an ambiguous head.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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