COMPACTION_FAILURE_PREFIX = 'Compaction failed'Stable prefix for forced-compaction failure tool messages.
/offload drives the tool server-side and can only observe the resulting
ToolMessage text across the LangGraph server boundary, so it keys failure
detection on this prefix. Owning the literal here means the producer
(_forced_compact_error) and both consumers (app._drive_server_side_compaction
live-stream detection and app._find_compaction_failure committed-state scan)
reference one constant instead of re-hardcoding the wording independently.
Note: this value is deliberately identical to the leading text of the SDK's own
model-initiated compaction-failure message, so a failure emitted by either path
is recognized. Because the scan is bounded to messages produced by the current
/offload attempt, a stale failure from an unrelated prior turn is not matched.
Only the prefix position is load-bearing; wording after it is free to change.