bash: the worker-wait promotion reply says the task won't wake a main session, but the completion notice comes
What occurs
In a main (not delegated) OpenCode session, bash with wait: true moves the command to the background at bash.worker_wait_max_ms. The reply tells the agent that the task will not wake it. Then the session gets the completion notice. An agent that believes the reply can start to poll bash_status, which the other replies tell it not to do.
Steps
AFT 0.68.0 (the text is the same in 0.68.1 and on main), OpenCode 2.4.2, user config "bash": { "worker_wait_max_ms": 120000 }, a main session:
bash({ command: "date -u +%FT%T.%3NZ; sleep 150; date -u +%FT%T.%3NZ; echo done-150", wait: true })- Wait for the reply, then for the end of the command.
Reply at 120 s:
The command is still running after 2 minutes, the worker wait limit (bash.worker_wait_max_ms), so it now runs in the background as bash-<task id>; it was not killed. It has run for 120.1s. It won't wake you when it finishes. Use bash_status({ taskId: "bash-<task id>" }) to check whether it has finished or inspect output, or stop it with bash_kill({ taskId: "bash-<task id>" }) if it should have finished by now. Don't report a result until it finishes.
Recent output:
2026-11-29T05:37:16.451Z
When the command ended, the session got this notice:
[BACKGROUND BASH COMPLETED]
- task bash-<task id> (exit 0)
2026-11-29T05:37:16.451Z
2026-11-29T05:39:46.452Z
done-150
Expected
In a main session, the reply says that a completion reminder will come, as the reply for a normal foreground promotion does ("A completion reminder will be delivered automatically; …"). The text "It won't wake you" stays for delegated (worker) sessions.
Cause
crates/aft/src/commands/bash_orchestrate.rs:286 (0.68.0) always adds "It won't wake you when it finishes." On main, the same text is at crates/aft-tools/src/commands/bash_orchestrate.rs:287. The worker-wait limit was first made for delegated sessions (#398), where that sentence is correct. But the same limit also stops wait: true in main sessions, and AFT sends the completion notice there. format_promotion_message in the same file gets worker_session and selects its text from it. The worker-wait message has no such input.