Fix logging on interrupt.

This commit is contained in:
AI Christianson 2024-12-26 17:28:39 -05:00
parent 5f0605dbc0
commit 868835ece8
2 changed files with 10 additions and 0 deletions

View File

@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
- Fix logging on interrupt.
## [0.10.2] - 2024-12-26
- Add logging.

View File

@ -165,6 +165,8 @@ def run_research_agent(
# Run agent with retry logic
logger.debug("Research agent completed successfully")
return run_agent_with_retry(agent, prompt, run_config)
except (KeyboardInterrupt, AgentInterrupt):
raise
except Exception as e:
logger.error("Research agent failed: %s", str(e), exc_info=True)
raise
@ -258,6 +260,8 @@ def run_web_research_agent(
# Run agent with retry logic
logger.debug("Web research agent completed successfully")
return run_agent_with_retry(agent, prompt, run_config)
except (KeyboardInterrupt, AgentInterrupt):
raise
except Exception as e:
logger.error("Web research agent failed: %s", str(e), exc_info=True)
raise
@ -334,6 +338,8 @@ def run_planning_agent(
print_stage_header("Planning Stage")
logger.debug("Planning agent completed successfully")
return run_agent_with_retry(agent, planning_prompt, run_config)
except (KeyboardInterrupt, AgentInterrupt):
raise
except Exception as e:
logger.error("Planning agent failed: %s", str(e), exc_info=True)
raise