Skip to content

Tell an agent's owner to disconnect this connection, not rotate its secret - #851

Merged
jeremy merged 4 commits into
mainfrom
agent-logout-says-disconnect
Oct 14, 2026
Merged

jeremy merged 4 commits into
mainfrom
agent-logout-says-disconnect

Conversation

@jeremy

@jeremy jeremy commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

basecamp auth logout and auth revoke on an agent profile say "rotate the client secret in Basecamp" to end the agent's access. This changes both to "disconnect this connection in Basecamp".

Why this connection

Rotating is wrong today. My > Agent has no rotate control (basecamp/bc3#13597 removed it), and a rotation leaves outstanding self-tokens valid until they expire. Disconnecting revokes the secret and every token at once.

This PR first said "disconnect the agent". That stops being right once a personal agent can hold several connections, one per computer or profile, each with its own secret (plan; basecamp/bc3#13817, basecamp/bc3#13822, basecamp/bc3#13819). After bc3 step 6 turns that on:

  • "Disconnect the agent" is My > Agent's Disconnect all, which ends every computer.
  • Rotating the client secret rewrites only the first connection's secret. Someone on another connection who follows that advice keeps their access and cuts off the first computer instead.

So both messages now point at the one connection this profile holds.

True before and after step 6

I chose wording that is right in both worlds, rather than gating it on step 6 the way #900 is, so this can land now and fix today's wrong advice:

  • Today an agent has one connection. Disconnecting it is "Disconnect this agent" on My > Agent, or Disconnect in Adminland for a shared agent.
  • After step 2, My > Agent lists connections, each with Disconnect…, and Disconnect all sits below the list. Before step 6 there is one row, so both end this connection.
  • After step 6, the row's Disconnect… ends this connection and leaves the others working.

The one-line messages say "in Basecamp" rather than "on My > Agent", and don't name Disconnect all. A shared agent is disconnected in Adminland, and the CLI can't tell a shared agent from a personal one. Disconnect all doesn't exist until step 2 ships. The README has room for both, and words the Disconnect all warning so it only applies once there are several connections.

Change

  • auth logout: Logged out (forgot the agent credential; disconnect this connection in Basecamp to end its access). profile delete on an agent profile says the same. It says what to do rather than that the connection is still live, which is false when it was already disconnected or replaced.
  • auth revoke hint: Forget the credential locally instead (basecamp auth logout), and disconnect this connection in Basecamp to end its access.
  • README, Agents section: disconnect its connection in Basecamp, on My > Agent for your own agent or in Adminland for a shared one. Where My > Agent lists several connections, disconnect the one this profile used, because Disconnect all ends every one of them.
  • The RevokeSkippedAgent comment says why neither rotating nor disconnecting the whole agent is the remedy.
  • auth agent --help no longer says every agent is "an identity your Basecamp administrator created". A personal agent is created by its owner when they connect it.

The JSON envelope is unchanged: reason: "agent", revoked: false.

Pairing with #900 and step 6

This lands before or with #900 (step 4, CLI copy) and joins bc3 step 6's pairing, so it is never later than step 6. It's copy only.

Trial merges (git merge-tree) on current main: this merges cleanly with #900 and with #901. It shares README.md and internal/commands/auth_agent.go with #900, in different hunks. It shares no files with #901.

Two lines are left to #900 on purpose. They're its lines, they stay true until step 6, and #900 already rewrites both:

  • the "disconnecting the agent there kills the client secret this holds" paragraph in auth agent connect --help;
  • the lost-handover hint, "Disconnect the agent in Basecamp and connect again".

Tests

  • TestAuthLogoutHumanCopy/agent pins the whole summary. It also checks that "rotate" doesn't appear, that no revocation is sent, and that the credential is forgotten.
  • TestAgentRevokeIsRefusedAndKeepsTheCredential pins the hint.
  • I put the production strings back to main's wording, and then to this PR's earlier "disconnect the agent" wording. Both tests fail each time.
  • TestAgentLogoutSaysRotatingTheSecretIsTheRemedy is renamed TestAgentLogoutForgetsWithoutRevoking. It never asserted the wording.
  • Locally on macOS: unit tests in the changed packages, lint on linux, e2e, skill drift, surface and the other make check targets pass. The only failures are tests that need a terminal, which fail the same way on main here, and a lint finding in proctime_darwin.go that main already has.

Copilot AI balanced review requested due to automatic review settings October 6, 2026 17:56
@github-actions github-actions Bot added commands CLI command implementations tests Tests (unit and e2e) auth OAuth authentication labels Oct 6, 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@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 with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread internal/commands/auth.go Outdated
@jeremy
jeremy marked this pull request as ready for review October 7, 2026 03:49
@jeremy
jeremy requested a review from a team as a code owner October 7, 2026 03:49
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T07:52:31.301925Z 0904fa5 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Copilot AI balanced review requested due to automatic review settings October 7, 2026 04:11
@jeremy
jeremy force-pushed the agent-logout-says-disconnect branch from 513a778 to 64b77e8 Compare October 7, 2026 04:11
@github-actions github-actions Bot added the docs label Oct 7, 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@jeremy

jeremy commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

@jeremy

jeremy commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review

@jeremy I have started the AI code review. It will take a few minutes to complete.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

Reviewed commit: 64b77e8cf6

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

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

No issues found across 6 files

Turn on auto-fix | Re-trigger cubic

@jeremy

jeremy commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

Rebased onto main (943dbb5) with no conflicts.

Review threads: 1 resolved (1 fixed, 0 declined).

CI is green on 64b77e8. Codex reported on 64b77e8 with no major issues, and cubic found no issues. Copilot can't review because the requester's quota is exhausted.

auth logout and auth revoke on an agent profile said to rotate the client
secret in Basecamp to end the agent's access. My > Agent has no rotate
control (reconnecting is the rotation), and a rotation leaves the
agent's tokens alive for their hour anyway. Disconnect is what ends its
access, so that is what both now say.

auth agent's help also stops calling every agent one an administrator
created: a personal agent is created by its owner when they connect it.
The Agents section still told the owner to rotate the client secret to end
an agent's access, the advice auth logout and auth revoke just stopped
giving. Disconnecting is what ends it.
Basecamp is about to let a personal agent hold several connections, one
per computer or profile, each with its own secret. Then "disconnect the
agent" is My > Agent's Disconnect all, which ends every computer, and
rotating the client secret rewrites only the first connection's.

auth logout and auth revoke now say to disconnect this connection in
Basecamp. That is right today as well: an agent has one connection, and
disconnecting it is what My > Agent's Disconnect does. The README says
where to find it for a personal agent and a shared one, and that
Disconnect all, once My > Agent lists several, ends every one.
@jeremy
jeremy force-pushed the agent-logout-says-disconnect branch from 64b77e8 to 1a7e93a Compare October 14, 2026 07:35
Copilot AI balanced review requested due to automatic review settings October 14, 2026 07:35
@jeremy jeremy changed the title Tell an agent's owner to disconnect it, not rotate its secret Tell an agent's owner to disconnect this connection, not rotate its secret Oct 14, 2026
@jeremy

jeremy commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai review

@jeremy cubic can't start this review because your workspace has reached its free monthly review limit. cubic has reviewed 80,346 of the 80,000 allowed lines of code this month. Reviews resume on 1 November 2026 (in 18 days). Paid plans include much higher monthly review limits. Upgrade now to resume reviews.

To help optimise your usage, you can tune cubic to get the most out of your usage limits:

Learn more →

Copilot AI previously approved these changes Oct 14, 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.

🟢 Approved

The copy-only changes are consistent across documentation, commands, and focused tests.

0 open findings

🧠 Review effort: Balanced

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1a7e93a1c0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread README.md
…live

"This connection stays live until you disconnect it" is false when it
was already disconnected, or replaced from another computer, which is
often why someone is logging out. Saying what to do, as auth revoke's
hint does, is true either way.
Copilot AI balanced review requested due to automatic review settings October 14, 2026 07:39
Copilot AI dismissed their stale review, a newer Copilot review was requested October 14, 2026 07:40

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 copy-only changes are internally consistent and adequately covered by focused tests.

0 open findings

🧠 Review effort: Balanced

@jeremy

jeremy commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

@codex review

1 similar comment
@jeremy

jeremy commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 0904fa53ab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jeremy

jeremy commented Oct 14, 2026

Copy link
Copy Markdown
Member Author

Rebased onto main (36a58d7) and reworded for agents with several connections: logout and revoke now say "disconnect this connection in Basecamp". The wording is true before and after bc3 step 6, so this can land before #900. The PR description says why.

Review threads: 1 resolved (0 fixed, 1 declined).

CI is green on 0904fa5. Copilot approved 0904fa5. Codex reported on 0904fa5 with no major issues. cubic couldn't review: the workspace has used its monthly review limit, which resets on 1 November.

Trial merges with #900 (7ba7e96) and #901 (8ead732) are clean.

@jeremy
jeremy merged commit 81562bb into main Oct 14, 2026
33 checks passed
@jeremy
jeremy deleted the agent-logout-says-disconnect branch October 14, 2026 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auth OAuth authentication commands CLI command implementations docs tests Tests (unit and e2e)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants