Skip to content

Fix: Use cell name to identify setup cells when id is null#8137

Merged
mscolnick merged 1 commit intomainfrom
ms/fix-setup-cell-in-deserialization
Feb 5, 2026
Merged

Fix: Use cell name to identify setup cells when id is null#8137
mscolnick merged 1 commit intomainfrom
ms/fix-setup-cell-in-deserialization

Conversation

@mscolnick
Copy link
Contributor

Problem

Setup cells don't appear when initializing from MARIMO_MOUNT_CONFIG because the
cell data has "id": null with "name": "setup", but the code only checked the id
field and generated random IDs instead of using SETUP_CELL_ID.

Solution

Added a getCellId() helper that checks both id and name fields:

  • If cell.id exists, use it
  • If cell.name === "setup", use SETUP_CELL_ID
  • Otherwise, generate a new random ID

**Problem**

Setup cells don't appear when initializing from __MARIMO_MOUNT_CONFIG__ because the
  cell data has "id": null with "name": "setup", but the code only checked the id
field and generated random IDs instead of using SETUP_CELL_ID.

**Solution**

Added a getCellId() helper that checks both id and name fields:
- If cell.id exists, use it
- If cell.name === "setup", use SETUP_CELL_ID
- Otherwise, generate a new random ID
@vercel
Copy link

vercel bot commented Feb 5, 2026

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

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Feb 5, 2026 4:46pm

Request Review

Comment on lines +33 to +35
if (cell.name === SETUP_CELL_ID) {
return SETUP_CELL_ID;
}
Copy link
Contributor

@Light2Dark Light2Dark Feb 5, 2026

Choose a reason for hiding this comment

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

move this before the first check? For future-proofing in case it does have id

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in case it does have an id, the id is the source of truth and needs to match the backend

@mscolnick mscolnick added the bug Something isn't working label Feb 5, 2026
@mscolnick mscolnick merged commit c41ca6f into main Feb 5, 2026
31 of 32 checks passed
@mscolnick mscolnick deleted the ms/fix-setup-cell-in-deserialization branch February 5, 2026 17:55
@github-actions
Copy link

github-actions bot commented Feb 5, 2026

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.19.8-dev34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants