fix: include idle-only input in runtime API contract

This commit is contained in:
2026-10-02 03:33:30 +09:00
parent d5f49cbf00
commit d0ea9f598d
3 changed files with 49 additions and 8 deletions
+22
View File
@@ -6341,6 +6341,28 @@ mod tests {
assert_eq!(delivered.content, archive.content);
}
#[test]
fn runtime_input_contract_preserves_every_input_kind() {
for kind in [
EmbeddedWorkerInputKind::User,
EmbeddedWorkerInputKind::UserIfIdle,
EmbeddedWorkerInputKind::Notify,
EmbeddedWorkerInputKind::Compact,
EmbeddedWorkerInputKind::ListRewindTargets,
EmbeddedWorkerInputKind::RegisterPeer,
] {
let input = EmbeddedWorkerInput {
kind,
content: "contract test".to_string(),
submission_request_id: Some("contract-request".to_string()),
segments: Some(vec![protocol::Segment::text("contract test")]),
};
let wire: runtime_api::WorkerInput = runtime_contract_convert(input.clone()).unwrap();
let decoded: EmbeddedWorkerInput = runtime_contract_convert(wire).unwrap();
assert_eq!(decoded, input);
}
}
#[test]
fn remote_profile_source_uses_workspace_config_archive_reference() {
let request = embedded_spawn_request();