fix: do not crash if runtime parameter is not set in code exec (#641)

Co-authored-by: Rafael Uzarowski <uzarowski.rafael@proton.me>
This commit is contained in:
ehl0wr0ld 2025-07-31 09:55:58 +02:00 committed by GitHub
parent c31d0dbf97
commit edffad2ea9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -71,7 +71,7 @@ class CodeExecution(Tool):
def get_heading(self, text: str = ""):
if not text:
text = f"{self.name} - {self.args['runtime']}"
text = f"{self.name} - {self.args['runtime'] if 'runtime' in self.args else 'unknown'}"
text = truncate_text_string(text, 60)
session = self.args.get("session", None)
session_text = f"[{session}] " if session or session == 0 else ""