Skip to content

Make the local connector easy to start and readable, and stop promptly - #520

Merged
MaggieAppleton merged 8 commits into
mainfrom
connector-ergonomics
Oct 12, 2026
Merged

MaggieAppleton merged 8 commits into
mainfrom
connector-ergonomics

Conversation

@MaggieAppleton

@MaggieAppleton MaggieAppleton commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Why

Maggie's real test on the #466 preview hit four problems.

  • bun run connector failed with "script not found: connector" outside a Chopin checkout.
  • The agent's permission prompts were opaque.
  • A refused Build or Run answered with a silent 409.
  • Ctrl-C took about 90 seconds to stop anything.

What changed

  • One-line command that works anywhere. The connector is bundled into one file during bun run build and in the Docker image, and served at GET /connector.js with no auth and an ETag. The UI and docs give one command to run in the project folder:
    mkdir -p ~/.chopin && curl -fsSL {origin}/connector.js -o ~/.chopin/connector.js && CHOPIN_URL={origin} bun ~/.chopin/connector.js connect . -- copilot --acp --allow-all.
    bun run connector still works for contributors, and the bundle supports the stdio bridge mode.
  • Readable terminal. Each job gets a styled header ("› Investigating …", "› Building …"), with plain finish and failure lines. A failure shows the tail of the agent's output. Permission prompts say what the agent wants to do and remember repeated answers.
  • Clear not-connected note. A no-workspace refusal shows one shared note: the agent isn't connected, the command with Copy, that Bun is needed, and a "Trouble connecting?" link.
  • Ctrl-C stops promptly. Ctrl-C anywhere, including at a permission prompt, reports running work (builds, rebuilds, investigations, spikes) as stopped from the connector terminal, then disconnects. A second Ctrl-C exits at once.
  • Server-side disconnect. disconnect_workspace now fails the connection's active builds and rebuilds immediately: persisted, then announced. The sweep still catches a connector killed without warning. Build's capsule and headline say why a build stopped.
  • Process cleanup. When a job ends, the connector stops background processes left in its worktree, such as a dev server. A spike's throwaway worktree and branch are removed, and its pushes stay refused (Prototype uncertain passages inline before the first build (LIVE_SPIKES) #454).
  • Troubleshooting docs. docs/local-experiments.md#trouble-connecting and docs/local-launcher.md now cover the downloadable connector and pairing problems.
sequenceDiagram
  participant P as Person
  participant C as Connector
  participant S as Chopin server
  participant B as Browser
  P->>C: Ctrl-C
  C->>C: abort the agent turn (also at a permission prompt)
  C->>S: report_implementation_build failed / fail_experiment<br/>"Stopped from the connector terminal."
  S->>S: persist the stopped build or run
  S-->>B: plan:implementation / experiment:changed
  C->>S: disconnect_workspace
  S->>S: fail remaining builds and rebuilds, interrupt runs (persisted)
  S-->>B: announce; capsule reads "Build stopped from the connector terminal"
  C->>C: stop agent process group and worktree processes, exit
  P->>C: second Ctrl-C exits at once
Loading

Rebased onto the reworked stack

These five commits were rebased onto the updated #466 head.

Tests

  • Connector unit tests for the output, the permission descriptions, process cleanup and the interrupt.
  • A server test for GET /connector.js.
  • Route tests that a disconnect fails a running build and a running rebuild.
  • Model tests for endedReason.
  • e2e for the Build and card notes, Copy and the troubleshooting link.
  • bun run fix, bun run types, the full bun test, bun run ci, and the connector, experiments, implementation-launcher and harness e2e suites all pass locally.

Visuals

The connector's styled terminal output

Build: a refused Build plan explains how to start the local agent

Investigation card: the same note under Run

🤖 Generated with Claude Code

Base automatically changed from living-final-polish to main October 12, 2026 18:00
MaggieAppleton and others added 8 commits October 12, 2026 19:00
The connector command now works outside a Chopin checkout: `bun run build`
and the Docker image write one runnable bundle, and the server serves it
without authentication, revalidated by its hash. Development bundles from
source per request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Pairing, connection and job lines go to stdout with ANSI styling on a TTY
(plain under NO_COLOR or a pipe); failures stay on stderr. Agent stderr is
hidden unless CHOPIN_DEBUG=1, with its last lines shown on failure. Claims
carry the document title so a job line names its work. Permission prompts
show the tool kind and command, paths or input, and remember Always allow
per tool kind for the run. The stdio connector e2e runs the downloaded
bundle from the checkout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A no-workspace refusal in the Build view and the investigation card shows
one shared note: the agent isn't connected, the download-and-connect
command to run in the project folder with a copy button, that Bun is
needed, and a troubleshooting link. The Build note now survives a load or
draft that lands after the press; only a started build clears it. Other
card refusals use plain copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ctrl-C at a permission prompt no longer just pauses readline: it stops the
connector like Ctrl-C anywhere else. Running work is reported stopped from
the connector terminal before the connector disconnects; a second Ctrl-C
exits at once. disconnect_workspace now fails the connection's active
builds immediately through reportBuild (persisted, then announced); the
sweep remains for connectors killed without warning. Build names why it
stopped. When a run ends, background processes left in its worktree, such
as a dev server in its own process group, are stopped.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The local-agent note now answers a refused Build plan, Retry or pressed Build
of changes in the Build view. Why a build stopped (from the connector
terminal, or its agent disconnecting) reads in the capsule for first builds
and rebuilds. A disconnecting connector fails its running rebuild at once, as
it does a build, and the spike cleanup and no-push setup stay in the
restyled run loop.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Whitespace only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@MaggieAppleton
MaggieAppleton merged commit 2194559 into main Oct 12, 2026
3 checks passed
@MaggieAppleton
MaggieAppleton deleted the connector-ergonomics branch October 12, 2026 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant