Skip to content

fix: error_message cannot be cleared on task status update #206

@bsbodden

Description

@bsbodden

Problem

update_task_status in agent_memory_server/tasks.py only sets error_message when the provided value is not None:

if error_message is not None:
    task.error_message = error_message

This means once an error_message is set on a task, it can never be cleared. If a task transitions from FAILED back to a new attempt (or if the error message needs to be reset), the stale error persists.

Impact

A task that previously failed and retains its error_message even after a successful resolution creates confusing state: status=SUCCESS + error_message="Connection refused".

Proposed Fix

Use a sentinel value pattern to distinguish "caller didn't pass error_message" from "caller wants to clear error_message". This allows error_message="" or a dedicated _UNSET sentinel to clear the field.

Related

Part of #190 (Summary Views and Tasks)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions