Jupyter-ai - Is this the best way for codex to open a .py file?

I asked Jupyter-AI Codex to review my code. It gave suggestions and clickable links to the files, which did not work.

After asking it to “do better” a few times, it came up with the below. (I had codex update AGENTS.md with the instructions it had figured out.) I’m wondering if there is a better way to tell codex how to open a .py file and move the editor cursor to a specific line. I would prefer that the clickable links appear in the codex chat window for me to click, rather than as pop-up notifications.


When giving clickable file references to a user in JupyterLab, do not use
markdown links to absolute paths, /lab/tree/... URLs, or path:line hrefs.
Those either 404, reload JupyterLab, open a new browser tab, or resolve
relative to the wrong working directory.

Instead, create JupyterLab notification actions that open files inside the
current JupyterLab session. Use exactly one action button per notification,
because JupyterLab dismisses a notification after its action runs. For multiple
review locations, create multiple notifications so the remaining file buttons
stay available after one is clicked.

{
  "command_id": "apputils:notify",
  "args": {
    "message": "feature_store_main.py:14",
    "type": "info",
    "options": {
      "autoClose": false,
      "actions": [
        {
          "label": "feature_store_main.py",
          "commandId": "docmanager:open",
          "args": {
            "path": "jds-pipeline/jds_pipeline/features/feature_store_main.py"
          }
        }
      ]
    }
  }
}

Use the path relative to the Jupyter server root, such as
jds-pipeline/jds_pipeline/features/feature_store_main.py, not the shell
working directory and not an absolute filesystem path. JupyterLab’s
docmanager:open action opens the file but does not jump to a line number, so
include line numbers in the notification message and review text as plain text.

I would prefer that the clickable links appear in the codex chat window for me to click, rather than as pop-up notifications.

Not sure what you are referring to as codex chat window. Codex is a specific app, which is distinct from jupyter-ai. However, assuming that you mean jupyter-ai just with a model from OpenAI, it uses just Markdown for rendering the text and Markdown in JupyterLab is very powerful. In particular, with help of command linker you can invoke any command, including one opening a file and one scrolling to specific line.

For specific commands you could use docmanager:open, debugger:open-source, code-viewer:open for opening files/snippets and fileeditor:go-to-line for jumping to a line. You could compose the two commands with apputils:run-all-enabled.

Yes, I just mean a Jupyter-AI chat window output. But could you please “explain it like I’m 5” -
Could you give me a snippet of markdown that opens a file and runs the go-to-line command?