Vouch request: fix critical OMP hang from Mermaid infinite routing + aborted replay #4848
Closed
honsunrise
started this conversation in
General
Replies: 1 comment
|
vouched! |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi maintainers,
I'd like to request a vouch for a focused fix to a critical OMP hang that can make a session unrecoverable and drive CPU/memory until the user kills the process. I initially opened PR #4846 before noticing the vouch requirement, so it was auto-closed as expected. Per CONTRIBUTING.md, this discussion is the vouch request; the branch is still available and has since been updated with the full root-cause fix.
The failure has two connected parts. First, session replay can keep aborted/error assistant turns in non-transcript LLM context. In the real failing session, the aborted/error assistant was not always the final JSONL entry because
session_exitand later user turns followed it, so a tail-only filter was insufficient. Replaying those dead assistant turns can leave resume/retry paths trying to continue from an unsafe assistant state instead of letting the next user turn proceed. The branch now drops all non-continuitystopReason: "aborted" | "error"assistant turns from active LLM context while preserving transcript visibility and interrupted-thinking continuity. It also guards parent traversal with a seen-id set so corrupt parent links cannot loop forever during context reconstruction.The second and more severe root cause was in Mermaid rendering. A small
graph TDemitted by the assistant consistently reproduced the hang: the vendoredmermaid-asciiA* edge pathfinder searched an unbounded non-negative grid when a route was impossible. That makes TUI rendering capable of entering an effectively infinite search during transcript render/resume, matching the observed "OMP freezes while outputting Mermaid" behavior. The branch bounds the routing search to a small corridor around occupied cells and keeps the existing direct-segment fallback for unroutable edges. The same reproducer now renders successfully in a fresh Bun process instead of timing out.Branch: https://github.com/honsunrise/oh-my-pi/tree/fix/session-context-replay-tail
Closed PR: #4846
Latest branch commit:
2e6c60321 fix: prevent OMP hangs from Mermaid routing and abort replayMain changes in the branch:
packages/coding-agent/src/session/session-context.tspackages/coding-agent/src/session/agent-session.tspackages/utils/src/vendor/mermaid-ascii/ascii/pathfinder.tsFocused checks run locally:
I also rebuilt my local installed
ompbundle and verified the reported old resume paths return quickly. If a maintainer is willing to vouch me, I'll reopen #4846 or open a fresh PR, whichever you prefer.All reactions