Skip to content

Connect an agent in one flow: versions first, one approval, watcher included - #875

Merged
robzolkos merged 5 commits into
mainfrom
connect-one-flow
Oct 13, 2026
Merged

robzolkos merged 5 commits into
mainfrom
connect-one-flow

Conversation

@jorgemanrubia

@jorgemanrubia jorgemanrubia commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

Companion to basecamp/bc3#13784, from Adrien's migration report on Bring your agents to Basecamp.

His setup hit four rough edges:

  1. His CLI was 0.11.0, which has neither auth agent connect nor connect.
  2. His plugin was 0.7.2, so the legacy basecamp-connect skill was removed before the new one existed.
  3. He had to approve twice: Basecamp's instructions page connected over HTTP into ~/.basecamp-agent/credentials.json, which the CLI can't read, so auth agent connect connected a second time.
  4. The watcher came as a separate step.

bc3#13784 makes the instructions page CLI-first, and this PR makes the CLI side match it.

basecamp-connect skill

  • Before anything: require CLI 0.13.0 or later, running basecamp upgrade when it's older. Remove the legacy skill: symlinks are deleted, a real directory only after asking. Removing it here is safe because the skill doing the removing is installed.
  • First-time setup:
    • On a computer with no profiles, auth status answers "no profiles are configured". The skill now treats that as a free profile, and never runs profile create for an agent, since that signs in a person.
    • If the instructions page left a ~/.basecamp-agent/credentials.json, the skill says before connecting that connecting replaces it, so the person approves once more.
    • --operator <id> is named for non-personal agents.
    • New step 5: start the connector right after setup.

Doctor and the post-upgrade notice

  • A plugin/CLI mismatch now names the side to move:
    • plugin behind: claude plugin update basecamp-cli@37signals, then restart Claude Code;
    • CLI behind: basecamp upgrade;
    • plugin still under the old basecamp@37signals key, which the notice used to miss entirely: basecamp setup claude.
  • Versions that are equal by semver (v0.13.0, 0.13.0) no longer count as a mismatch.

README

  • New section "Connecting an agent to this computer": the version it needs, basecamp connect setup and its scriptable steps, connecting once, and updating the plugin (then restarting) before removing an older skill.

Review
Two rounds of adversarial review, by separate Opus agents. One change came out of it: importing the old credentials file (piped jq into auth login --with-client-credentials) was tried and dropped. It broke on read-only agents, a missing jq and stale files, and it contradicted the skill's own credential rules.

Verification

  • New harness tests for the mismatch hint and PluginUpdateNotice: legacy key, plugin behind, semver-equal, dev build. Each failed against a stub of the old behavior before the change.
  • bin/ci is green locally, including skill drift.
  • Not run: the connect skill evals (make -C skill-evals eval-connect).

Not in this PR

  • The Codex version check still says basecamp setup codex in both directions.
  • The "no profiles are configured" error still points at basecamp profile create.

Copilot AI balanced review requested due to automatic review settings October 12, 2026 08:46
@jorgemanrubia
jorgemanrubia requested a review from a team as a code owner October 12, 2026 08:46
@github-actions github-actions Bot added tests Tests (unit and e2e) skills Agent skills docs labels Oct 12, 2026

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

The migration ordering can still trigger duplicate approval, semantic version equality is mishandled, and watcher behavior is inaccurately documented and insufficiently tested.

4 open findings
What changed in this PR

Aligns agent connection guidance with a single-approval setup flow and improves plugin/CLI mismatch remediation.

Changes:

  • Adds credential migration, version checks, and automatic watcher startup guidance.
  • Documents agent connection setup.
  • Provides directional plugin/CLI upgrade hints with tests.

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File Description
skills/​basecamp-connect/​SKILL.md Expands the end-to-end connection workflow.
README.md Documents agent connection and watcher setup.
internal/​harness/​claude.go Adds version-aware remediation hints.
internal/​harness/​claude_test.go Tests mismatch direction handling.
internal/​cli/​root.go Uses directional hints after upgrades.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread internal/harness/claude.go Resolved
Comment thread skills/basecamp-connect/SKILL.md Resolved
Comment thread README.md Resolved
Comment thread skills/basecamp-connect/SKILL.md Resolved

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

All reported issues were addressed across 5 files

Reply to a comment to ask cubic a question or push back. It learns from your replies.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread skills/basecamp-connect/SKILL.md Resolved
Comment thread internal/cli/root.go Resolved
Comment thread README.md Resolved
Comment thread skills/basecamp-connect/SKILL.md Resolved
Copilot AI balanced review requested due to automatic review settings October 12, 2026 08:56

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

All reported issues were addressed across 5 files (changes from recent commits).

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

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread internal/harness/claude.go Resolved

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 plugin installations can still evade the notice, and the README overstates what guided setup starts.

3 open findings
2 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Low severity Setup messaging incorrectly implies the watcher starts automatically

README.md:251

“One command does it all” implies that this invocation also starts the watcher, but guided setup explicitly finishes with Running: no and only prints instructions for starting it. Scope this sentence to connecting and configuring the agent so users do not expect the connector to be running afterward.

🧠 Review effort: Balanced

Comment thread internal/harness/claude.go Resolved
Copilot AI balanced review requested due to automatic review settings October 12, 2026 09:01

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.

🔵 Needs a closer look

The operator-ID flow omits its setup flag, and legacy array-format plugin installs still evade the new notice.

3 open findings
Previously missed (2)

In code that hasn't changed since last review

Medium severity Support legacy top-level array plugin metadata

internal/​harness/​claude.go:316

