Skip to content

feat(channels): add Xianyu(闲鱼) support#181

Open
wby1121 wants to merge 5 commits intoPanniantong:mainfrom
wby1121:codex-xianyu-config-finish
Open

feat(channels): add Xianyu(闲鱼) support#181
wby1121 wants to merge 5 commits intoPanniantong:mainfrom
wby1121:codex-xianyu-config-finish

Conversation

@wby1121
Copy link
Copy Markdown

@wby1121 wby1121 commented Mar 19, 2026

Summary

This PR adds Xianyu support through a new XianyuChannel.

The integration is built on top of mcporter with the Node-based mcp-goofish backend. It adds:

  • Xianyu / Goofish URL detection
  • health checks for Node.js, mcporter, and MCP availability
  • optional setup guidance in the CLI and install docs
  • test coverage for channel registration and health-check behavior

Auth / setup

This integration is not zero-config.

It requires:

  • Node.js 18+
  • mcporter
  • mcp-goofish
  • authenticated Xianyu cookies / session configured for the MCP backend

Dependencies

No new Python dependency is introduced in this PR.

The only external dependency is the Node-based mcp-goofish tool used through mcporter.

Notes

I also removed files that should not have been included in the PR and rebased the branch onto the latest main.

@Panniantong
Copy link
Copy Markdown
Owner

Hi @wby1121, thanks for adding Xianyu support! The channel implementation looks interesting. 👍

Before we can merge, a few things need to be addressed:

1. Remove files that shouldn't be in the PR

  • AGENTS.md — This is a local workspace file, not part of the project. Please remove it.
  • config/mcporter.json — This contains local MCP configuration. Should not be committed.

2. Add a PR description

Please add a brief description explaining:

  • What the Xianyu channel does (which APIs it uses)
  • Whether it requires login/cookies or is zero-config
  • Any dependencies needed

3. Rebase onto latest main

The main branch has had several merges since this PR was opened. Please rebase:

git fetch upstream
git rebase upstream/main
git push --force-with-lease

Once these are addressed, we're happy to merge! 🚀

@wby1121 wby1121 force-pushed the codex-xianyu-config-finish branch from cb0f029 to e9e01c5 Compare March 26, 2026 03:00
@wby1121 wby1121 force-pushed the codex-xianyu-config-finish branch from e9e01c5 to b2e843e Compare March 26, 2026 03:19
@wby1121
Copy link
Copy Markdown
Author

wby1121 commented Mar 26, 2026

Hi @Panniantong, Thanks for the review — updated now.

I removed the extra files from the PR, rebased onto the latest main, force-pushed the branch, and added a PR description covering the Xianyu backend, auth requirements, and dependencies.

I also cleaned up the setup wording so it clearly reflects that this integration uses mcporter + mcp-goofish and requires authenticated cookies/session.

Verified with:

  • python3 -m pytest tests/test_channels.py -v
  • python3 -m pytest tests/test_cli.py -v
  • python3 -m pytest tests/test_channel_contracts.py -v

@wby1121 wby1121 changed the title Codex xianyu config finish feat(channels): add Xianyu(闲鱼) support Mar 29, 2026
Copy link
Copy Markdown
Owner

@Panniantong Panniantong left a comment

Choose a reason for hiding this comment

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

感谢贡献闲鱼 channel!核心的 xianyu.py 实现质量不错(check() 分层验证、测试覆盖完整),但这个 PR 的改动范围远超预期,有几处必须修改:

必须回滚的改动:

  1. 不能删除 XueqiuChannel(雪球)注册和测试:雪球是现有的完整功能 channel,删除会造成功能倒退。请恢复 channels/init.py 中的 XueqiuChannel,以及 tests/ 中的雪球测试。

  2. bird -> xreach 的 Twitter 工具迁移不属于本 PR 范围:这是独立的系统性变更,请拆出去单独开 PR。当前项目已迁移到 bird CLI,请勿在此 PR 中改回 xreach。

  3. CLI 功能删除(skill --install/--uninstall、format xhs、OPENCLAW_HOME 等)未在 PR 描述中说明,且这些是破坏性变更。请恢复或单独开 PR 讨论。

可以保留的改动:

  • xianyu.py 新文件 ✅
  • init.py 中添加 XianyuChannel(但不删 XueqiuChannel)✅
  • 闲鱼相关的文档和配置引导 ✅
  • TestXianyuChannel 测试 ✅

建议做法:

  1. 在此 PR 中只保留添加闲鱼 channel 的最小改动
  2. 将 Twitter 工具迁移(如果确实需要)单独开 PR
  3. 把 XueqiuChannel 恢复后重新请求 review

很期待闲鱼功能合并!

@wby1121
Copy link
Copy Markdown
Author

wby1121 commented Mar 31, 2026

已按 review 建议收敛这条 PR,感谢指出范围问题。

这次我已经把无关改动撤回,只保留“新增闲鱼 channel”的最小改动,主要调整如下:

  1. 已恢复 XueqiuChannel
  • 恢复了 agent_reach/channels/__init__.py 中的 XueqiuChannel
  • 恢复了相关雪球测试,不再删除现有完整 channel 功能
  1. 已撤出本 PR 范围外的 Twitter / CLI 变更
  • 不再改动当前主线的 bird 方案
  • 恢复了被误删的 CLI 功能,包括:
    • skill --install / --uninstall
    • format xhs
    • OPENCLAW_HOME 支持
    • doctor 的原有行为
  1. 保留的改动仅限闲鱼相关
  • 新增 agent_reach/channels/xianyu.py
  • __init__.py 中追加 XianyuChannel,不再替换现有 channel
  • 保留闲鱼相关文档与配置引导
  • 保留 TestXianyuChannel 及相关回归测试

另外我已经重新跑过测试:

python3 -m pytest tests/ -q

结果:
90 passed

现在这条 PR 应该只包含闲鱼 support 的最小必要改动。
麻烦你有空再帮我看一轮,感谢。

@wby1121 wby1121 requested a review from Panniantong March 31, 2026 08:06
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