fix: make task error_message clearable#210
Conversation
🛡️ Jit Security Scan Results✅ No security findings were detected in this PR
Security scan by Jit
|
There was a problem hiding this comment.
Review completed. Found one potential issue with the error_message handling logic that could lead to unexpected behavior when explicitly passing None.
🤖 Automated review complete. Please react with 👍 or 👎 on the individual review comments to provide feedback on their usefulness.
There was a problem hiding this comment.
Pull request overview
Updates task status updating logic so callers can clear an existing Task.error_message (previously “sticky”) while preserving the ability to omit the parameter and leave the stored value unchanged.
Changes:
- Introduce an
_UNSETsentinel default forerror_messageinupdate_task_statusto distinguish “not provided” vs “provided”. - Interpret
error_message=""as a request to clear the stored error message (None). - Add integration tests covering clear / no-change / replace behaviors.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
agent_memory_server/tasks.py |
Adds _UNSET sentinel and updates update_task_status to support clearing error_message. |
tests/integration/test_task_error_message_clearable.py |
Adds regression coverage for clearing vs leaving error_message unchanged. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
3b39fa4 to
0015978
Compare
Use a sentinel default so callers can distinguish "not provided" from "clear the field". Passing error_message="" now clears a previously set error message to None, while omitting the argument leaves it unchanged. Closes #206
0015978 to
9b488fd
Compare

Summary
error_messageinupdate_task_statusto distinguish "not provided" from "clear the field"error_message=""now clears a previously set error toNoneChanges
agent_memory_server/tasks.py: ReplaceNonedefault with_UNSETsentinel, treat empty string as cleartests/integration/test_task_error_message_clearable.py: 3 tests covering clear, no-change, and replace behaviorTest plan
Closes #206
Note
Low Risk
Low risk, localized change to
update_task_statussemantics plus a regression test; main risk is behavioral change for callers that previously relied on passingNoneto clear the field.Overview
Fixes task error handling so
update_task_statuscan distinguish “not provided” from “clear the field” by introducing an_UNSETsentinel default forerror_message.Passing
error_message=""(orNone) now clearsTask.error_messagetoNone, while omittingerror_messageleaves any existing value unchanged. Adds an integration regression test covering clear/no-change/replace behavior.Written by Cursor Bugbot for commit 92ea212. This will update automatically on new commits. Configure here.