Skip to content

fix: lazy provider creation for goose acp (#7026)#7066

Merged
codefromthecrypt merged 2 commits intomainfrom
acp-lazy-provider
Feb 8, 2026
Merged

fix: lazy provider creation for goose acp (#7026)#7066
codefromthecrypt merged 2 commits intomainfrom
acp-lazy-provider

Conversation

@codefromthecrypt
Copy link
Collaborator

@codefromthecrypt codefromthecrypt commented Feb 7, 2026

Summary

Before, goose acp crashes on startup when there is not yet Goose configuration.

This PR makes provider creation lazy until an ACP session needs it.

This also adds missing ACP authMethods is added to the initialize response so ACP clients can prompt for setup.

Type of Change

  • Bug fix

AI Assistance

  • This PR was created or reviewed with AI assistance

Testing

  • New test_initialize_without_provider test verifies configuration isn't required to initialize ACP.

  • ACP registry validation against local build:

cargo build --release -p goose-cli

# Check out the registry PR that adds goose
cd ../registry
gh pr checkout 23
rm -rf .sandbox /tmp/empty-goose-home && mkdir -p /tmp/empty-goose-home

# Place binary and dummy archive so the verifier skips the download
mkdir -p .sandbox/binary/goose/extracted
cp ../goose-2/target/release/goose .sandbox/binary/goose/extracted/goose
touch .sandbox/binary/goose/goose-aarch64-apple-darwin.tar.bz2

# Run the same auth check the registry CI runs, pointing to an empty directory
GOOSE_PATH_ROOT=/tmp/empty-goose-home uv run --python 3.12 .github/workflows/verify_agents.py --agent goose --auth-check

Example output:

$ ± |add-goose-agent ✓| → GOOSE_PATH_ROOT=/tmp/empty-goose-home uv run --python 3.12 .github/workflows/verify_agents.py --agent goose --auth-check                     
Platform: darwin-aarch64
Registry: /Users/codefromthecrypt/oss/registry
Sandbox:  /Users/codefromthecrypt/oss/registry/.sandbox

Found 10 agents

Verifying 1 agent(s): goose

[1/1] goose (binary)
  Testing binary...
    → Auth check: /Users/codefromthecrypt/oss/registry/.sandbox/binary/goose/extracted/goose acp...
    ✓ Success: Auth OK: goose-provider(agent)
    Sandbox: /Users/codefromthecrypt/oss/registry/.sandbox/binary/goose

==================================================
Summary
==================================================
  Passed:  1
  Failed:  0
  Skipped: 0

All tests passed!

Sandboxes available at: /Users/codefromthecrypt/oss/registry/.sandbox

Related Issues

Fixes #7026
Unblocks agentclientprotocol/registry#23

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes ACP startup behavior by moving provider instantiation behind a lazy ProviderConstructor, and updates ACP initialization to advertise supported auth methods so registry validation can succeed.

Changes:

  • Make provider creation lazy by passing a ProviderConstructor into GooseAcpAgent and only constructing a provider when a session needs it.
  • Add authMethods to the ACP initialize response.
  • Update goose-acp test fixtures and add a new test covering initialize without an available provider.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
crates/goose/src/providers/provider_registry.rs Exposes ProviderConstructor publicly for cross-crate use.
crates/goose-acp/src/server.rs Refactors agent construction to accept a provider factory; adds authMethods; introduces lazy provider setup via ensure_provider.
crates/goose-acp/src/server_factory.rs Updates HTTP/WS server factory to build GooseAcpAgent using ProviderConstructor.
crates/goose-acp/tests/fixtures/mod.rs Refactors in-process test server wiring to return a ready-to-use transport and adds initialize_agent helper.
crates/goose-acp/tests/fixtures/server.rs Adapts tests to the updated in-process server spawn API.
crates/goose-acp/tests/server_test.rs Adds test_initialize_without_provider and updates imports for new helpers/types.

@codefromthecrypt codefromthecrypt marked this pull request as draft February 7, 2026 03:38
@codefromthecrypt codefromthecrypt marked this pull request as ready for review February 7, 2026 09:38
Copilot AI review requested due to automatic review settings February 7, 2026 09:38
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 7 out of 8 changed files in this pull request and generated 3 comments.

goose acp crashes on startup without provider config because it eagerly
creates a provider at construction time. Make provider creation lazy via
ProviderConstructor and add authMethods to the initialize response.

Signed-off-by: Adrian Cole <adrian@tetrate.io>
Signed-off-by: Adrian Cole <adrian@tetrate.io>
@codefromthecrypt codefromthecrypt added this pull request to the merge queue Feb 8, 2026
Merged via the queue into main with commit 4e87011 Feb 8, 2026
17 of 18 checks passed
@codefromthecrypt codefromthecrypt deleted the acp-lazy-provider branch February 8, 2026 02:56
tlongwell-block added a commit that referenced this pull request Feb 9, 2026
* origin/main: (55 commits)
  test(mcp): add image tool test and consolidate MCP test fixtures (#7019)
  fix: remove Option from model listing return types, propagate errors (#7074)
  fix: lazy provider creation for goose acp (#7026) (#7066)
  Smoke tests: split compaction test and use debug build (#6984)
  fix(deps): trim bat to resolve RUSTSEC-2024-0320 (#7061)
  feat: expose AGENT_SESSION_ID env var to extension child processes (#7072)
  fix: add XML tool call parsing fallback for Qwen3-coder via Ollama (#6882)
  Remove clippy too_many_lines lint and decompose long functions (#7064)
  refactor: move disable_session_naming into AgentConfig (#7062)
  Add global config switch to disable automatic session naming (#7052)
  docs: add blog post - 8 Things You Didn't Know About Code Mode (#7059)
  fix: ensure animated elements are visible when prefers-reduced-motion is enabled (#7047)
  Show recommended model on failture (#7040)
  feat(ui): add session content search via API (#7050)
  docs: fix img url (#7053)
  Desktop UI for deleting custom providers (#7042)
  Add blog post: How I Used RPI to Build an OpenClaw Alternative (#7051)
  Remove build-dependencies section from Cargo.toml (#6946)
  add /rp-why skill blog post (#6997)
  fix: fix snake_case function names in code_execution instructions (#7035)
  ...

# Conflicts:
#	scripts/test_subrecipes.sh
lifeizhou-ap added a commit that referenced this pull request Feb 9, 2026
* main: (101 commits)
  fix: lazy provider creation for goose acp (#7026) (#7066)
  Smoke tests: split compaction test and use debug build (#6984)
  fix(deps): trim bat to resolve RUSTSEC-2024-0320 (#7061)
  feat: expose AGENT_SESSION_ID env var to extension child processes (#7072)
  fix: add XML tool call parsing fallback for Qwen3-coder via Ollama (#6882)
  Remove clippy too_many_lines lint and decompose long functions (#7064)
  refactor: move disable_session_naming into AgentConfig (#7062)
  Add global config switch to disable automatic session naming (#7052)
  docs: add blog post - 8 Things You Didn't Know About Code Mode (#7059)
  fix: ensure animated elements are visible when prefers-reduced-motion is enabled (#7047)
  Show recommended model on failture (#7040)
  feat(ui): add session content search via API (#7050)
  docs: fix img url (#7053)
  Desktop UI for deleting custom providers (#7042)
  Add blog post: How I Used RPI to Build an OpenClaw Alternative (#7051)
  Remove build-dependencies section from Cargo.toml (#6946)
  add /rp-why skill blog post (#6997)
  fix: fix snake_case function names in code_execution instructions (#7035)
  Document max_turns settings for recipes and subagents (#7044)
  feat: update Groq declarative data with Preview Models (#7023)
  ...
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.

goose acp: fails ACP registry CI — missing authMethods and crashes without provider config

2 participants