Can someone explain why the code prevents him from killing Anakin? It seemed in the movie that killing Vader was precisely Obi Wan's mission. If Vader survived he would have failed his mission, and if he eventually died he would first suffer tremendously. Killing him would be merciful, and it would also assure the success of his mission.
And if he was aware that Sidious was approaching his actions are worse. The arrival of Sidious would make Vader's survival more likely. It also meant Yoda had failed, so wouldn't the code call for him to take Sidious on?
To me it seems that not finishing Anakin was an omission of weakness. He couldn't bring himself to do what duty called for him to do - despite his declaration: "I will do what I must."