This helper drops the repository's supported top-level array schema. For an entry such as [{"name":"basecamp@37signals","version":"0.7.2"}], installedPluginVersion intentionally rejects the legacy key and this function cannot parse the array, so PluginUpdateNotice remains empty—the exact legacy install this change intends to catch. Handle name/package/id array entries here as the existing plugin parsers do, and add a regression case.

Low severity Step 4 omits the selected operator ID

skills/​basecamp-connect/​SKILL.md:226

The new person-ID operator path is not carried into step 4: that command-building instruction only says to add --operator-profile. Following this branch therefore runs setup without --operator <id>; for an ownerless agent setup will refuse it, and for a personal agent it can silently select the owner instead. Add --operator to step 4's list of flags to include “as chosen.”

🧠 Review effort: Balanced

…ncluded

From a migration report: a CLI too old for `auth agent connect`, a plugin
too old for basecamp-connect, a second approval because the CLI couldn't
use the connection Basecamp's instructions page had made over HTTP, and the
watcher arriving as a separate step.

- basecamp-connect skill: check CLI 0.13.0+ (basecamp upgrade) and remove
  the legacy skill before anything; treat "no profiles are configured" as a
  free profile and never `profile create` for an agent; import a
  ~/.basecamp-agent/credentials.json connection instead of replacing it;
  name --operator for non-personal agents; start the connector right after
  setup.
- doctor and the post-upgrade notice: a plugin/CLI mismatch now says which
  side to bring forward: `claude plugin update basecamp-cli@37signals` and
  a restart when the plugin is behind, `basecamp upgrade` when the CLI is.
- README: how to connect an agent, the version it needs, connecting once,
  and updating the plugin before removing an older skill.
From the adversarial review:

- The post-upgrade notice read only the basecamp-cli key, so a plugin old
  enough to lack basecamp-connect (installed as basecamp@37signals) got no
  notice. PluginUpdateNotice reads the old key too and says `basecamp setup
  claude`, which reinstalls it under the new name. Versions equal by semver
  ("v0.13.0", "0.13.0") no longer count as a mismatch, here or in doctor.
- The skill no longer imports ~/.basecamp-agent/credentials.json: piped jq
  broke on read-only agents, a missing jq or a stale file, and it broke the
  skill's own credential rules. It warns that connecting replaces that
  connection, in the same branch that connects.
- Legacy skill removal deletes symlinks only, and asks before a real
  directory. The 0.13.0 floor says why.
- README: guided setup ends by saying how to start the connector (it
  doesn't start it), and an old-name plugin updates through setup claude.
… agent

From the convergence review: guided setup picks its own profile name, so
for an agent already connected under another one it could connect again.
Also corrects the version the connect skill arrived in.
Copilot AI balanced review requested due to automatic review settings October 12, 2026 19:30
@robzolkos

Copy link
Copy Markdown
Collaborator

🤖 Rebased onto main to pick up the change-aware CI from #882; no code changes.

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

The plugin notice still misses several stale legacy-key configurations.

3 open findings
1 resolved since last review

🧠 Review effort: Balanced

Comment thread internal/harness/claude.go Resolved
Review fixes for the connect-one-flow change.

The post-upgrade notice read the old basecamp@37signals key only when the
current key was absent and its version differed, and only in the map
formats of installed_plugins.json. A legacy copy at the CLI's version, one
installed beside the current key, or one in the array format got no
notice. It is now named first, on presence, in every format: setup is the
remedy in each case. The legacy lookup reuses installedPluginVersion's
parser, parameterized by key, instead of a second one.

The connect skill:
- Invocation routes "no profiles are configured" (what connect show says
  on a computer with none) to First-time setup, not to that error's
  profile-create hint.
- Step 4 carries --operator, which step 2 offers for an operator without
  a profile here.
- A profile name starts with a letter or digit, as the CLI requires.

The first-time-setup eval asked for the agent running and then required
a reply saying running wasn't available yet, a leftover from before the
connector existed. It now expects `basecamp connect -P helper` after
setup instead.
Copilot AI balanced review requested due to automatic review settings October 13, 2026 00:43

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

All reported issues were addressed across 4 files (changes from recent commits).

You’re at about 99% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.

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

View guided diff | Turn on auto-fix | Re-trigger cubic

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.

🔵 Needs a closer look

Plugin versions from non-first-party metadata reach a terminal notice without sanitization.

2 open findings
2 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Sanitize plugin version before displaying in terminal notice

internal/​harness/​claude.go:306

installed_plugins.json is explicitly treated as non-first-party input elsewhere (internal/commands/wizard_agents.go:615-617), but its version is interpolated into this one-line terminal notice unchanged. A value containing \n, ESC, or C1 controls can inject lines or terminal sequences when root.go prints the result. Sanitize the displayed plugin version with richtext.SanitizeSingleLine in both notice branches, while retaining the raw value for semver comparison.

🧠 Review effort: Balanced

…below exports

The first-time-setup eval matched any `connect setup` before the
connector start, so a trace that started the connector between a refused
setup (the mock refuses one without --serve) and the one that succeeds
passed. The step now matches the successful invocation.

normalizeSemver sat between two exported functions; it moves below the
private helpers it sits beside, per STYLE.md's export order.
Copilot AI balanced review requested due to automatic review settings October 13, 2026 00:53

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.

🟢 Approved

The implementation, documentation, and regression coverage consistently support the intended unified setup flow.

0 open findings

3 resolved since last review

🧠 Review effort: Balanced

@robzolkos
robzolkos merged commit e34b61a into main Oct 13, 2026
33 checks passed
@robzolkos
robzolkos deleted the connect-one-flow branch October 13, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs skills Agent skills tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants