update_task_context
Merge keys into persistent task context, preserving other keys. Use expected_version to guard concurrent writes, and keep a compact current state for AI agents.
Instructions
Merge keys into persistent task context, preserving other keys. Keep a compact current_state/next_step and retrieve history only when needed. Pass expected_version from get_task_context to guard concurrent writes. Returns a compact acknowledgment, not merged history. A conflict applies no write: read the relevant current keys, merge and retry explicitly.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | No | Attribution source for this context write. Defaults to agent_inferred. | |
| context | Yes | Object whose keys are merged (not replaced) into existing context | |
| task_id | Yes | The task ID whose context to update | |
| expected_version | No | Optimistic concurrency guard: the context version returned by get_task_context. Omit for an unguarded merge. |