Skip to content

Commit d56b330

Browse files
authored
Merge pull request #2140 from mito-ds/dev
Release Jan 7, 2026
2 parents 6c97da6 + 9a3a028 commit d56b330

File tree

86 files changed

+2791
-1379
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

86 files changed

+2791
-1379
lines changed

evals/agent_evals/agent_testing_utils.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,21 @@ def process_notebook_update(notebook, cell_update):
1515
source=code)
1616

1717
if update_type == "new":
18-
index = cell_update["index"]
19-
notebook.cells.insert(index, new_cell)
18+
after_cell_id = cell_update.get("after_cell_id")
19+
if after_cell_id == "new cell":
20+
# Insert at the very top of the notebook
21+
notebook.cells.insert(0, new_cell)
22+
else:
23+
# Find the cell by ID and get its index
24+
target_cell_index = None
25+
for i, cell in enumerate(notebook.cells):
26+
if cell.get("id") == after_cell_id:
27+
target_cell_index = i
28+
break
29+
if target_cell_index is None:
30+
raise ValueError(f"Cell with ID {after_cell_id} not found in notebook")
31+
# Insert after the target cell
32+
notebook.cells.insert(target_cell_index + 1, new_cell)
2033
elif update_type == "modification":
2134
target_cell_id = cell_update["id"]
2235
for cell in notebook.cells:

evals/agent_evals/eval_metrics.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,18 @@ def check_cell_addition_index(self, input_params):
214214
response = self.immediate_next_response
215215
expected_cell_index = input_params["index_expecting_change"]
216216
if response["type"] == "cell_update" and response["cell_update"]["type"] == "new":
217-
return response["cell_update"]["index"] == expected_cell_index
217+
after_cell_id = response["cell_update"].get("after_cell_id")
218+
219+
# If expecting cell at index 0, after_cell_id should be 'new cell'
220+
if expected_cell_index == 0:
221+
return after_cell_id == "new cell"
222+
223+
# Otherwise, find the cell ID at (expected_cell_index - 1) in the input notebook
224+
if expected_cell_index > 0 and expected_cell_index - 1 < len(self.input_nb.cells):
225+
expected_after_cell_id = self.input_nb.cells[expected_cell_index - 1].get("id")
226+
return after_cell_id == expected_after_cell_id
227+
228+
return False
218229
return False
219230

220231
def test_correct_cell_edit(self, input_params):

mito-ai/.cursorrules

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Cursor Rules for mito-ai Development
2+
3+
## Jupyter Lab Access Token
4+
5+
When testing Jupyter extension changes, use the token from `.cursor-jupyter-token` file.
6+
7+
The Jupyter Lab URL format is:
8+
```
9+
http://localhost:8888/lab?token={token}
10+
```
11+
12+
To get the token, read it from `.cursor-jupyter-token` in the repo root.
13+
14+
**Important**:
15+
1. This token configuration is development-only and will not affect production installations.
16+
The dev config file (`jupyter-config/jupyter_server_config.d/mito_ai_dev.json`) is gitignored.
17+
2. If the token is not there, tell the user to run dev/setup_jupyter_dev_token.py and relaunch Jupyter Lab.

mito-ai/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,7 @@ dmypy.json
127127
# Secrets
128128
.env
129129
secrets.tsx
130+
131+
# Development-only Jupyter config (contains fixed token for Cursor testing)
132+
jupyter-config/jupyter_server_config.d/mito_ai_dev.py
133+
.cursor-jupyter-token

mito-ai/CLAUDE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ jlpm build
2424
jupyter labextension develop . --overwrite
2525
jupyter server extension enable --py mito_ai
2626

27+
# (Optional) Setup fixed Jupyter token for Cursor agent testing
28+
# This creates a development-only config that allows Cursor to automatically test changes
29+
python dev/setup_jupyter_dev_token.py
30+
2731
# Start development environment
2832
jlpm watch # Terminal 1: auto-rebuild frontend
2933
jupyter lab --autoreload # Terminal 2: run JupyterLab with backend hot reload

mito-ai/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ jupyter labextension develop . --overwrite
7777
# Start the jupyter server extension for development
7878
jupyter server extension enable --py mito_ai
7979

80+
# (Optional) Setup fixed Jupyter token for Cursor agent testing
81+
# This creates a development-only config that allows Cursor to automatically test changes
82+
python dev/setup_jupyter_dev_token.py
83+
8084
# Watch the source directory in one terminal, automatically rebuilding when needed
8185
# In case of Error: If this command fails because the lib directory was not created (the error will say something like
8286
# unable to find main entry point) then run `jlpm run clean:lib` first to get rid of the old buildcache

mito-ai/dev/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Mito AI Dev Scripts
22

3+
### View Chat History
4+
5+
A Streamlit app that helps you explore the chat history of a Mito AI chat file.
6+
7+
```bash
8+
streamlit run dev/chat_history_viewer.py
9+
```
10+
311
### Generate AI Chats
412

513
A simple script that creates a bunch of fake Mito AI chat files so you can quickly generate a fully populated chat history.

0 commit comments

Comments
 (0)