Skip to content

fix: make task error_message clearable#210

Merged
abrookins merged 2 commits intomainfrom
bsb/fix-task-error-message-clearable
Mar 17, 2026
Merged

fix: make task error_message clearable#210
abrookins merged 2 commits intomainfrom
bsb/fix-task-error-message-clearable

Conversation

@bsbodden
Copy link
Collaborator

@bsbodden bsbodden commented Mar 13, 2026

Summary

  • Use a sentinel default for error_message in update_task_status to distinguish "not provided" from "clear the field"
  • Passing error_message="" now clears a previously set error to None
  • Omitting the argument leaves the existing value unchanged

Changes

  • agent_memory_server/tasks.py: Replace None default with _UNSET sentinel, treat empty string as clear
  • tests/integration/test_task_error_message_clearable.py: 3 tests covering clear, no-change, and replace behavior

Test plan

  • All 3 new integration tests pass
  • Full existing test suite passes (710 passed, 0 failures)

Closes #206


Note

Low Risk
Low risk, localized change to update_task_status semantics plus a regression test; main risk is behavioral change for callers that previously relied on passing None to clear the field.

Overview
Fixes task error handling so update_task_status can distinguish “not provided” from “clear the field” by introducing an _UNSET sentinel default for error_message.

Passing error_message="" (or None) now clears Task.error_message to None, while omitting error_message leaves 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.

Copilot AI review requested due to automatic review settings March 13, 2026 23:15
@jit-ci
Copy link

jit-ci bot commented Mar 13, 2026

🛡️ Jit Security Scan Results

CRITICAL HIGH MEDIUM

✅ No security findings were detected in this PR


Security scan by Jit

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 _UNSET sentinel default for error_message in update_task_status to 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.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

@bsbodden bsbodden force-pushed the bsb/fix-task-error-message-clearable branch from 3b39fa4 to 0015978 Compare March 13, 2026 23:38
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
@bsbodden bsbodden force-pushed the bsb/fix-task-error-message-clearable branch from 0015978 to 9b488fd Compare March 13, 2026 23:53
@bsbodden bsbodden self-assigned this Mar 14, 2026
@bsbodden bsbodden added the bug Something isn't working label Mar 14, 2026
Copy link
Contributor

@justin-cechmanek justin-cechmanek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

@abrookins abrookins merged commit b69d9f0 into main Mar 17, 2026
21 checks passed
@abrookins abrookins deleted the bsb/fix-task-error-message-clearable branch March 17, 2026 00:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: error_message cannot be cleared on task status update

4 participants