marimo icon indicating copy to clipboard operation
marimo copied to clipboard

markdown cells not enabled when RTC flag is on

Open robd518 opened this issue 7 months ago • 3 comments

Describe the bug

Steps to reproduce

  1. Create a cell
  2. Change its type to Markdown
  3. Add md content
  4. save notebook
  5. close / power off notebook
  6. re-open notebook
  7. notice that the md cell has changed its type back to a normal cell

Environment

{
  "marimo": "0.12.6",
  "OS": "Linux",
  "OS Version": "6.8.0-52-generic",
  "Processor": "",
  "Python Version": "3.13.1",
  "Binaries": {
    "Browser": "--",
    "Node": "--"
  },
  "Dependencies": {
    "click": "8.1.8",
    "docutils": "0.21.2",
    "itsdangerous": "2.2.0",
    "jedi": "0.19.2",
    "markdown": "3.7",
    "narwhals": "1.34.1",
    "packaging": "24.2",
    "psutil": "7.0.0",
    "pygments": "2.19.1",
    "pymdown-extensions": "10.14.3",
    "pyyaml": "6.0.2",
    "ruff": "0.11.4",
    "starlette": "0.46.1",
    "tomlkit": "0.13.2",
    "typing-extensions": "4.13.1",
    "uvicorn": "0.34.0",
    "websockets": "15.0.1"
  },
  "Optional Dependencies": {
    "altair": "5.5.0",
    "duckdb": "1.2.2",
    "pandas": "2.2.3",
    "polars": "1.26.0",
    "pyarrow": "19.0.1"
  },
  "Experimental Flags": {
    "inline_ai_tooltip": true,
    "rtc_v2": true,
    "toplevel_defs": false
  }
}

Code to reproduce

No response

robd518 avatar Apr 09 '25 19:04 robd518

I was not able to reproduce this. Is this because you have the rtc_v2 feature-flag enabled?

mscolnick avatar Apr 09 '25 22:04 mscolnick

I will turn that off and give it a shot and report back here.

Edit: I've done a few things to test this behavior, both with and without the rtc_v2 flag flipped on. Both of these tests

rtc_v2 flag is turned off Test 1

  1. Create a new cell (code, by default)
  2. Type markdown content in cell
  3. Convert cell type to markdown
  4. Save -> close -> reopen
  5. cell type reverts back to the code type

Test 2

  1. create new cell
  2. change cell type to markdown
  3. type markdown content in cell
  4. save -> close -> reopen
  5. cell type stays as markdown

rtc_v2 flag is turned on

  • Test 1 results in the same behavior
  • Test 2 is no longer the case and exhibits weird consistency behavior (i.e. - what I've typed is not what is saved). <-- if it's helpful, the console starts showing [E 250410 14:25:53 formatter:45] Failed to format code with ruff errors after this. I don't know if it's related though

Regardless, I'll turn the rtc_v2 flag off but am wondering if anyone else is able to reproduce

robd518 avatar Apr 10 '25 13:04 robd518

I am seeing the same behavior. I can reproduce on 0.13.2. Looking at the notebook on disk, the mo.md(...) is not written to some cells on save. I can't identify any rhyme or reason to which cells stay as markdown and which do not, but I would be glad to try any different scenarios to help track it down. My config:

[completion]
activate_on_typing = true
copilot = "github"

[diagnostics]
enabled = true

[language_servers.pylsp]
enable_flake8 = false
enable_pydocstyle = false
enabled = true
enable_ruff = true
enable_pyflakes = false
enable_pylint = false
enable_mypy = true

[package_management]
manager = "uv"

[experimental]
lsp = true

[save]
autosave = "after_delay"
format_on_save = true
autosave_delay = 1000

[snippets]
custom_paths = []
include_default_snippets = true

[formatting]
line_length = 79

[runtime]
watcher_on_save = "lazy"
auto_instantiate = true
output_max_bytes = 8000000
auto_reload = "off"
on_cell_change = "autorun"
reactive_tests = true
std_stream_max_bytes = 1000000

[server]
follow_symlink = false
browser = "default"

[display]
dataframes = "rich"
code_editor_font_size = 14
default_table_page_size = 10
cell_output = "below"
theme = "system"
default_width = "medium"

[keymap]
preset = "default"
[keymap.overrides]

[ai]
rules = ""

[ai.anthropic]

[ai.google]

[ai.open_ai]

agentjsmith avatar Apr 24 '25 19:04 agentjsmith

Hey all, we released a new version of RTC that uses Loro instead of y-js, it is still behind a feature flag but with a lot more reliability than before.

Please check it out and let me know your feedback. Going to close this issue for now - but please open new ones with other issues or enhancements to RTC

mscolnick avatar May 14 '25 22:05 mscolnick