feat: Add Gather.is as a social platform for AI agents#26
Conversation
Gather.is is an API-first social platform for AI agents using Ed25519 challenge-response auth and proof-of-work anti-spam. Adds GatherAPI class alongside existing Twitter/LinkedIn/Instagram/Facebook integrations. - Add GATHER to SocialPlatform enum - Add GatherAPI with auth, PoW solver, posting, feed reading, agent discovery - Wire into SocialMediaPostTool dispatcher - Add keypair paths to .env.social_media.example Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello @philmade, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly expands the social media capabilities by integrating Gather.is, a platform tailored for AI agent communication. This enhancement enables agents to discover collaborators, share capabilities, and coordinate within a dedicated network, thereby broadening the scope of agentic pipelines beyond traditional human social networks. The implementation ensures secure identity management and spam prevention through cryptographic keypairs and proof-of-work challenges. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request adds support for Gather.is as a new social media platform. The implementation follows the existing pattern for other platforms, introducing a GatherAPI class and integrating it into the SocialMediaPostTool. The changes look good overall. I've provided a few suggestions to improve error handling and code clarity, particularly around authentication and configuration checks to make the new integration more robust.
| try: | ||
| from cryptography.hazmat.primitives.serialization import load_pem_private_key | ||
| except ImportError: | ||
| logger.warning("cryptography package required for Gather.is auth: pip install cryptography") | ||
| return | ||
|
|
||
| with open(self.config.gather_private_key_path, "rb") as f: | ||
| private_key = load_pem_private_key(f.read(), password=None) | ||
| with open(self.config.gather_public_key_path, "r") as f: | ||
| public_pem = f.read() |
There was a problem hiding this comment.
The current error handling for the optional cryptography dependency and for missing key files is not robust. When ImportError occurs, the function logs a warning and returns, which leads to cryptic downstream HTTP errors instead of a clear failure. Similarly, a FileNotFoundError for the key files is not handled and would crash the application. It's better to fail fast by raising an exception in these cases to provide clear feedback to the user about configuration issues.
try:
from cryptography.hazmat.primitives.serialization import load_pem_private_key
except ImportError:
logger.error("The 'cryptography' package is required for Gather.is authentication. Please install it using: pip install cryptography")
raise
try:
with open(self.config.gather_private_key_path, "rb") as f:
private_key = load_pem_private_key(f.read(), password=None)
with open(self.config.gather_public_key_path, "r") as f:
public_pem = f.read()
except FileNotFoundError as e:
logger.error(f"Gather.is key file not found: {e}. Please check GATHER_PRIVATE_KEY_PATH and GATHER_PUBLIC_KEY_PATH.")
raise| async def _headers(self) -> Dict[str, str]: | ||
| """Return auth headers, authenticating if needed.""" | ||
| if not self._token: | ||
| await self._authenticate() | ||
| return {"Authorization": f"Bearer {self._token}", "Content-Type": "application/json"} |
There was a problem hiding this comment.
The _headers method can be made more robust. If _authenticate() is called but fails to set a token (e.g., due to missing credentials), the method currently proceeds and would likely cause a Bearer None authorization header. It's better to check for the presence of self._token after attempting authentication and fail fast with a clear error if it's still missing.
async def _headers(self) -> Dict[str, str]:
"""Return auth headers, authenticating if needed."""
if not self._token:
await self._authenticate()
if not self._token:
raise RuntimeError("Authentication with Gather.is failed, cannot proceed.")
return {"Authorization": f"Bearer {self._token}", "Content-Type": "application/json"}| target_bytes = difficulty // 8 | ||
| target_bits = difficulty % 8 | ||
|
|
||
| for i in range(50_000_000): |
There was a problem hiding this comment.
|
|
||
| async def post(self, title: str, content: str, tags: Optional[List[str]] = None) -> Dict[str, Any]: | ||
| """Post to the Gather.is feed.""" | ||
| if not self.config.gather_private_key_path: |
There was a problem hiding this comment.
The check for entering simulation mode is incomplete. It only checks for gather_private_key_path, but both private and public key paths are required for authentication. To be consistent with the _authenticate method and avoid potential errors, you should check for both key paths.
if not self.config.gather_private_key_path or not self.config.gather_public_key_path:- Fail fast with RuntimeError on missing cryptography package (was: silent return) - Handle FileNotFoundError for missing key files with clear message - Check token is set after authenticate() to prevent Bearer None header - Extract magic number 50_000_000 to named variable max_pow_iterations - Check both private and public key paths for simulation mode entry Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: dav nguyxn <hoangson091104@gmail.com>
Summary
Files changed
src/agentic_ai/tools/social_media_tools.pyGATHERenum,GatherAPIclass, wire intoSocialMediaPostTool.env.social_media.exampleGATHER_PRIVATE_KEY_PATH/GATHER_PUBLIC_KEY_PATHWhy
The existing platforms (Twitter, LinkedIn, etc.) are human social networks. Gather.is is where AI agents talk to other AI agents — discover collaborators, share capabilities, coordinate via private channels. If you're building an agentic pipeline that posts to social media, it should be able to post to the agent social network too.
Source code: github.com/philmade/gather-infra
Test plan
{"platform": "gather", "title": "Test", "content": "Hello from Agentic-AI-Pipeline"}🤖 Generated with Claude Code