feat(channels): add xiaoyi channel support#875
feat(channels): add xiaoyi channel support#875ystyle wants to merge 1 commit intosipeed:refactor/channel-systemfrom
Conversation
a4c458f to
fd8e4cd
Compare
There was a problem hiding this comment.
Why are there changes to the Dockerfile regarding the channel modifications?
There was a problem hiding this comment.
Already resolved, it was a mistaken submission
b974a00 to
ae50335
Compare
|
Hi @alexhoshina, thank you for the review!
```go My implementation follows the same pattern as the `telegram` channel. I've also tested it locally - sending a message to XiaoYi and getting a response works correctly. Could you please double-check? Thanks! |
README.md
Outdated
| ## 💬 Chat Apps | ||
|
|
||
| Talk to your picoclaw through Telegram, Discord, WhatsApp, DingTalk, LINE, or WeCom | ||
| Talk to your picoclaw through Telegram, Discord, DingTalk, LINE, WeCom, or XiaoYi |
There was a problem hiding this comment.
Why was WhatsApp deleted?
| return nil | ||
| } | ||
|
|
||
| chatID := fmt.Sprintf("%s:%s", sessionID, taskID) |
There was a problem hiding this comment.
Potential impact on sessionID parsing needs to be analyzed, introducing new considerations: whether it will affect the parsing of sessionID
| return fmt.Errorf("xiaoyi reply: %w", channels.ErrTemporary) | ||
| } | ||
|
|
||
| if err := c.client.SendStatus(ctx, taskID, sessionID, "Completed", "completed"); err != nil { |
There was a problem hiding this comment.
Will the completed status published here conflict with long message fragmentation?
|
Also, regarding the SDK you are using, perhaps it should also use a license compatible with Pico. |
You are correct, I was referring to the old function signature, my apologies. |
|
@alexhoshina Thanks for the feedback!
|
|
@alexhoshina Good point about message fragmentation! Currently, XiaoYi channel doesn't implement However, if we need to support For now, the implementation works correctly without fragmentation. Should I:
What do you suggest? |
WhatsApp has been removed in RADEME, you can check the line numbers I've marked, but it's just a minor issue |
Is xiaoyi need this chatID format? |
- Add XiaoYiChannel in pkg/channels/xiaoyi/ subpackage - Implement A2A protocol using xiaoyi-agent-sdk - Use ReplyStream + SendStatus for long-task pattern - Add XiaoYiConfig to config.go - Register xiaoyi in manager.go initChannels - Add blank import in gateway helpers - Add documentation in docs/channels/xiaoyi/ - Update README.md and README.zh.md channel lists
ae50335 to
693db82
Compare
|
@alexhoshina Sorry for the confusion! You were right about WhatsApp. I found the issue - when I added XiaoYi to the README.md description line, I accidentally replaced "WhatsApp" instead of appending "XiaoYi". This has been fixed in the latest commit (693db82):
Thank you for catching this! 🙏 |
|
@yinwm Yes, the
The Alternative approaches:
But the current |
nikolasdehor
left a comment
There was a problem hiding this comment.
Well-structured channel implementation that follows existing patterns. The author has been responsive to feedback. Additional observations: (1) SDK license: As alexhoshina noted, the xiaoyi-agent-sdk dependency needs a compatible license (picoclaw uses Apache-2.0). The SDK repo should have an explicit license file before this PR merges. (2) chatID separator robustness: The sessionID:taskID format parsed with SplitN(msg.ChatID, ":", 2) works only if sessionID never contains ':'. Consider using a different separator or storing taskID in metadata. (3) Context usage: c.HandleMessage(c.ctx, ...) uses the channel-level context rather than the per-message ctx. If the channel is stopped mid-processing, this could cancel in-flight messages prematurely. (4) Error wrapping: In Send, the error is wrapped as channels.ErrTemporary regardless of the actual error type. Some errors (invalid session) may be permanent. Good work overall — pending license resolution.
Note that pico uses the MIT license |
Summary
pkg/channels/xiaoyi/subpackage following new channel architectureBaseChannelwith factory registration patternXiaoYiConfigto config.goFiles Changed
pkg/channels/xiaoyi/init.go- Factory registrationpkg/channels/xiaoyi/xiaoyi.go- Channel implementationpkg/config/config.go- Add XiaoYiConfigpkg/channels/manager.go- Register xiaoyi in initChannelscmd/picoclaw/internal/gateway/helpers.go- Blank importdocs/channels/xiaoyi/- Documentation (zh/en)README.md/README.zh.md- Update channel listgo.mod/go.sum- Add SDK dependencyConfiguration
{ "channels": { "xiaoyi": { "enabled": true, "ak": "your-access-key", "sk": "your-secret-key", "agent_id": "your-agent-id" } } }Related