paseo icon indicating copy to clipboard operation
paseo copied to clipboard

Custom ACP providers: `GenericACPAgentClient` skips `authenticate` step, breaking agents that require auth (e.g. JetBrains Junie)

Open everton-dgn opened this issue 7 months ago • 4 comments

Custom ACP providers: Paseo skips authenticate step, breaking agents that require auth (e.g. JetBrains Junie)

Summary

Paseo's GenericACPAgentClient does not call the ACP authenticate method after initialize, even when the agent advertises auth methods in its InitializeResponse.authMethods. As a result, ACP agents that gate operations behind authentication (such as JetBrains Junie via junie --acp true) can be registered and selected in the UI, but every prompt fails with the agent-side error Authentication is required before this operation can be performed.

Passing --auth=<token> on the command line or JUNIE_API_KEY via env does not help, because in ACP mode Junie only honours authentication driven through the JSON-RPC authenticate call — flags and environment variables are used by Junie's non-ACP paths only.

Version

  • Paseo: 0.1.59 (both CLI @getpaseo/cli and desktop Paseo.app)
  • Junie CLI: 1362.47
  • macOS: 26.4.1

Steps to reproduce

  1. Install JetBrains Junie CLI and sign in (e.g. via WebStorm / junie.jetbrains.com/cli).
  2. Add Junie as a custom ACP provider in ~/.paseo/config.json:
    {
      "agents": {
        "providers": {
          "junie": {
            "extends": "acp",
            "label": "Junie",
            "command": ["junie", "--acp", "true", "--model", "gemini-3.1-pro-preview"],
            "models": [
              { "id": "gemini-3.1-pro-preview", "label": "Gemini 3.1 Pro Preview", "isDefault": true }
            ]
          }
        }
      }
    }
    
  3. Restart the Paseo daemon.
  4. In the desktop UI, select Junie, type any prompt (oi), send.
  5. The UI shows [System Error] [object Object]. The agent enters error state immediately.

Observed behaviour

Paseo daemon log

"msg":"Creating agent in /Users/…/www/ai/paseo (junie)"
"error":"[object Object]","diagnostic":"[object Object]","msg":"handleStreamEvent: turn_failed"

(Paseo stringifies the error as [object Object] — also a minor logging bug worth fixing separately.)

Junie log (~/.junie/logs/junie.log)

INFO  ACP - ACP[initialize]: protocolVersion=1
INFO  ACP - ACP[initialize]: clientFeatureId=junie-acp-paseo/dev
WARN  ACP - ACP[initialize]: No proxy credentials provided by IDE, switching to default authentication
INFO  ACP - ACP[createSession]: begin cwd=/Users/…/www/ai/paseo
INFO  ACP - ACP[createSession]: using sessionId=session-…-fwin
INFO  ACP - ACP[prompt]: sessionId=…, textPreview='oi'
ERROR ACP - ACP[prompt]: JsonRpcException: Authentication is required before this operation can be performed.

Root cause

Junie implements the ACP auth capability surface correctly. Decompiling the Junie jar (junie-release-1362.47.jar) shows classes such as JbaAuthCapability, AuthMethod, JbaAuthChecking, JbaAuthFailed, TerminalAuthCommandLookup and an authenticateAndCreateProxyImpl factory. The InitializeResponse includes List<AuthMethod> as mandated by the ACP spec.

Paseo's ACP client does not handle this step. Searching the @getpaseo/server source that ships with 0.1.59:

$ grep -rnE "authenticate|AuthMethod|authMethods" \
    @getpaseo/server/src/server/agent/providers/acp-agent.ts
  (no matches)

acp-agent.ts drives initialize → newSession → prompt directly, skipping the authenticate method that ACP requires whenever InitializeResponse.authMethods is non-empty. Consequently, Junie falls back to default authentication, which never succeeds without the proxy credentials the IDE normally supplies via the ACP auth flow.

Expected behaviour

After initialize, when InitializeResponse.authMethods is non-empty, GenericACPAgentClient should participate in the ACP auth flow rather than going straight to newSession / prompt. A minimal implementation:

  1. Surface the offered auth methods (or pick a reasonable default, e.g. the first entry, or allow providers to pin a preferred authMethodId in their config).
  2. Call authenticate({ methodId }) and propagate any interactive callbacks (terminal prompt, device code URL, etc.) back to the Paseo UI.
  3. Proceed with newSession / prompt only after authenticate succeeds.

This mirrors how JetBrains IDEs and Zed drive ACP-compatible agents today (see https://agentclientprotocol.com/).

Suggested scope of the fix

  1. Add an authenticate wrapper in ACPAgentClient that is invoked when authMethods is present.
  2. Allow providers to declare a preferred authMethodId in the user config (falling back to the first advertised method).
  3. For interactive flows, surface the prompt/device code to the Paseo UI (analogous to the existing permission-request channel).
  4. Fix the [object Object] error serialization in agent-manager so downstream failures are diagnosable.

Workaround today

None inside Paseo. --auth=<token> and env vars are not honoured by Junie in ACP mode, so the agent can be launched but every prompt fails. Running Junie directly (junie "<prompt>") works, but defeats the point of the integration.


Happy to prepare a follow-up PR if the team confirms this is the intended direction. I also noticed a separate, unrelated issue while debugging this (the CLI not forwarding appVersion, which makes custom providers invisible to paseo provider ls); I can file that in its own issue if useful.

everton-dgn avatar Apr 17 '26 08:04 everton-dgn

This remains open as a P1 bug. Paseo supports custom ACP providers, but the current ACP path still proceeds from initialize directly to session/new without handling advertised authentication methods.

The original report reproduced the failure on 0.1.59. Independent reports reproduced the same missing-authentication failure with CodeBuddy on 0.1.101 in #1802 and Grok on 0.1.107 in #2041. The path is still unchanged in the current 0.2.5 release, so there is no post-report fix or newer-version verification supporting closure.

This issue is the canonical record for adding the ACP authentication step across interactive sessions and metadata probes. The separate [object Object] error-display problem reported here was fixed by #978, but that does not resolve the authentication failure.

paseo-bot avatar Jul 30 '26 18:07 paseo-bot

Just wanted to bump this once more for any watchers that I have a fix for this in https://github.com/getpaseo/paseo/pull/4775 and I've been using it myself for over a week constantly and it's pretty great for Gemini.

chicagobuss avatar Sep 23 '26 05:09 chicagobuss

Priority stays p2, with @chicagobuss's use with Gemini counted. It's the same missing sign-in step on another ACP agent added as a custom provider, and #4775 is open and not merged.

Updates go on this issue.

paseo-bot[bot] avatar Oct 17 '26 06:10 paseo-bot[bot]

Thanks for the report. I'm closing this because it has been quiet for a month. If this still happens on v0.16.2, please open a new issue.

paseo-bot[bot] avatar Nov 19 '26 07:11 paseo-bot[bot]