The treaty of Organia is described in full in the Starfleet Technical Manual1. The short answer to your question is that there are three key provisions that relate to the Federation's ongoing relations with the Klingon Empire
The treaty demands an immediate end to the current Klingon/Federation hostilities. It doesn't say that the Klingons and Federation can't fight (or even go to war) ever again in future, just that the present war has to end.
The treaty requires no future hostility between the Klingons and the Federation within a border zone around Organia. It doesn't say that all future conflicts between the Klingons and Federation outside this zone are prohibited.
At least one part of the treaty becomes null and void at the point that the Klingons and the Federation learn to get along. This arguably happened when the Khitomer accords were signed although we can assume that the proscription on visiting Organia (and fighting each other near it) probably remains in place.
TREATY OF PEACE
IMPOSED BY ORGANIA STARDATE 3193.5
THIS TREATY OF PEACE IS SIMULTANEOUSLY IMPOSED UPON THE KLINGON EMPIRE AND THE UNITED FEDERATION OF PLANETS. UNLESS YOUR GOVERNMENTS AND COMBATANTS IN GALACTIC SPACE AGREE TO AN IMMEDIATE CESSATION OF HOSTILITIES, YOUR ARMED FORCES WHEREVER THEY MAY BE WILL BE IMMEDIATELY DISABLED:
HENCEFORTH FROM THIS TIME, WITHIN A ZONE SEVEN HUNDRED AND FIFTY PARSECS IN WIDTH BETWEEN THE ADJACENT TERRITORIAL BOUNDARIES OF BOTH PARTIES, NO ARMED HOSTILITIES MAY TAKE PLACE BETWEEN THE KLINGON EMPIRE AND THE UNITED FEDERATION OF PLANETS:
AT ANY TIME, SHOULD A PERSON OR UNIT OF EITHER PARTY ATTEMPT TO ACT OR USE WEAPONRY IN A HOSTILE MANNER AGAINST THE PERSON OR A UNIT OF THE OTHER PARTY WITHIN THIS ZONE, THAT PERSON OR UNIT, AND THAT WEAPONRY, SHALL BE RENDERED IMMEDIATELY HARMLESS:
THE TIME WILL COME IN THE FUTURE WHEN THE KLINGON EMPIRE AND THE UNITED FEDERATION OF PLANETS WILL BECOME ALLIES AND GOOD FRIENDS, WORKING TOGETHER IN PEACE AND HARMONY FOR THE BETTERMENT OF BOTH. UNTIL THAT TIME, NEITHER PARTY MAY DENY TO THE OTHER PEACEFUL ACCESS TO ITS PLANETARY BASES WITHIN THE NEUTRAL ZONE FOR SHORE LEAVE, REST, AND REHABILITATION:
BOTH PARTIES WILL RESPECT THE TERRITORIAL INTEGRITY OF ORGANIA AND WILL MAKE NO FURTHER ATTEMPT TO INTRUDE INTO OUR PLANET'S TERRITORY OR AFFAIRS. WHEN THE TIME ARRIVES IN THE FUTURE FOR US TO JOIN WITH BOTH PARTIES IN THE PEACEFUL DEVELOPMENT OF INTRA-GALACTIC RELATIONS, WE WILL MAKE KNOWN TO YOU OUR INTENTIONS:
WE ARE AWARE THAT, WITHIN THE NEUTRAL ZONE, THERE ARE MANY PLANETARY SUB-CULTURES IN VARIOUS LEVELS OF EVOLUTIONARY DEVELOPMENT WHICH COULD BENEFIT FROM THE ADVANCED CULTURES OF THE KLINGON EMPIRE AND THE UNITED FEDERATION OF PLANETS. TO THIS END, ORGANIA WILL PERMIT SUCH PEACEFUL DEVELOPMENT AND, IN EACH SPECIFIC CASE, WILL AWARD SUCH RIGHTS TO THE PARTY WHICH DEMONSTRATES IT CAN MOST EFFICIENTLY DEVELOP THE PLANET TO THE BENEFIT OF ITS SOCIAL SYSTEMS.
1Although this book is now considered to be non-canon, at the time it was produced with Gene Roddenberry's blessing and with direct access to various (as yet unpublished) document archives, show bibles and production notes (and enjoyed considerable commercial success as a licenced property)