feat(pair): add opt-in CLI prompts for agent pairing - #10889
Conversation
Let users try CLI-based pairing with MARIMO_PAIR_NEXT while preserving existing skill prompts by default. Keep prompt wording in a bundled template so the browser can share it in a follow-up change. Include optional session context and refer to the existing private token file directly, so authenticated commands do not need the token in argv.
Prefer the notebook file when selecting a live session so page reloads do not leave agents using an old session ID. Explain when to use a session instead, how to discover the intended notebook, and which failures must not cause a switch to another session. Keep execution precedence unchanged and make the code-mode preference explicit in the help.
State when to select a notebook by file and name the cell operations covered by the code-mode preference. Explicit conditions and actions reduce the interpretation required from models while retaining the brief reason for resolving the current session by file.
Share the Python-owned prompt template and launcher through optional page configuration so the CLI and all four Pair tabs stay in sync. Include known notebook files and session context, preserve token handling, and format copied commands across readable lines while keeping the legacy flow as the default.
Confirm token-file support in the first help response so agents do not need a second help call before authenticated execution. State which commands accept the path and how MARIMO_TOKEN supplies authentication when no file is given.
Let users with MARIMO_TOKEN already set leave the token prompt empty. Skipping creates no token file and leaves existing files untouched, so commands retain the environment fallback instead of receiving an unnecessary file override.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
All contributors have signed the CLA ✍️ ✅ |
Bundle ReportChanges will decrease total bundle size by 82.51kB (-0.31%) ⬇️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: marimo-esmAssets Changed:
Files in
Files in
|
There was a problem hiding this comment.
🟡 Changes recommended
Legacy prompts can emit mutually exclusive --file and --session selectors, causing generated commands to fail.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds opt-in CLI-based pairing previews while preserving the existing skill flow when disabled.
Changes:
- Shares pairing templates and configuration between backend and frontend.
- Adds file/session-aware commands, token handling, and help guidance.
- Updates pairing UI and comprehensive tests.
File summaries
| File | Summary |
|---|---|
tests/_server/templates/test_templates_api.py |
Tests preview configuration. |
tests/_cli/test_cli_pair.py |
Tests pairing prompts, tokens, and preview behavior. |
marimo/_templates.py |
Injects preview configuration. |
marimo/_cli/pair/prompts.py |
Loads and renders prompt templates. |
marimo/_cli/pair/prompt.json |
Defines shared prompt text. |
marimo/_cli/pair/commands.py |
Adds preview mode, session handling, and token behavior; legacy prompts may emit incompatible selectors. |
frontend/src/mount.tsx |
Hydrates preview configuration. |
frontend/src/core/config/pair.ts |
Defines preview configuration state. |
frontend/src/components/editor/actions/pair-with-agent-modal.tsx |
Displays preview and legacy pairing workflows. |
frontend/src/components/editor/actions/pair-with-agent-commands.ts |
Generates pairing commands and prompts. |
frontend/src/components/editor/actions/__tests__/pair-with-agent-modal.test.tsx |
Tests modal behavior. |
frontend/src/components/editor/actions/__tests__/pair-with-agent-commands.test.ts |
Tests command generation. |
frontend/src/__tests__/mount.test.ts |
Tests configuration hydration. |
frontend/src/__tests__/fixtures/pair-preview.ts |
Provides shared preview test data. |
Review details
- Files reviewed: 14/14 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Coverage Report for ./frontend
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The legacy execute-code.sh rejects commands containing both --file and --session. Prefer an explicit session, matching pair execute, so prompts remain usable when the preview flag is disabled. Cover both the execution command and its token hint across disabled flag values.
There was a problem hiding this comment.
Review completed against the latest diff
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
📝 Summary
Add
MARIMO_PAIR_NEXT=1to opt into CLI-based pairing frompair promptand all four Pair tabs. The preview skips skill installation and directs agents tomarimo pair --help. Keep the existing skill flow when the flag is off.Share the prompt template and launcher through page configuration. Include the known notebook file and current session, format terminal commands across multiple lines, and teach file-first selection so agents can reconnect after a page reload.
Explain
--token-fileandMARIMO_TOKENin basic help. Allow an empty token entry to skip file creation and retain the environment fallback. Preserve hidden token entry, private token files, and raw-prompt token masking.The preview uses local
uv run marimo; switching touvx marimo@latestremains a separate change after publication. Follow-up to #10777.