You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by "chinawch007 (via GitHub)" <gi...@apache.org> on 2026/10/08 21:53:15 UTC
[I] bug(desktop): completed session cannot be archived after automatic title generation hangs during proxy cleanup [maka]
chinawch007 opened a new issue, #6010:
URL: https://github.com/apache/maka/issues/6010
### What happened
I created a session, asked a question, and received the answer. I performed no further actions in that session. When I tried to archive it the next day, Desktop repeatedly displayed:
> 归档任务失败
> 任务操作失败,请稍后重试。
Runtime Host rejected the operation with `session_busy`, reporting that the session still had a “live derived effect.”
The session remained named `New Chat`, although its automatic title model call had already been recorded as successful. The host still retained a `session-effect` residency many hours later.
Expected behavior: automatic title generation should settle after the request finishes, and a completed session should be archivable.
### How to reproduce
Conditions identified during investigation:
1. Configure an HTTP proxy.
2. Use an HTTPS model endpoint that negotiates HTTP/2 through the proxy.
3. Create a new session and send a question, triggering automatic title generation.
4. Wait for the answer, then try to archive the session.
The original incident involved one session and three failed archive attempts the following day. Waiting overnight is not required by the isolated reproduction: the hang occurs during connection cleanup after the title request succeeds.
An isolated reproduction using a local HTTPS server, a CONNECT proxy, and Maka’s transport code produced these results:
| Scenario | Result |
|---|---|
| HTTP proxy + HTTP/2 | Response succeeds; transport cleanup remains pending |
| HTTP proxy + HTTP/1.1 | Cleanup completes |
| Direct connection + HTTP/2 | Cleanup completes |
| HTTP proxy + HTTP/2, initiating dispatcher destruction before cancelling the tunnel | Cleanup completes in approximately 4 ms |
The failing and reordered cases were also reproduced with the project’s Electron executable in Node mode.
### Environment
- Maka: 0.2.0, dev build `371b4b2`
- Surface: Desktop / Runtime Host
- OS: macOS, Darwin 23.2.0, x64
- Electron: 43.4.1
- Embedded Node.js: 24.18.1
- Undici: 8.11.2
- Locale: zh-CN
- Model connection: `codex-subscription` / `openai-codex`
- Model: `gpt-6-astra`
- Network: HTTP proxy enabled
- Incident date: October 5, 2026
### Logs, screenshots, or additional context
Relevant error, with the session identifier redacted:
```text
Error occurred in handler for 'sessions:archive':
RuntimeHostOperationError: Session <session-id> has a live derived effect
{
operation: 'session.lifecycle.set',
code: 'session_busy'
}
```
The title call completed successfully at approximately 20:31:14 on October 4, with a latency of 7,504 ms. The final main model call completed at approximately 20:31:20. Archive attempts still failed around 14:00 the next day. These times are UTC+8.
The isolated reproduction identified a cleanup ordering issue:
- `createProxiedFetchTransport().close()` aborts the underlying proxy tunnel before destroying the dispatchers.
- Undici’s HTTP/2 cleanup uses `socket.destroy(err).on('close', callback)`.
- With the tunnel already aborted, TLS socket destruction can emit `close` synchronously, before that callback is registered.
- The missed event leaves dispatcher destruction pending.
- Automatic title generation awaits `transport.close()` before returning, so the title is never applied and its active effect is never released.
The reproduction captured `close` being emitted before callback registration. Expiry of the request’s abort deadline did not release the pending cleanup.
This mechanism matches the incident’s proxy configuration and retained title effect. The original diagnostic report did not record the negotiated HTTP version, so HTTP/2 was verified in the isolated reproduction rather than directly in the affected process.
The relevant abort-before-destroy behavior was introduced in `9f4e0268b` (#5043). Reordering cleanup resolved the isolated reproduction; a production fix should also preserve cancellation of pending TLS and proxy connection attempts.
<img width="1240" height="820" alt="Image" src="https://github.com/user-attachments/assets/9e7e615c-ce3e-45ac-8154-51f2697ab4f5" />
Investigation and reproduction were assisted by OpenAI Codex.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [I] bug(desktop): completed session cannot be archived after automatic title generation hangs during proxy cleanup [maka]
Posted by "ggbdpq (via GitHub)" <gi...@apache.org>.
ggbdpq commented on issue #6010:
URL: https://github.com/apache/maka/issues/6010#issuecomment-6070334834
take
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [I] bug(desktop): completed session cannot be archived after automatic title generation hangs during proxy cleanup [maka]
Posted by "ggbdpq (via GitHub)" <gi...@apache.org>.
ggbdpq commented on issue #6010:
URL: https://github.com/apache/maka/issues/6010#issuecomment-6070357133
untake
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [I] bug(desktop): completed session cannot be archived after automatic title generation hangs during proxy cleanup [maka]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #6010:
URL: https://github.com/apache/maka/issues/6010#issuecomment-6070339270
Issue #6010 is already assigned to chinawch007, so it was not reassigned.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [I] bug(desktop): completed session cannot be archived after automatic title generation hangs during proxy cleanup [maka]
Posted by "ggbdpq (via GitHub)" <gi...@apache.org>.
ggbdpq commented on issue #6010:
URL: https://github.com/apache/maka/issues/6010#issuecomment-6070356794
Withdrawing my take - this is already fixed by #5900 (open, awaiting review). The issue's own isolated reproduction validated the same reordering that PR implements: dispatcher teardown begins before the CONNECT tunnels are aborted ("Let dispatchers begin teardown before aborting CONNECT tunnels"), with a bounded race so close() settles even when a destroy stalls. That removes the abort-before-destroy window (#5043) in which undici's HTTP/2 cleanup can miss the socket close event, which is what kept this title generation's transport - and its session effect - alive.\n\nSuggesting this issue be closed as a duplicate of #5898/#5900 once that lands; happy to verify the title-generation path against #5900's branch if a maintainer prefers confirmation first.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org
Re: [I] bug(desktop): completed session cannot be archived after automatic title generation hangs during proxy cleanup [maka]
Posted by "chinawch007 (via GitHub)" <gi...@apache.org>.
chinawch007 closed issue #6010: bug(desktop): completed session cannot be archived after automatic title generation hangs during proxy cleanup
URL: https://github.com/apache/maka/issues/6010
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org