Fix AgentState dunder keys (#84)#92
Conversation
|
Hi! This PR fixes Issue #84. Please let me know if any more changes are needed. Thanks! |
QuantumByte-01
left a comment
There was a problem hiding this comment.
Critical bug — missing return statement in exception handler.
The return f"Error: {e}" is removed but no replacement is added:
except Exception as e:
logger.error("Error in handle_chat: %s", e)
logger.exception("Exception occurred in handle_chat")
# ← no return herehandle_chat will return None on any exception. The API caller expects a str, so this will cause downstream errors on every exception path. Please add a return statement, e.g.:
return "I encountered an error. Please try again."Scope creep: This PR also replaces all print() calls with logging throughout agents.py — that is exactly what PR #85 does. Both PRs will conflict. Please limit this PR to only the dunder key renames (__start_number__ → start_number, __previous_text__ → previous_text) and fix the missing return. The logging cleanup should stay in PR #85.
|
Thanks for the review!
Please let me know if anything else needs adjustment. |
QuantumByte-01
left a comment
There was a problem hiding this comment.
Clean fix — exactly what was asked for. Dunder keys renamed correctly, return statement restored, no scope creep. Good to merge.
Fix AgentState dunder keys
This PR fixes Issue #84 by removing double-underscore (
__dunder__) keys from theAgentStateTypedDict.Changes
__start_number__→start_number__previous_text__→previous_textThese changes avoid potential conflicts with Python internal naming conventions and improve code clarity.