Skip to content

feat: support new PRTS copilot URI format - #569

Merged
wangl-cc merged 4 commits into
mainfrom
codex/prts-copilot-uri
Aug 19, 2026
Merged

feat: support new PRTS copilot URI format#569
wangl-cc merged 4 commits into
mainfrom
codex/prts-copilot-uri

Conversation

@wangl-cc

@wangl-cc wangl-cc commented Jul 28, 2026

Copy link
Copy Markdown
Member

Summary

Support the new PRTS.plus copilot URI format while keeping legacy codes usable during migration.

Changes

  • parse prts://<id> as a single copilot task
  • parse prts://s<id> as a copilot task set
  • continue parsing legacy maa:// codes with a deprecation warning
  • cover new, legacy, invalid, and whitespace parser inputs

Validation

  • cargo +nightly fmt
  • cargo clippy
  • cargo test -p maa-cli (308 passed, 26 ignored)
  • cargo x test --no-core-tests

Summary by Sourcery

在保持对旧版 MA URI 代码的迁移路径的同时,支持新的 PRTS copilot URI 格式。

新功能:

  • 支持解析 prts://<id> copilot 任务 URI 和 prts://s<id> copilot 任务集 URI。

改进:

  • 在继续支持旧版 maa:// copilot URI 的同时,输出一次性弃用警告。
  • 在保留本地路径解析的前提下,一致地规范化周围的空白字符。

测试:

  • 扩展 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:

  • Support parsing prts://<id> copilot task URIs and prts://s<id> copilot task-set URIs.

Enhancements:

  • Preserve support for legacy maa:// copilot URIs while emitting a one-time deprecation warning.
  • Normalize surrounding whitespace consistently while retaining local path parsing.

Tests:

  • Expand URI parsing coverage for new, legacy, invalid, and whitespace-padded inputs.

新功能:

  • 支持解析 prts://<id> 助理任务 URI 和 prts://s<id> 助理任务集 URI。

改进:

  • 保持传统 maa:// 助理 URI 可用,同时发出一次性的弃用警告。
  • 一致地处理 URI 中的空白字符,并保留本地路径解析逻辑。

测试:

  • 扩展对新格式、传统格式、无效格式以及带空白填充输入的助理 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 的同时,输出一次性弃用警告。
  • 在保留本地路径解析的前提下,一致地规范化周围的空白字符。

测试:

  • 扩展 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:

  • Support parsing prts://<id> copilot task URIs and prts://s<id> copilot task-set URIs.

Enhancements:

  • Preserve support for legacy maa:// copilot URIs while emitting a one-time deprecation warning.
  • Normalize surrounding whitespace consistently while retaining local path parsing.

Tests:

  • Expand URI parsing coverage for new, legacy, invalid, and whitespace-padded inputs.

新功能:

  • 增加对解析 prts://<id>prts://s<id> URI 的支持,将其转换为远程 copilot 任务和任务集。

改进:

  • 统一远程 copilot URI 解析逻辑,并在使用旧版 maa:// URI 时输出弃用警告。

测试:

  • 扩展 copilot 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 的同时,输出一次性弃用警告。
  • 在保留本地路径解析的前提下,一致地规范化周围的空白字符。

测试:

  • 扩展 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:

  • Support parsing prts://<id> copilot task URIs and prts://s<id> copilot task-set URIs.

Enhancements:

  • Preserve support for legacy maa:// copilot URIs while emitting a one-time deprecation warning.
  • Normalize surrounding whitespace consistently while retaining local path parsing.

Tests:

  • Expand URI parsing coverage for new, legacy, invalid, and whitespace-padded inputs.

新功能:

  • 支持解析 prts://<id> 助理任务 URI 和 prts://s<id> 助理任务集 URI。

改进:

  • 保持传统 maa:// 助理 URI 可用,同时发出一次性的弃用警告。
  • 一致地处理 URI 中的空白字符,并保留本地路径解析逻辑。

测试:

  • 扩展对新格式、传统格式、无效格式以及带空白填充输入的助理 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 的同时,输出一次性弃用警告。
  • 在保留本地路径解析的前提下,一致地规范化周围的空白字符。

测试:

  • 扩展 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:

  • Support parsing prts://<id> copilot task URIs and prts://s<id> copilot task-set URIs.

Enhancements:

  • Preserve support for legacy maa:// copilot URIs while emitting a one-time deprecation warning.
  • Normalize surrounding whitespace consistently while retaining local path parsing.

Tests:

  • Expand URI parsing coverage for new, legacy, invalid, and whitespace-padded inputs.

Closes #577

Copilot AI review requested due to automatic review settings July 28, 2026 11:23

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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`,以便让解析路径和意图更加清晰。

Sourcery 对开源项目是免费的 —— 如果你喜欢我们的代码审查,请考虑分享给更多人 ✨
帮我变得更有用!请在每条评论上点选 👍 或 👎,我会根据你的反馈来改进后续的审查。
Original comment in English

Hey - I've left some high level feedback:

  • 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.
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.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 72.36%. Comparing base (dc7d1a9) to head (00b5ef5).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
crates/maa-cli/src/run/preset/copilot.rs 94.11% 0 Missing and 1 partial ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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) and prts://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.

Comment thread crates/maa-cli/src/run/preset/copilot.rs Outdated
Comment thread crates/maa-cli/src/run/preset/copilot.rs
Copilot AI review requested due to automatic review settings July 28, 2026 19:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@wangl-cc
wangl-cc enabled auto-merge August 19, 2026 10:50
@wangl-cc
wangl-cc added this pull request to the merge queue Aug 19, 2026
Merged via the queue into main with commit aebb5e9 Aug 19, 2026
25 checks passed
@wangl-cc
wangl-cc deleted the codex/prts-copilot-uri branch August 19, 2026 11:09
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