Generate a short hex string for fallback session IDs. Only used when Cline fails to provide a `taskId`, which should be rare. Uses timestamp bits for uniqueness.
()
| 501 | /// Only used when Cline fails to provide a `taskId`, which should be |
| 502 | /// rare. Uses timestamp bits for uniqueness. |
| 503 | fn uuid_short() -> String { |
| 504 | use std::time::{SystemTime, UNIX_EPOCH}; |
| 505 | |
| 506 | let now = SystemTime::now() |
| 507 | .duration_since(UNIX_EPOCH) |
| 508 | .unwrap_or_default() |
| 509 | .as_millis(); |
| 510 | |
| 511 | // Use lower 32 bits of timestamp for a short hex ID |
| 512 | format!("{:08x}", (now & 0xFFFF_FFFF) as u32) |
| 513 | } |
| 514 | |
| 515 | // ============================================================================= |
| 516 | // Tests |
no outgoing calls