apache / apache/maka

fix(desktop): keep packaged 0.1.11 sessions usable after rate-limit errors

Open
#3,302 1 comment 0 reactions 1 assignee Claimed by @CxHsin View on GitHub
bug
Dominant language
TypeScript
Stars
5.4k
Forks
502
Avg merge
1d 2h
Merged PRs (30d)
716

Description

## Summary

In the packaged macOS Desktop build, a model rate-limit error was followed by repeated Runtime Host session-observation failures. The session became effectively unusable: transcript/session observers ended before becoming ready, and regenerate requests were rejected as `session_busy`.

This appears related to, but distinct from, #2516. That issue covers semantic classification of provider usage limits; this report covers the Desktop/Runtime Host lifecycle and recovery after the error.

## Observed

The user-visible error was:

```text
操作失败
触发模型速率限制
```

During the same captured window, the main-process diagnostics recorded:

- MCP capability refresh/startup failures because native tools had invalid schemas:
- `mcp__memory__create_entities`
- `mcp__playwright__browser_close`
- Repeated `runtime-host-session-observer` subscription recovery due to `slow_consumer`
- Repeated `sessions:transcript:open` failures: `Transcript observation ended before it became ready`
- Repeated `sessions:listActiveInteractions` / `sessions:observe` failures: `Runtime Host Session observer closed while opening` and `Session observation ended before it became ready`
- Repeated regenerate failures: `RuntimeHostOperationError: Session already has an active or pending root Turn` (`operation: turn.regenerate`, `code: session_busy`)

## Environment

- Maka: 0.1.11
- Build: packaged
- Electron: 43.2.0
- Chrome: 150.0.7871.129
- Node: 24.18.0
- OS: macOS 25.6.0, arm64
- Locale: zh-CN
- Captured at: 2026-08-20 09:21:13 +0800
- Runtime Host: protocol v0, compatibility 25, state `ready`

## Expected

- A provider rate-limit error should leave the session in a recoverable state.
- Session/transcript observers should not fail merely because an observation subscription is recovering or closes during startup.
- Regenerate should either wait for/abort the pending root turn or return a stable user-facing state, rather than repeatedly surfacing `session_busy`.
- An invalid optional MCP tool schema should not make the Desktop Runtime Host capability refresh/startup fail globally; the invalid capability should be isolated and reported clearly.

## Reproduction clues

The report does not establish which observer error is the root cause. Please correlate the rate-limit path, slow-consumer recovery, observation readiness/cleanup, and root-turn state handling in the packaged Desktop build.

The complete diagnostic report was supplied by the reporter; the key captured details are reproduced above.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.