Skip to content

docs: tell agents to run acp configure themselves instead of asking the human#25

Open
psmiratisu wants to merge 5 commits into
mainfrom
claude/auth-agent-friendly-flow
Open

docs: tell agents to run acp configure themselves instead of asking the human#25
psmiratisu wants to merge 5 commits into
mainfrom
claude/auth-agent-friendly-flow

Conversation

@psmiratisu
Copy link
Copy Markdown
Contributor

@psmiratisu psmiratisu commented May 28, 2026

Summary

Agent harnesses (Perplexity, Claude, Grok, etc.) frequently refuse to execute acp configure themselves and instead tell the human "please run acp configure." That's a behavioral / docs problem, not a missing-command problem — acp configure already prints the URL on stdout almost immediately and exits cleanly once the human signs in.

This PR fixes it in SKILL.md only:

  • Reshape the Setup section around an explicit "you, the agent, run acp configure yourself — do not punt to the human" recipe.
  • Document the actual acp configure --json shape: URL JSON line arrives early, final auth JSON arrives after the human signs in.
  • Note the workaround for harnesses that can't tolerate long-running commands (stream stdout line-by-line to grab the URL the moment it's printed).
  • Update the NOT_AUTHENTICATED recovery hint in the error table to push agents toward running it themselves.

No code changes — acp configure is unchanged. Earlier commits in this branch experimented with a separate acp auth namespace and were reverted in 990f3d1 as overengineered.

Test plan

  • SKILL.md renders cleanly on GitHub
  • Try the recipe with at least one agent runtime (e.g. Claude Code) to confirm it now runs acp configure instead of asking the human

Note

Low Risk
Documentation-only changes to SKILL.md with no runtime or auth code modifications.

Overview
Setup now tells harness agents to run acp configure themselves instead of asking the human to run it; the human only needs to open the OAuth URL you relay.

The doc spells out acp configure --json: first stdout line is {"url":"..."}, then after sign-in (up to ~5 min) the final message / walletAddress JSON. It adds a line-by-line stdout tip for runtimes that can't keep a long-lived process open.

The NOT_AUTHENTICATED recovery row matches that flow (agent runs configure, human clicks the URL). No CLI behavior changes.

Reviewed by Cursor Bugbot for commit 76f0320. Bugbot is set up for automated code reviews on this repo. Configure here.

Agent harnesses (Perplexity, Claude, Grok, etc.) often refuse to run
`acp configure` because the name and behavior read as "interactive
human setup" — they punt to the user instead of executing it and
relaying the URL.

Add a sibling `acp auth` namespace that decouples URL emission from
polling:

- `acp auth url` returns {url, requestId} and exits immediately. No
  browser opens, no polling — safe for agents to call directly.
- `acp auth complete --request-id <id>` finalizes after the human
  signs in. Polls (up to 5 min) and saves tokens.

`acp configure` is untouched for humans on a workstation and for the
non-interactive --token / env-var flow.

Rewrite the SKILL.md Setup section to make the agent recipe explicit
("you, the agent, run these — do not punt to the human") and update
the NOT_AUTHENTICATED recovery hint and file map accordingly.
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ea13532. Configure here.

Comment thread src/commands/auth.ts Outdated
claude added 2 commits May 28, 2026 09:16
Previously `complete` polled internally for up to 5 minutes, which
reintroduces the same problem `acp auth` was meant to solve — long
blocking calls trip agent-harness timeouts.

Make `acp auth complete` a single non-blocking probe instead. Returns
`{done: false}` when the human hasn't signed in yet, or
`{done: true, walletAddress}` once tokens are saved. Agents poll it
every few seconds (same pattern as `acp card signup-poll` and the OTP
recipe). Cap retries at ~5 min on the caller side; re-run `acp auth url`
if it expires.

Drop the internal `waitForToken` helper since we no longer block. Update
SKILL.md recipe and the `NOT_AUTHENTICATED` recovery hint.
`acp auth url` + `acp auth complete` duplicated the auth surface that
`acp configure` already covers. The real problem is behavioral, not a
missing command: agent harnesses were pushing `acp configure` back to
the human instead of running it themselves.

Drop the auth.ts file and its registration. Reshape the SKILL.md Setup
section around `acp configure --json` directly: the URL prints on
stdout almost immediately, the command then waits up to 5 min, and
runtimes that can't tolerate long-running commands can stream stdout
to relay the URL the moment it lands. Update the NOT_AUTHENTICATED
recovery hint and file map.
@psmiratisu psmiratisu changed the title feat(auth): agent-friendly split auth flow (acp auth url + acp auth complete) docs: tell agents to run acp configure themselves instead of asking the human May 28, 2026
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.

3 participants