[Bug]: /compact on Muse threads hangs ~30 min, then fails generically; retry collides with run_active and wedges the thread#28436

opened9d agobyGgiri256

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Related but different: ACP registry compaction dispatch, Antigravity compaction capability, Codex /compact turn claim, and Muse resume hang. None covers manual compaction on the Muse provider.

Area

apps/server

Steps to reproduce

  1. Open a Muse provider thread with prior conversation history. Use a non-empty thread with several completed turns.
  2. Send /compact as a standalone message.
  3. Wait for the result.
  4. Send /compact again. If background work wakes in the same Muse session, the retry is more likely to fail.
  5. Send an ordinary follow-up message.

Expected behavior

/compact compacts promptly and reports success. Or it fails promptly with the real host reason shown. A compact requested while the session is busy is queued until the session is idle. A failed compact leaves the thread usable.

Actual behavior

Compaction never happens and context usage never changes.

The first /compact shows Context compaction, then fails after about 30 minutes with:

Provider error — "The provider event stream closed unexpectedly. Retry the turn; if it keeps failing, check the provider and server logs."

Muse had already recorded manual compaction failed: Some(InvalidTarget) within about one second. No compaction result reached T3. The run stayed open for about 1,801 seconds before the generic failure.

The second /compact fails with:

Provider error — "Provider turn failed."

The server log records the real reason: Muse session/compact failed: … rejected: run_active (MSP -32030). A background wake run was active at the time.

The next ordinary message also fails:

Provider turn recovery failed — "muse provider protocol error: This Muse turn is no longer active."

The thread is then wedged for normal use.

Source diagnosis on main: RunExecutionService routes an exact /compact message to compactThread. The Muse adapter in packages/provider-muse sends session/compact and finishes the turn only when a native compaction item reaches a terminal state. If the host fails compaction without emitting that item, the turn has no prompt failure path. The adapter also sends compaction without waiting for an active or wake run to finish, so the host run_active rejection is exposed. Its detail is then collapsed to the generic Provider turn failed. message.

Impact

Major degradation or frequent failure

Version or commit

T3 Code 0.1.5 stable. Same Muse compact path confirmed on main (0.1.6).

Environment

Linux. Muse provider (muse), model muse-wonder-1.0, Muse Code 1.4.14.

Logs or stack traces

shell
1manual compaction failed: Some(InvalidTarget)
2Muse session/compact failed: session/compact command … rejected: run_active
3# MSP code -32030, kind commandRejected, retryable: false

Workaround

Start a new thread. Do not rely on /compact in Muse threads with running background work.