Chopin can delegate codebase investigations to a coding agent running on a paired machine or a server-owned pool machine. The agent inspects an exact Git commit using its normal tools, then submits a structured report with captured data. Chopin displays native tables and charts, keeps filter and row selections synchronized across collaborators, and lets the team record decisions backed by that fixed evidence.
Connect your machine with the chopin CLI as described in Use your own machine with Chopin. One connection handles documents across every repository you can push to, using either local folders named with --checkout or on-demand clones.
Chopin communicates with coding agents using the standard Agent Client Protocol (ACP) rather than vendor-specific SDKs. Built-in --agent copilot and --agent atomic (atomic@0.10.30 + @bastani/atomic-acp@0.0.29 pre-installed in each isolated runtime) work out of the box. Any custom agent passed after -- must speak ACP over standard I/O and accept MCP tool servers over HTTP or standard I/O.
Under AUTH_MODE=local, Chopin has no client secret to issue separate machine authorizations, so connector requests rely on your active browser sign-in and pause while you are signed out.
Every Chopin server also serves a single-file script at GET /connector.js if you prefer to run without installing the binary. Contributors working inside a Chopin checkout can also run bun run connector connect --agent copilot.
To keep a machine connected in the background, see Keep it running. On Windows the task runs in your sign-in (see The Windows task runs in your sign-in).
To start an investigation from a document:
- On any blank line, type
/and choose Investigate (next to Research). - Enter your investigation brief and click Propose investigation. Chopin inserts an investigation card marked Ready to run. (The Planner can also propose investigations beside relevant sections; either way, a person must click Run to start it.)
- Click Run. Chopin puts the investigation in the single line for any eligible machine (your own, a teammate's whose owner can push to the repository, or a pool machine; see The pool). If all eligible machines are busy, the job waits in line and starts in turn by person, just like builds on a busy machine. If no eligible machine is connected, the card shows the connect command to run.
- Progress updates appear directly inside the card. When finished, Chopin publishes the report as a child document and turns the card into a compact link to it.
Card and access rules:
- Card lifecycle. Deleting a Ready to run card cancels the unstarted investigation. Failed, stopped, or interrupted cards can be removed directly. Running and completed cards stay in the document, and the Planner cannot move or delete them.
- Permissions and locks. Any repository writer can cancel a Ready to run card; only the person who started a running investigation can cancel it. Chopin rechecks your account allowlist, repository push access, and archive state before every run. Investigations cannot start or run while an active build locks the document; if the document is archived or locked mid-run, the investigation stops cleanly. Anyone with write access can view published results, adjust shared chart filters, and record decisions.
- Exact Git commit. With the GitHub App configured, each investigation starts from what is on GitHub (the plan's pushed commit, or else the default branch head—never a local unpushed
HEAD) so any eligible machine can run it. Without the App (or when the App cannot read the repository), it starts from your registered--checkouton your own machine. Retrying reuses the exact same commit so findings stay comparable. The agent runs inside an isolated session (a Linux microVM or Windows isolation session) with its own fresh clone, so your local checkout and uncommitted edits are never modified. Connector state defaults to~/.local/state/chopin/connector(override with--base-dir,CHOPIN_HOME, orCHOPIN_CONNECTOR_STATE_DIR), and temporary run clones are cleaned up when work finishes. - Screenshots. Manual investigations can attach up to three screenshots (PNG, JPEG, or WebP; images over 1 MiB are resized automatically). The agent saves files inside its repository and calls
upload_image_file({ path }); paths outside the repository (including symlinks) are blocked. - Sandbox and permissions. Every investigation runs inside an isolated session that reaches only an allow-list of public hosts and Chopin's server through a local proxy. Run
chopin statusto verify isolation support, and see Sandbox and Isolated agent sessions. If an agent asks for interactive tool permission, the prompt appears in your connector terminal (or is declined automatically in background mode). Choosing "always allow" approves that tool kind for the rest of the connector session. - Structured report submission. Inside the session, the agent reads its brief with
read_investigationand submits its report withsubmit_investigation_result. Chopin validates the report before publishing it as a child document. Published reports remain readable even after your machine disconnects.
- Required investigations. The Planner can mark an investigation as required before building and state why. Build plan stays disabled until the required investigation finishes and the Planner incorporates its findings (and opens any needed human Decisions). Optional investigations never block builds. If the follow-up review fails, click Apply findings on the completed card to retry it.
- Native views. Reports can include Markdown prose, structured datasets, native views (tables, metric comparisons, bar charts, and line charts), and short text evidence. Arbitrary UI code or external embeds are not accepted.
- Shared selections and decisions. Opening the published child document displays the report, interactive views, method, limitations, and evidence. Filters and row selections stay synchronized for all collaborators. Click Record decision beneath any view to save a decision anchored to those exact selections, then use Insert decision evidence in document to embed the snapshot back in the parent document.
- Retention. Once published, neither the parent nor the child document can be deleted while the investigation links them (both can still be archived). Child documents cannot start their own investigations or builds.
- Retrying. Interrupted investigations never restart automatically. Click Retry on a failed, stopped, or interrupted card to return it to Ready to run, then click Run.
- Stopping with Ctrl-C. Pressing
Ctrl-Cin the connector terminal stops active work, reports it as stopped to Chopin, and disconnects (a secondCtrl-Cexits immediately). When a job ends, the connector terminates the agent and any background processes it left running in that workspace, without touching shells you opened yourself. - Network drops and server restarts. If the network drops or Chopin restarts, the connector stays running and reconnects automatically with exponential backoff (up to 5 minutes). Any running agent keeps working through brief outages while its heartbeats retry every 10 seconds and status reports wait in memory. The connector prints Lost contact with Chopin, periodic retry lines with the HTTP status or error code, and Back in contact with Chopin once recovered. It stops the agent only if Chopin reports the run ended, after 10 minutes without contact, or after 2 minutes of Chopin reporting an unknown connection.
How pairing works. On first run, chopin connect prints a pairing URL and an 8-character code. Opening that link, verifying the code, and clicking Add machine grants the machine a long-lived token. One connector process per state folder serves every repository you can push to. Connections expire after 90 seconds of silence, so a running connector renews continuously. After a server restart or deploy, the connector automatically re-registers with its saved machine token without pairing again.
Builds surviving server restarts. Builds started with connector protocol 6 or newer (chopin 0.0.16+) survive server restarts and deploys. Chopin waits up to 10 minutes (CHOPIN_BUILD_RESUME_MS) for your machine to reconnect, and once reconnected gives it a minute to pick up its build's heartbeat. Builds started by older connectors stop with Build stopped - Chopin restarted.
Common errors and fixes:
- "This machine is no longer paired" (
machine-revoked) or "GitHub no longer accepts this machine's authorization" (machine-reauthorize). The machine was disconnected in Chopin, unpaired, or revoked on GitHub. The connector deletes the stale token automatically; runchopin connect(orchopin pairthenchopin connect) in a terminal to pair again. script not found: connector.bun run connectoronly works inside a Chopin source checkout. From any other folder, usechopin connector the/connector.jscommand in Run without installing.- "Your local agent isn't connected" (HTTP 409
no-workspace). No eligible machine is connected (none of your own, no pool machine, and no teammate's machine that can take guest launches for this repository). Startchopin connect, approve pairing if prompted, and click Run or Build plan again. - Wrong repository, not a Git checkout, or missing commit. Every
--checkoutfolder must have agithub.comoriginremote. If a recorded commit is missing locally, the connector fetches it fromorigin; push or fetch it manually if that fails. Repositories without a--checkoutare cloned on demand intorepos/<owner>/<repo>, which requires a GitHub App machine token (otherwise it fails withThis machine has no checkout of <owner>/<repo>). - Connector version mismatch after a deploy. Run
chopin update(or re-download/connector.jsif running without the installed binary). - Stale lock after a crash. The connector keeps a
.lockfile in its state folder recording both PID and process start time, so locks from dead processes are cleaned up automatically. If you still see is already locked by a running connector, confirm nochopinprocess is running and delete the.lockfile named in the error. - Permission prompts. Each prompt shows the tool kind and target command or file. Choose "always allow" for that session, or pass your agent's auto-approval flag after
--(such as Copilot's--allow-all).
bun test packages/experiment apps/connector apps/server/src/experiments
bun run e2e experiments.e2e.ts connector.e2e.ts --project=chromium
CHOPIN_TEST_ACP_COMMAND='["copilot","--acp","--allow-all"]' \
bun test apps/connector/src/acp.test.ts --test-name-pattern 'real ACP'The first two commands use mock ACP agents; the final opt-in test calls a real model using your existing login. See the local-investigations skill for report authoring guidance.
When LIVE_SPIKES=on is enabled on the server, documents without an active living build can automatically run quick prototype spikes for uncertain passages. After your edits settle, Chopin's helper model checks whether a small prototype would clarify a passage you edited. If so, Chopin runs a throwaway spike on your paired machine and inserts a callout beneath that passage showing status ("Prototype queued", "Prototyping…", then the findings or "Prototype stopped"). Deleting the callout stops the spike and prevents re-running it on that passage.
Prototype spikes enforce strict guardrails:
- Explicit pairing consent. Spikes run only on machines where the owner checked Let Chopin build and prototype automatically on this machine during pairing, and only for passages that owner edited themselves.
- Helper model gate. Spikes require the helper model (
DECISIONS_MODEL). SettingLIVE_SPIKES_REGEX_JUDGE=onswitches to matching explicit uncertainty phrasing instead. - Rate and time limits. At most 3 spikes run per document at once, 6 start per document per hour, 10 start per editor per hour, and any spike running longer than 20 minutes is stopped.
- Document text treated as data. Prompts frame document passages as untrusted descriptions of what to prototype, not as instructions.
- Throwaway branch with pushes blocked. Each spike runs in a temporary workspace on a
chopin/spike-*branch configured to block everygit push, and is deleted when the run ends. - Respects build locks. Spike callouts wait if a build is queued or running so they never alter an approved plan mid-build.
When a spike finishes, Chopin asks the document's existing Planner owner (or attached remote Planner) to incorporate the findings into the passage without claiming a new owner. Under HARNESS=atomic, weigh the fact that Planner sessions run without an OS sandbox as the server user before enabling LIVE_SPIKES.
Spike runs receive only read_investigation, upload_investigation_image (with the local upload_image_file({ path }) helper for up to 3 screenshots), and submit_spike_result (headline, 3 to 6 findings, recommendation, and uploaded image paths).