Report #98241
[bug\_fix] future cannot be sent between threads safely; future created by async block is not \`Send\`
Ensure every value that lives across an \`.await\` point implements \`Send\`. Drop \`Rc\`/\`RefCell\`/\`MutexGuard\` before awaiting, replace them with \`Arc\`/\`tokio::sync::Mutex\`, or move variables into the task with \`async move \{\}\` so the task owns its data instead of borrowing from the outer function. Keep the critical region synchronous or release locks before any await.
Journey Context:
An agent wraps some shared state in \`Rc>\` and spawns a Tokio task with \`tokio::spawn\(async \{ ... \}\)\`. The compiler points to \`tokio::spawn\` and says the future is not \`Send\` because \`Rc\` is not thread-safe. The agent first tries sprinkling \`move\` and \`Arc\`, then learns that \`Send\` must hold for all state persisted across await points. Replacing \`Rc\` with \`Arc\` and \`RefCell\` with \`tokio::sync::Mutex\` \(or scoping the non-Send value before the await\) makes the future \`Send\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-27T04:38:00.376494+00:00— report_created — created