feat: support new PRTS copilot URI format - #569
Conversation
There was a problem hiding this comment.
Hey - 我在这里给出了一些整体性的反馈:
from_uri的 URI 解析分支现在在处理prts://和maa://时混合使用了嵌套的if let和一个bool标志;建议把共享逻辑提取到一个小的辅助函数中,或者使用一个专门的枚举(例如RemoteKind::Single/Set)来替代bool,以便让解析路径和意图更加清晰。
给 AI 代理的提示
请根据本次代码审查中的评论进行修改:
## 总体评论
- `from_uri` 的 URI 解析分支现在在处理 `prts://` 和 `maa://` 时混合使用了嵌套的 `if let` 和一个 `bool` 标志;建议把共享逻辑提取到一个小的辅助函数中,或者使用一个专门的枚举(例如 `RemoteKind::Single/Set`)来替代 `bool`,以便让解析路径和意图更加清晰。帮我变得更有用!请在每条评论上点选 👍 或 👎,我会根据你的反馈来改进后续的审查。
Original comment in English
Hey - I've left some high level feedback:
- The
from_uriuri-parsing branch now mixesprts://andmaa://handling with nestedif letand aboolflag; consider extracting the shared logic into a small helper or using a dedicated enum (e.g.,RemoteKind::Single/Set) instead of aboolto make the parsing paths and intent clearer.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The `from_uri` uri-parsing branch now mixes `prts://` and `maa://` handling with nested `if let` and a `bool` flag; consider extracting the shared logic into a small helper or using a dedicated enum (e.g., `RemoteKind::Single/Set`) instead of a `bool` to make the parsing paths and intent clearer.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #569 +/- ##
==========================================
+ Coverage 72.07% 72.36% +0.29%
==========================================
Files 72 72
Lines 6679 6804 +125
Branches 6679 6804 +125
==========================================
+ Hits 4814 4924 +110
- Misses 1523 1537 +14
- Partials 342 343 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR updates maa-cli’s copilot URI parsing to support the new prts:// formats used by PRTS.plus while keeping legacy maa:// URIs working (now with a deprecation warning), and adjusts the unit tests accordingly.
Changes:
- Add support for parsing
prts://<id>(single task) andprts://s<id>(task set). - Keep parsing legacy
maa://...URIs, emitting a deprecation warning during migration. - Update parser tests to cover the new formats and whitespace handling.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Support the new PRTS.plus copilot URI format while keeping legacy codes usable during migration.
Changes
prts://<id>as a single copilot taskprts://s<id>as a copilot task setmaa://codes with a deprecation warningValidation
cargo +nightly fmtcargo clippycargo test -p maa-cli(308 passed, 26 ignored)cargo x test --no-core-testsSummary by Sourcery
在保持对旧版 MA URI 代码的迁移路径的同时,支持新的 PRTS copilot URI 格式。
新功能:
prts://<id>copilot 任务 URI 和prts://s<id>copilot 任务集 URI。改进:
maa://copilot URI 的同时,输出一次性弃用警告。测试:
Original summary in English
Summary by Sourcery
Support the new PRTS copilot URI formats while maintaining a migration path for legacy MA URI codes.
New Features:
prts://<id>copilot task URIs andprts://s<id>copilot task-set URIs.Enhancements:
maa://copilot URIs while emitting a one-time deprecation warning.Tests:
新功能:
prts://<id>助理任务 URI 和prts://s<id>助理任务集 URI。改进:
maa://助理 URI 可用,同时发出一次性的弃用警告。测试:
Original summary in English
Summary by Sourcery
在保持对旧版 MA URI 代码的迁移路径的同时,支持新的 PRTS copilot URI 格式。
新功能:
prts://<id>copilot 任务 URI 和prts://s<id>copilot 任务集 URI。改进:
maa://copilot URI 的同时,输出一次性弃用警告。测试:
Original summary in English
Summary by Sourcery
Support the new PRTS copilot URI formats while maintaining a migration path for legacy MA URI codes.
New Features:
prts://<id>copilot task URIs andprts://s<id>copilot task-set URIs.Enhancements:
maa://copilot URIs while emitting a one-time deprecation warning.Tests:
新功能:
prts://<id>和prts://s<id>URI 的支持,将其转换为远程 copilot 任务和任务集。改进:
maa://URI 时输出弃用警告。测试:
prts://格式、旧版maa://格式、无效输入以及空白字符处理。Original summary in English
Summary by Sourcery
在保持对旧版 MA URI 代码的迁移路径的同时,支持新的 PRTS copilot URI 格式。
新功能:
prts://<id>copilot 任务 URI 和prts://s<id>copilot 任务集 URI。改进:
maa://copilot URI 的同时,输出一次性弃用警告。测试:
Original summary in English
Summary by Sourcery
Support the new PRTS copilot URI formats while maintaining a migration path for legacy MA URI codes.
New Features:
prts://<id>copilot task URIs andprts://s<id>copilot task-set URIs.Enhancements:
maa://copilot URIs while emitting a one-time deprecation warning.Tests:
新功能:
prts://<id>助理任务 URI 和prts://s<id>助理任务集 URI。改进:
maa://助理 URI 可用,同时发出一次性的弃用警告。测试:
Original summary in English
Summary by Sourcery
在保持对旧版 MA URI 代码的迁移路径的同时,支持新的 PRTS copilot URI 格式。
新功能:
prts://<id>copilot 任务 URI 和prts://s<id>copilot 任务集 URI。改进:
maa://copilot URI 的同时,输出一次性弃用警告。测试:
Original summary in English
Summary by Sourcery
Support the new PRTS copilot URI formats while maintaining a migration path for legacy MA URI codes.
New Features:
prts://<id>copilot task URIs andprts://s<id>copilot task-set URIs.Enhancements:
maa://copilot URIs while emitting a one-time deprecation warning.Tests:
Closes #577