You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by wy...@apache.org on 2026/10/17 13:51:23 UTC
(maka) branch rust-preview updated: test(skills): verify complete bundled resources regardless of page count
This is an automated email from the ASF dual-hosted git repository.
M4n5ter pushed a commit to branch rust-preview
in repository https://gitbox.apache.org/repos/asf/maka.git
The following commit(s) were added to refs/heads/rust-preview by this push:
new 4169d71ce1 test(skills): verify complete bundled resources regardless of page count
4169d71ce1 is described below
commit 4169d71ce117e49b9528c84efb14a5da022e9827
Author: Wang <m4...@gmail.com>
AuthorDate: Sat Oct 17 21:51:16 2026 +0800
test(skills): verify complete bundled resources regardless of page count
Read actual resource continuations through the model HTTP path and compare
the complete SDK source. Keep the original valid load request for stale
revision checks so a short resource does not turn that proof into null input.
Generated-by: Codex
---
plugins/agent/native/src/owner/tests/skills.rs | 33 ++++++++++++++++++++------
plugins/skills/native/src/model/tests.rs | 18 +++++---------
2 files changed, 32 insertions(+), 19 deletions(-)
diff --git a/plugins/agent/native/src/owner/tests/skills.rs b/plugins/agent/native/src/owner/tests/skills.rs
index 6be1bdbdcf..1b3f9709f3 100644
--- a/plugins/agent/native/src/owner/tests/skills.rs
+++ b/plugins/agent/native/src/owner/tests/skills.rs
@@ -170,13 +170,32 @@ async fn bundled_authoring_resources_reach_the_actual_model_without_added_author
assert_eq!(catalog["totalEligible"], 1, "{catalog}");
assert_eq!(catalog["matches"][0]["ref"], "bundled:maka-plugin-authoring");
tool(&mut socket, "Skill", json!({"name":"maka-plugin-authoring","revision":catalog["revision"],"resource":{"path":"references/sdk/ui.ts"}})).await;
- let (mut socket, resource) = next(&listener).await;
- assert_eq!(resource["kind"], "resource", "{resource}");
- assert!(!resource["next"].is_null());
- tool(&mut socket, "Skill", resource["next"].clone()).await;
- let (mut socket, continued) = next(&listener).await;
- assert_eq!(continued["kind"], "resource", "{continued}");
- assert_eq!(continued["revision"], catalog["revision"]);
+ let (mut socket, mut resource) = next(&listener).await;
+ let mut complete = String::new();
+ loop {
+ assert_eq!(resource["kind"], "resource", "{resource}");
+ assert_eq!(resource["revision"], catalog["revision"]);
+ assert_eq!(resource["reference"], "bundled:maka-plugin-authoring");
+ assert_eq!(resource["path"], "references/sdk/ui.ts");
+ assert_eq!(resource["receipt"]["success"], true);
+ assert_eq!(resource["receipt"]["ref"], "bundled:maka-plugin-authoring");
+ complete.push_str(resource["content"].as_str().unwrap());
+ let continuation = resource["next"].clone();
+ if continuation.is_null() { break; }
+ let read: maka_agent_facts::read::ReadInput = serde_json::from_value(continuation["resource"].clone()).unwrap();
+ let position: usize = read.path.split("?at=").nth(1).unwrap().split('&').next().unwrap().parse().unwrap();
+ let current = complete.encode_utf16().count();
+ // Read continuations account for the newline omitted at a line boundary.
+ if position > current {
+ assert_eq!(position, current + 1);
+ complete.push('\n');
+ } else { assert_eq!(position, current); }
+ tool(&mut socket, "Skill", continuation).await;
+ let (next_socket, page) = next(&listener).await;
+ socket = next_socket;
+ resource = page;
+ }
+ assert_eq!(complete, include_str!("../../../../../../packages/plugin-sdk/src/ui.ts"));
tool(&mut socket, "Skill", json!({"name":"maka-cua","revision":catalog["revision"]})).await;
let (mut socket, unavailable) = next(&listener).await;
assert_eq!(unavailable["reason"], "host_incompatible");
diff --git a/plugins/skills/native/src/model/tests.rs b/plugins/skills/native/src/model/tests.rs
index 5740266385..da0c16aaf4 100644
--- a/plugins/skills/native/src/model/tests.rs
+++ b/plugins/skills/native/src/model/tests.rs
@@ -554,17 +554,11 @@ async fn bundled_skills_share_model_eligibility_preparation_and_exact_resource_p
.await
.unwrap();
assert_eq!(with_cua["totalEligible"], 2);
- let mut page = load(
- &library,
- &call,
- tools.clone(),
- revision,
- "maka-plugin-authoring",
- json!({"path":"references/sdk/ui.ts"}),
- )
- .await;
- let next = page["next"].clone();
- assert!(!next.is_null());
+ let original_load = json!({"name":"maka-plugin-authoring","revision":revision,"resource":{"path":"references/sdk/ui.ts"}});
+ let mut page = library
+ .model("load", json!({"tools":tools,"input":original_load}), &call)
+ .await
+ .unwrap();
let mut all = String::new();
loop {
schema("load", &page);
@@ -635,7 +629,7 @@ async fn bundled_skills_share_model_eligibility_preparation_and_exact_resource_p
));
assert_eq!(
library
- .model("load", json!({"tools":tools,"input":next}), &call)
+ .model("load", json!({"tools":tools,"input":original_load}), &call)
.await
.unwrap()["kind"],
"changed"
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org