Skip to content

feat(pair): add opt-in CLI prompts for agent pairing - #10889

Merged
kirangadhave merged 7 commits into
mainfrom
kg/pair-prompt-update-flag
Sep 18, 2026
Merged

kirangadhave merged 7 commits into
mainfrom
kg/pair-prompt-update-flag

Conversation

@kirangadhave

@kirangadhave kirangadhave commented Sep 17, 2026

Copy link
Copy Markdown
Member

📝 Summary

Add MARIMO_PAIR_NEXT=1 to opt into CLI-based pairing from pair prompt and all four Pair tabs. The preview skips skill installation and directs agents to marimo 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-file and MARIMO_TOKEN in 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 to uvx marimo@latest remains a separate change after publication. Follow-up to #10777.

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.
@vercel

vercel Bot commented Sep 17, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
marimo-docs Ready Ready Preview Sep 17, 2026 11:04pm UTC

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@codecov

codecov Bot commented Sep 17, 2026

Copy link
Copy Markdown

Bundle Report

Changes will decrease total bundle size by 82.51kB (-0.31%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
marimo-esm 26.45MB -82.51kB (-0.31%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: marimo-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
assets/index-*.js 691.7kB 1.33MB 108.61% ⚠️
assets/cells-*.js -15.56kB 976.85kB -1.57%
assets/terminal-*.js -10 bytes 449.38kB -0.0%
assets/edit-*.js 2.34kB 442.77kB 0.53%
assets/index-*.css 3.65kB 381.83kB 0.97%
assets/RunButton-*.js -779 bytes 366.6kB -0.21%
assets/dist-*.js 320 bytes 26.77kB 1.21%
assets/dist-*.js (Deleted) -513 bytes 0 bytes -100.0% 🗑️
assets/ai-*.js 483 bytes 315.87kB 0.15%
assets/panels-*.js -1.24kB 267.06kB -0.46%
assets/glide-*.js 4.3kB 262.12kB 1.67%
assets/reveal-*.js -148 bytes 257.8kB -0.06%
assets/dependency-*.js 1.01kB 162.35kB 0.63%
assets/agent-*.js -330 bytes 153.65kB -0.21%
assets/add-*.js -1.98kB 147.79kB -1.32%
assets/ConnectedDataExplorerComponent-*.js -143 bytes 134.73kB -0.11%
assets/swiper-*.js -15 bytes 116.58kB -0.01%
assets/file-*.js -51 bytes 113.06kB -0.05%
assets/file-*.js -325 bytes 78.44kB -0.41%
assets/file-*.js (Deleted) -805 bytes 0 bytes -100.0% 🗑️
assets/mermaid-*.js -6 bytes 92.25kB -0.01%
assets/input-*.js 3.94kB 85.56kB 4.82%
assets/chat-*.js -173 bytes 37.4kB -0.46%
assets/chat-*.js -159 bytes 16.23kB -0.97%
assets/chat-*.js -115 bytes 15.05kB -0.76%
assets/dagre-*.js -30 bytes 32.96kB -0.09%
assets/session-*.js -130 bytes 27.32kB -0.47%
assets/tooltip-*.js -32 bytes 9.57kB -0.33%
assets/select-*.js -35 bytes 25.1kB -0.14%
assets/dropdown-*.js 4 bytes 22.94kB 0.02%
assets/packages-*.js 1.15kB 18.97kB 6.42% ⚠️
assets/home-*.js -183 bytes 18.41kB -0.98%
assets/toast-*.js (New) 15.98kB 15.98kB 100.0% 🚀
assets/common-*.js -3 bytes 2.61kB -0.11%
assets/vega-*.js 1 bytes 595 bytes 0.17%
assets/vega-*.js -170 bytes 13.9kB -1.21%
assets/run-*.js 2.86kB 13.49kB 26.86% ⚠️
assets/write-*.js -3.84kB 13.1kB -22.67%
assets/graphlib-*.js 3 bytes 12.64kB 0.02%
assets/tracing-*.js -90 bytes 11.37kB -0.79%
assets/tracing-*.js -1 bytes 819 bytes -0.12%
assets/app-*.js -34 bytes 11.26kB -0.3%
assets/feedback-*.js (New) 10.6kB 10.6kB 100.0% 🚀
assets/useCellActionButton-*.js -102 bytes 9.11kB -1.11%
assets/config-*.js -43 bytes 7.76kB -0.55%
assets/command-*.js 43 bytes 8.73kB 0.5%
assets/snippets-*.js -98 bytes 7.31kB -1.32%
assets/scratchpad-*.js -130 bytes 7.03kB -1.82%
assets/alert-*.js 5.05kB 7.01kB 257.16% ⚠️
assets/alert-*.js (Deleted) -12.37kB 0 bytes -100.0% 🗑️
assets/utils-*.js (Deleted) -303 bytes 0 bytes -100.0% 🗑️
assets/components-*.js -81 bytes 5.68kB -1.41%
assets/ErrorBoundary-*.js 2.95kB 6.18kB 91.51% ⚠️
assets/use-*.js 3.9kB 5.71kB 215.42% ⚠️
assets/use-*.js (New) 1.81kB 1.81kB 100.0% 🚀
assets/cache-*.js -38 bytes 5.5kB -0.69%
assets/gallery-*.js -40 bytes 4.54kB -0.87%
assets/secrets-*.js -126 bytes 4.25kB -2.88%
assets/_baseMerge-*.js 7 bytes 3.18kB 0.22%
assets/logs-*.js -3 bytes 2.87kB -0.1%
assets/process-*.js -2 bytes 2.35kB -0.08%
assets/code-*.js (New) 2.06kB 2.06kB 100.0% 🚀
assets/any-*.js -39 bytes 1.92kB -1.99%
assets/error-*.js 81 bytes 1.86kB 4.54%
assets/error-*.js -1.21kB 1.74kB -41.01%
assets/documentation-*.js -4 bytes 899 bytes -0.44%
assets/state-*.js (Deleted) -808 bytes 0 bytes -100.0% 🗑️
assets/skeleton-*.js (New) 440 bytes 440 bytes 100.0% 🚀
assets/has-*.js -2 bytes 179 bytes -1.1%
assets/JsonOutput-*.js (Deleted) -581.38kB 0 bytes -100.0% 🗑️
assets/dates-*.js (Deleted) -38.6kB 0 bytes -100.0% 🗑️
assets/MarimoErrorOutput-*.js (Deleted) -30.48kB 0 bytes -100.0% 🗑️
assets/react-*.browser.esm-BL2E7f5c.js (Deleted) -25.58kB 0 bytes -100.0% 🗑️
assets/VisuallyHidden-*.js (Deleted) -18.2kB 0 bytes -100.0% 🗑️
assets/html-*.js (Deleted) -14.36kB 0 bytes -100.0% 🗑️
assets/switch-*.js (Deleted) -10.9kB 0 bytes -100.0% 🗑️
assets/download-*.js (Deleted) -9.07kB 0 bytes -100.0% 🗑️
assets/react-*.esm-C6SMwKZH.js (Deleted) -8.38kB 0 bytes -100.0% 🗑️
assets/en-*.js (Deleted) -7.24kB 0 bytes -100.0% 🗑️
assets/RenderHTML-*.js (Deleted) -6.3kB 0 bytes -100.0% 🗑️
assets/markdown-*.js (Deleted) -5.2kB 0 bytes -100.0% 🗑️
assets/tabs-*.js (Deleted) -4.88kB 0 bytes -100.0% 🗑️
assets/datasource-*.js (Deleted) -4.71kB 0 bytes -100.0% 🗑️
assets/emotion-*.esm-nLO-SoUf.js (Deleted) -4.37kB 0 bytes -100.0% 🗑️
assets/useInstallPackage-*.js (Deleted) -3.74kB 0 bytes -100.0% 🗑️
assets/table-*.js (Deleted) -608 bytes 0 bytes -100.0% 🗑️
assets/table-*.js (Deleted) -3.37kB 0 bytes -100.0% 🗑️
assets/tree-*.js (Deleted) -3.06kB 0 bytes -100.0% 🗑️
assets/cell-*.js (Deleted) -2.98kB 0 bytes -100.0% 🗑️
assets/useDateFormatter-*.js (Deleted) -2.72kB 0 bytes -100.0% 🗑️
assets/JsonOutput-*.css (Deleted) -1.32kB 0 bytes -100.0% 🗑️
assets/useRunCells-*.js (Deleted) -1.28kB 0 bytes -100.0% 🗑️
assets/spinner-*.js (Deleted) -1.04kB 0 bytes -100.0% 🗑️
assets/markdown-*.css (Deleted) -613 bytes 0 bytes -100.0% 🗑️
assets/eye-*.js (Deleted) -612 bytes 0 bytes -100.0% 🗑️
assets/hasIn-*.js (Deleted) -567 bytes 0 bytes -100.0% 🗑️
assets/kbd-*.js (Deleted) -529 bytes 0 bytes -100.0% 🗑️
assets/_baseSet-*.js (Deleted) -484 bytes 0 bytes -100.0% 🗑️
assets/_hasPath-*.js (Deleted) -322 bytes 0 bytes -100.0% 🗑️
assets/refresh-*.js (Deleted) -321 bytes 0 bytes -100.0% 🗑️
assets/formats-*.js (Deleted) -264 bytes 0 bytes -100.0% 🗑️
assets/external-*.js (Deleted) -251 bytes 0 bytes -100.0% 🗑️
assets/message-*.js (Deleted) -241 bytes 0 bytes -100.0% 🗑️
assets/extends-*.js (Deleted) -231 bytes 0 bytes -100.0% 🗑️
assets/isValid-*.js (Deleted) -231 bytes 0 bytes -100.0% 🗑️
assets/useIframeCapabilities-*.js (Deleted) -228 bytes 0 bytes -100.0% 🗑️
assets/ellipsis-*.js (Deleted) -226 bytes 0 bytes -100.0% 🗑️

Files in assets/index-*.js:

  • ./src/mount.tsx → Total Size: 5.8kB

  • ./src/core/config/pair.ts → Total Size: 344 bytes

Files in assets/edit-*.js:

  • ./src/components/editor/actions/pair-with-agent-modal.tsx → Total Size: 12.74kB

  • ./src/components/editor/actions/pair-with-agent-commands.ts → Total Size: 2.87kB

@kirangadhave
kirangadhave requested review from manzt and a lite review from Copilot September 17, 2026 22:54
@kirangadhave kirangadhave added enhancement New feature or request preview Experimental or preview-only feature labels Sep 17, 2026
@kirangadhave
kirangadhave marked this pull request as ready for review September 17, 2026 22:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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.

Comment thread marimo/_cli/pair/commands.py Outdated
@github-actions

github-actions Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Coverage Report for ./frontend

Status Category Percentage Covered / Total
🔵 Lines 58.76% 22541 / 38355
🔵 Statements 58.7% 22937 / 39074
🔵 Functions 51.96% 5100 / 9814
🔵 Branches 52.59% 11985 / 22788
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
frontend/src/mount.tsx 81.91% 80.85% 81.25% 82.79% 119, 140-147, 200, 259-274, 307-315, 379, 392-393
frontend/src/__tests__/fixtures/pair-preview.ts 100% 100% 100% 100%
frontend/src/components/editor/actions/pair-with-agent-commands.ts 96.55% 95.45% 100% 96.55% 76
frontend/src/components/editor/actions/pair-with-agent-modal.tsx 93.93% 94.87% 84.61% 96.87% 46, 212
frontend/src/core/config/pair.ts 100% 100% 100% 100%
Generated in workflow #21575 for commit c53ec8f by the Vitest Coverage Report Action

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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review completed against the latest diff

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread frontend/src/components/editor/actions/pair-with-agent-modal.tsx
Comment thread marimo/_cli/pair/prompts.py
Comment thread frontend/src/__tests__/mount.test.ts
Comment thread tests/_cli/test_cli_pair.py
@kirangadhave
kirangadhave requested a review from manzt September 18, 2026 19:49
@kirangadhave
kirangadhave merged commit 4c64fc4 into main Sep 18, 2026
47 checks passed
@kirangadhave
kirangadhave deleted the kg/pair-prompt-update-flag branch September 18, 2026 20:59

This branch was successfully deployed

1 active deployment
Preview c53ec8f2 Deployed Sep 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request preview Experimental or preview-only feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants