Repository navigation
Closed
19 / 1919 of 19 issues completedClosed
19 / 1919 of 19 issues completed
Copy link
Labels
Description
Overview
Profiling investigation of openhands-sdk v1.19.1 and openhands-agent-server v1.19.1 uncovered 19 performance and correctness issues across the SDK and agent server. This tracking issue organizes them by severity.
Methodology: Austin wall-time stack sampling profiler + targeted benchmarks using TestLLM (scripted responses, zero LLM cost) to isolate SDK/server overhead from LLM latency. Conversations scaled from 50 to 2000 steps, 1 to 16 concurrent threads.
Broadly related upstream work:
- test: add agent-server stress suite and known-bug xfail markers #3101 — test: add agent-server stress suite and known-bug xfail markers (open PR)
- Make View construction incremental and tied to ConversationState #3053 — Make View construction incremental and tied to ConversationState (open issue)
Critical — Correctness and scaling blockers
- perf: O(N²) total cost per conversation from full-history re-scan every step #3134
- perf: GIL prevents threading from scaling conversation throughput #3135
- bug: atexit memory leak prevents conversation cleanup #3136
- bug: litellm.modify_params global state race condition under concurrency #3137
- bug: os.environ credential bleed across conversations in multi-tenant server #3138
- bug: SpanManager uses global stack shared across threads #3139
High — Significant performance and resource issues
- perf: agent server loads all conversations eagerly at startup #3140
- perf: no eviction or idle timeout for finished conversations #3141
- perf: O(N) full scan for conversation search and count #3142
- perf: default thread pool with no backpressure for conversation execution #3143
- perf: lease renewal I/O storm at scale #3144
- perf: ConversationState autosave on every field mutation #3145
- perf: InMemoryFileStore LRU cache is unbounded per conversation #3146
- bug: send_message fire-and-forget TOCTOU race #3147
- perf: hook subprocess fork per tool call #3148
- bug: ToolExecutor close() never called on conversation close #3149
Medium — Optimization opportunities
- perf: Condensation.forgotten_event_ids is a list, not a set — O(V×F) per application #3150
- perf: sequential PubSub dispatch blocks all subscribers on slow client #3151
- bug: unbounded WebSocket connections per conversation #3152
Key findings summary
| Finding | Severity | Impact |
|---|---|---|
| O(N²) per-step cost from full-history rescan | Critical | 9.1× slowdown at 2000 steps |
| GIL prevents threading from scaling | Critical | Flat throughput regardless of thread count |
| atexit leak pins conversations in memory | Critical | OOM on long-running servers |
| litellm.modify_params race condition | Critical | Silent LLM call corruption |
| os.environ credential bleed | Critical | Cross-tenant credential exposure |
| SpanManager global stack | Critical | Broken distributed tracing |
| Eager conversation loading at startup | High | O(N) startup time |
| No eviction for finished conversations | High | Monotonic memory growth |
| O(N) conversation search/count | High | Slow list API at scale |
| Default thread pool, no backpressure | High | Silent queuing of conversations |
| Lease renewal I/O storm | High | ~33 file ops/s at 500 conversations |
| ConversationState autosave per mutation | High | 10-100× excess I/O per step |
| Unbounded InMemoryFileStore cache | High | ~500 MB at 500 conversations |
| send_message TOCTOU race | High | Double-execution of conversations |
| Hook subprocess fork per tool call | High | 150 forks per 50-step conversation |
| ToolExecutor close() never called | High | Resource leak on conversation close |
| forgotten_event_ids list not set | Medium | O(V×F) condensation |
| Sequential PubSub dispatch | Medium | Slow client blocks all subscribers |
| Unbounded WebSocket connections | Medium | No limit on per-conversation connections |
This issue and its sub-issues were created by an AI agent (OpenHands) on behalf of the user, based on profiling investigation findings from May 2026.
Sub-issues
Collapse Sub-issuesSub-issues
Loading 19 sub-issues
Activity
jamiechicago312 commentedon Jun 25, 2026
👍 Also experiencing this on the agent-canvas dev stack (Windows, openhands-agent-server v1.28.1, ~89 persisted conversations). The eager startup resume alone accounts for ~40 s before
/server_inforeturns 200, which is the dominant user-visible cost ofnpm run dev. Detailed log evidence plus an adjacent observation about secrets being re-attached to dormant conversations on resume is on #3140.(This comment was drafted by an AI agent (OpenHands) on behalf of the user.)