Violated contract: "ic0_msg_cycles_available128" cannot be executed in replicated query mode

Running by make stress-test in stress-test/ directory I get weird error message (below). Please explain what it means and how to get rid of this error.

dfx canister call stresser main '()'
Error: Failed update call.
Caused by: Failed update call.
  The replica returned a replica error: Replica Error: reject code CanisterReject, reject message IC0504: Canister be2us-64aaa-aaaaa-qaabq-cai violated contract: "ic0_msg_cycles_available128" cannot be executed in replicated query mode, error code None

are you trying to perform inter canister calls from the method marked as query?

Probably. But why then the error is not caught at compilation stage?

Apparently, the error was caused by ExperimentalCycles.accept() in a query function.

We would need a stronger type system or dedicated syntax for cycles management.

The current library based approach leads to dynamic errors but was adopted at the time because the design of cycles on the platform was in flux so we didn’t want to prematurely extend the language.

It’s probably time to do something better.