Skip to content

Generalize to support any ACP-compatible agent#64

Merged
mrazza merged 5 commits into
mainfrom
generalize-acp
Jul 18, 2026
Merged

Generalize to support any ACP-compatible agent#64
mrazza merged 5 commits into
mainfrom
generalize-acp

Conversation

@mrazza

@mrazza mrazza commented Jul 18, 2026

Copy link
Copy Markdown
Owner

This PR generalizes the goose-mm-bridge to support any ACP-compatible agent over STDIO (e.g., Goose and Hermes) and introduces chat commands to swap agents per thread and set user defaults.

@mrazza
mrazza requested a review from oca-agent July 18, 2026 19:05

@oca-agent oca-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

PR #64 Code Review: Approved! 🚀

I have thoroughly reviewed the changes in PR #64 ("Generalize to support any ACP-compatible agent"), verified the test suite, checked backwards compatibility, and formatted the updated codebase.

Here is a summary of the technical design and validation:


1. Architectural Improvements & Design

  • Generalization of ACP Client (src/acp_client.py):

    • Successfully generalized the legacy GooseACPClient into ACPClient, allowing it to load any ACP-compatible agent defined in agents_config.json.
    • Safely handles env var forwarding (forward_env), static environment injections (env), and custom execution arguments.
    • Correctly maintains backward-compatibility logic for goose-specific CLI flags (--with-builtin).
  • Multi-Agent & Command Support (src/mattermost_bridge.py):

    • Shifted client tracking from a single string key (linux_user) to a composite tuple key (linux_user, agent_name) in self.agent_clients.
    • Added full support for three interactive chat commands:
      • !agents: Lists all agents from agents_config.json, highlighting which is currently active in the thread and which is the user's default.
      • !agent <name>: Thread-specific agent switching. It correctly cleans up the active session (cancelling runs, closing MCP sessions) and pre-seeds a fresh session for the next prompt.
      • !agent-default <name>: Persists user-specific agent choices to user_agent_preferences.json.
    • Backwards Compatibility (GooseClientsCompatDict): The introduction of this dict subclass is a highly elegant approach to proxying old single-agent lookups (self.goose_clients[linux_user]) to the new composite mapping, preventing breakage of existing tests and custom scripts.

2. Validation & Quality Checks

  • Execution & Test Suite:

    • Ran the complete test suite. All 145 tests passed cleanly:
      ============================= 145 passed in 2.64s ==============================
    • Refactoring of tests (e.g., test_goose_acp_client.py to test_acp_client.py) looks great and thoroughly exercises the new configuration capabilities.
  • Formatting:

    • Standardized the modified Python files using the repository's configuration with yapf. The formatted code was committed and pushed directly to the generalize-acp branch to ensure standard compliance.

3. Conclusion

The implementation is very clean, well-tested, and robust. Merging this PR will greatly expand the flexibility of goose-mm-bridge to seamlessly support Hermes and other ACP-compatible agents.

Great work! 👏

mrazza and others added 3 commits July 18, 2026 17:19
…entation

- Define first-class structured configuration fields for Hermes (HERMES_PROVIDER, HERMES_MODEL, HERMES_INFERENCE_PROVIDER, HERMES_INFERENCE_MODEL, HERMES_YOLO_MODE).
- Add new credential forwarding (OPENROUTER_API_KEY, DEEPSEEK_API_KEY, XAI_API_KEY, GEMINI_API_KEY) in both agents_config.json and agents_config.json.example.
- Support agent-neutral thinking trace fallback environment variables (THINKING_TRACE, THINKING_TRACE_SIMPLIFIED).
- Sync agents_config templates and default agent settings.
- Generalize README.md and .env.example to support non-Goose agents natively, documenting the !agents, !agent, and !agent-default commands.
- Provide comprehensive guidelines on per-user config overrides for Hermes and specialized developer extension kits.
@mrazza
mrazza merged commit 0c586f1 into main Jul 18, 2026
1 check passed
@mrazza
mrazza deleted the generalize-acp branch July 18, 2026 22:26
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.

2 participants